C# .NET - how to use wnetuseconnection in c#.net in asp.net,

Asked By anbu n on 29-Sep-11 03:42 AM

how to use wnetuseconnection in c#.net in asp.net,

is their any sample , do i need to install win  32 API for this,

i need to find the file/ foldr/ directory in remote machine & i want to upload all folders & files inside the path to my folder in webserver

Reena Jain replied to anbu n on 29-Sep-11 03:07 PM

The WNetUseConnection function makes a connection to a network resource. The function can redirect a local device to a network resource.

The WNetUseConnection function is similar to the http://msdn.microsoft.com/en-us/library/aa385418.aspx function. The main difference is that WNetUseConnection can automatically select an unused local device to redirect to the network resource.


DWORD WNetUseConnection(
  __in   HWND hwndOwner,
  __in   LPNETRESOURCE lpNetResource,
  __in   LPCTSTR lpPassword,
  __in   LPCTSTR lpUserID,
  __in   DWORD dwFlags,
  __out    LPTSTR lpAccessName,
  __inout  LPDWORD lpBufferSize,
  __out    LPDWORD lpResult