Click here to Skip to main content
13,052,714 members (66,279 online)
Click here to Skip to main content
Add your own
alternative version


14 bookmarked
Posted 30 Jan 2004

Full functional .NET Wrapper for the WNet API

, 30 Jan 2004
Rate this:
Please Sign up or sign in to vote.
A simple project containing .NET function-wrappers of WNet API.
<!-- Add the rest of your HTML here -->


This is a full functional .Net-wrapper to allow easiest access to the WNet API.

The project have the following function-wrappers:

void AddConnection(string remoteName, string password, string localName);
void AddConnection(NetResource netResource, string password, 
       string userName, ConnectionFlags options);
void AddConnection(Control ownerWindow, 
       NetResource netResource, string password, 
       string userName, ConnectionFlags options);
void CancelConnection(string name, bool isForce);
void CancelConnection(string name, ConnectionFlags options, bool isForce);
DialogResult ConnectionDialog(Control ownerWindow, ResourceType type);
DialogResult ConnectionDialog(ConnectDialogInfo info);
DialogResult DisconnectWithDialog(Control ownerWindow, ResourceType type);
NetResource[] EnumResources(ResourceScope scope, 
       ResourceType type, ResourceUsage usage, NetResource target);
string GetConnectionRemoteName(string localName);
string GetConnection(string localName);
void GetLastError(out int errorCode, 
       out string errorText, out string providerName);
NetInfo GetNetworkInformation(string provider);
string GetProviderName(NetworkType netType);
string GetUser(string name);
ConnectInfo GetConnectionPerformance(NetResource netResource);
NetResource GetResourceInformation(NetResource netResource, out string path);
NetResource GetResourceInformation(NetResource netResource);
NetResource GetResourceParent(NetResource netResource);
string GetUniversalName(string localPath);
RemoteNameInfo GetRemoteUniversalName(string localPath);
string UseConnection(Control ownerWindow, 
       NetResource netResource, string password, 
       string userId, ConnectionFlags flags);

The following functions still have not been wrapped:



This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Web Developer
Russian Federation Russian Federation
No Biography provided

You may also be interested in...


Comments and Discussions

GeneralThanks! Pin
ethedy5-Feb-10 1:41
memberethedy5-Feb-10 1:41 
GeneralGetting error while trying to get UNC path Pin
Member 173583711-Jun-09 9:21
memberMember 173583711-Jun-09 9:21 
QuestionLicense? Pin
Andrew Saals14-Aug-08 19:57
memberAndrew Saals14-Aug-08 19:57 
GeneralGreat article Pin
TomV@CodeProject7-Aug-07 21:55
memberTomV@CodeProject7-Aug-07 21:55 
GeneralWNetConnectionDialog1 Pin
nmdange11-Mar-04 3:19
membernmdange11-Mar-04 3:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170713.1 | Last Updated 31 Jan 2004
Article Copyright 2004 by DarkGraySerge
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid