Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than netapi32, prefix the name with the module name and a period.
NetUseAdd (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.
These structures are declared using C# ability to alias types with the using statement.
Tips & Tricks:
You need to declare the Struct in a separate code file called Structures, and then reference it in your main code instance. Otherwise the code will not work.
Also, you will need to add the following using statements to it:
uint paramErrorIndex;
uint returnCode = NetUseAdd(null, 2, ref useInfo, out paramErrorIndex);
if (returnCode != 0)
{
throw new Win32Exception((int)returnCode);
}
Alternative Managed API:
TODO
The NetUseAdd function establishes a connection between the local computer and a remote server. You can specify a local drive letter or a printer device to connect. If you do not specify a local drive letter or printer device, the function authenticates the client with the server for future connections.
5/8/2009 2:10:37 PM - Christian Rodemeyer-84.152.7.204
The WNetAddConnection2 function makes a connection to a network resource. The function can redirect a local device to the network resource.
9/5/2012 10:52:40 PM - -78.237.25.102
TODO - a short description
11/1/2010 9:34:42 AM - 220.10.204.141
The NetUseAdd function establishes a connection between the local computer and a remote server. You can specify a local drive letter or a printer device to connect. If you do not specify a local drive letter or printer device, the function authenticates the client with the server for future connections.
5/8/2009 2:10:37 PM - Christian Rodemeyer-84.152.7.204
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).