"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