Skip to content

Latest commit

 

History

History
57 lines (40 loc) · 1.42 KB

File metadata and controls

57 lines (40 loc) · 1.42 KB

Home

Function name : WNetAddConnection2

Group: Windows Networking - Library: mpr


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


Code examples:

Mapping and disconnecting network drives

Declaration:

DWORD WNetAddConnection2(
  LPNETRESOURCE lpNetResource,
  LPCTSTR lpPassword,
  LPCTSTR lpUsername,
  DWORD dwFlags
);  

FoxPro declaration:

DECLARE INTEGER WNetAddConnection2 IN mpr;
	STRING @ lpNetResource,;
	STRING   lpPassword,;
	STRING   lpUsername,;
	INTEGER  dwFlags
  

Parameters:

lpNetResource [in] Pointer to a NETRESOURCE structure that specifies details of the proposed connection.

lpPassword [in] Pointer to a constant null-terminated string that specifies a password to be used in making the network connection. Must be NULL for Windows Me/98/95.

lpUsername [in] Pointer to a constant null-terminated string that specifies a user name for making the connection. Must be NULL for Windows Me/98/95.

dwFlags [in] Connection options. The following values are currently defined.


Return value:

If the function succeeds, the return value is NO_ERROR (0).