Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista General Discussion > Programmatically (Win32/MFC) checking the status of mapped network

Reply
Thread Tools Display Modes

Programmatically (Win32/MFC) checking the status of mapped network

 
 
Sudesh Shetty
Guest
Posts: n/a

 
      11-29-2007
Hi

How can I programmatically (Win32/MFC) check the status of mapped
network(i.e. server is connected or disconnected)?

We have a local server to which many clients can be connected.
I have connected to this server and mapped to particular drive(say Z:\).
In the server we can get all the Client IP which are connected to this
server(Control Panel/Administrative tools/Computer Management/Shared
folders/Sessions). Here we can disconnect a particular client.

I have to check the status of this server(mapped network) in my client
Even if we disconnect the client in server, the mapped drive still exists in
my client.
So API's like GetLogicaldrive,GetLogicalDriveStrings,_access fails to give
the right status. Which API I can use to get the right status?

One more information- When client is disconnected in the server, if I use
"net use" cmd promt in client it shows status is "Disconnected". But still I
can write some file to the mapped drive using fopen(),fwrite() and this
file will be reflected in the server also. I am more confused by this
behavior.
Can anyone help me to resolve this issue?

Best Regards
Sudesh


 
Reply With Quote
 
 
 
 
Bistey Csaba
Guest
Posts: n/a

 
      11-29-2007
Sudesh Shetty wrote:
> Hi
>
> How can I programmatically (Win32/MFC) check the status of mapped
> network(i.e. server is connected or disconnected)?
>
> We have a local server to which many clients can be connected.
> I have connected to this server and mapped to particular drive(say Z:\).
> In the server we can get all the Client IP which are connected to this
> server(Control Panel/Administrative tools/Computer Management/Shared
> folders/Sessions). Here we can disconnect a particular client.
>
> I have to check the status of this server(mapped network) in my client
> Even if we disconnect the client in server, the mapped drive still exists in
> my client.
> So API's like GetLogicaldrive,GetLogicalDriveStrings,_access fails to give
> the right status. Which API I can use to get the right status?
>


One possible solution for your problem is WNetGetConnection function:

Described here: http://msdn2.microsoft.com/en-us/library/aa385453.aspx
Example to use it here:
http://msdn2.microsoft.com/en-us/library/aa385374.aspx

Another one is NetUseGetInfo function.
Described here: http://msdn2.microsoft.com/en-us/library/Aa370648.aspx

Csaba
 
Reply With Quote
 
Sudesh Shetty
Guest
Posts: n/a

 
      12-01-2007


"Bistey Csaba" wrote:

> Sudesh Shetty wrote:
> > Hi
> >
> > How can I programmatically (Win32/MFC) check the status of mapped
> > network(i.e. server is connected or disconnected)?
> >
> > We have a local server to which many clients can be connected.
> > I have connected to this server and mapped to particular drive(say Z:\).
> > In the server we can get all the Client IP which are connected to this
> > server(Control Panel/Administrative tools/Computer Management/Shared
> > folders/Sessions). Here we can disconnect a particular client.
> >
> > I have to check the status of this server(mapped network) in my client
> > Even if we disconnect the client in server, the mapped drive still exists in
> > my client.
> > So API's like GetLogicaldrive,GetLogicalDriveStrings,_access fails to give
> > the right status. Which API I can use to get the right status?
> >

>
> One possible solution for your problem is WNetGetConnection function:
>
> Described here: http://msdn2.microsoft.com/en-us/library/aa385453.aspx
> Example to use it here:
> http://msdn2.microsoft.com/en-us/library/aa385374.aspx
>
> Another one is NetUseGetInfo function.
> Described here: http://msdn2.microsoft.com/en-us/library/Aa370648.aspx
>
> Csaba
>



Hi
Thanks for your reply.
But this didn't resolve my issue.
WNetGetConnection(), NetUseGetInfo() returns same value in both the
cases(connected, disconnected).
Regards
Sudesh
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Network Mapped Drive : Lost Network Connection Ian Robert Windows Vista Networking 14 08-24-2007 09:58 AM
Ridiculous Methods for Checking Network Status Spikeys-World Windows Vista Networking 1 07-14-2007 07:30 PM
Mapped network drives susan Windows Vista Networking 1 06-07-2007 12:18 AM
Mapped Network Share through VPN Doting Daddy Windows Vista Networking 1 05-27-2006 01:16 PM
Mapped Network Share through VPN Doting Daddy Windows Vista Networking 2 05-27-2006 01:16 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59