Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Support Forum
Download Visual Studio Add-In

Terms of Use
Privacy Policy

Search Results for "WNetAddConnection2" in [All]

netapi32

.

You can also use the WNetAddConnection2 and WNetAddConnection3 functions to redirect a local device to a network resource. Connections added by NetUseAdd are not shown in the Explorer. You should use one of the WNetAddConnection methods to make the networkdrive visible in the explorer.

mpr

.
Summary
.

private static extern int WNetAddConnection2( NETRESOURCE lpNetResource,

.

int result = WNetAddConnection2(nr, password, user, (int)ResourceConnection.CONNECT_TEMPORARY);

.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wnet/wnet/wnetaddconnection2.asp

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

The WNetAddConnection2 function supersedes the WNetAddConnection function. If you can pass a handle to a window that the provider of network resources can use as an owner window for dialog boxes, call the WNetAddConnection3 function instead.

.

public static extern int WNetAddConnection2(ref NETRESOURCE netResource,

.

public static extern int WNetAddConnection2(NETRESOURCE netResource,

.

  //    [DllImport("Mpr.dll", EntryPoint="WNetAddConnection2", CallingConvention=CallingConvention.Winapi)]

.

  //      private static extern ErrorCodes WNetAddConnection2(NETRESOURCE lpNetResource,ref string lpPassword,ref

.

public static extern int WNetAddConnection2( [In] NETRESOURCE netResource,

.

Declare Function WNetAddConnection2 Lib "mpr.dll" (ByRef netResource As _

.

Declare Function WNetAddConnection2 Lib "mpr.dll" (netResource As _

.

// int ret = WNetAddConnection2( myNetResource, "username", "password", 0);

.

int ret = WNetAddConnection2( myNetResource, "password", "username", 0); //by honglinlee

.

    var result = WNetAddConnection2(

.

    private static extern int WNetAddConnection2(NetResource netResource,

.

    private static extern int WNetAddConnection2(NETRESOURCE lpNetResource, string lpPassword, string lpUsername, int dwFlags);

.

        int result = WNetAddConnection2(myNetResource, password, user, 0);

.

    returnValue = WNetAddConnection2(myResource, password, username, 0)

.
Documentation
[WNetAddConnection2] on MSDN
.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wnet/wnet/wnetaddconnection2.asp


 
Access PInvoke.net directly from VS: