Click here to Skip to main content
Licence 
First Posted 30 Jan 2004
Views 34,828
Bookmarked 14 times

Full functional .NET Wrapper for the WNet API

By | 30 Jan 2004 | Article
A simple project containing .NET function-wrappers of WNet API.

Introduction

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:

WNetConnectionDialog1
WNetDisconnectDialog1

License

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

DarkGraySerge

Web Developer

Russian Federation Russian Federation

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralThanks! Pinmemberethedy1:41 5 Feb '10  
GeneralGetting error while trying to get UNC path PinmemberMember 17358379:21 11 Jun '09  
QuestionLicense? PinmemberAndrew Saals19:57 14 Aug '08  
GeneralGreat article PinmemberTomV@CodeProject21:55 7 Aug '07  
GeneralWNetConnectionDialog1 Pinmembernmdange3:19 11 Mar '04  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    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 | Mobile
Web02 | 2.5.120517.1 | Last Updated 31 Jan 2004
Article Copyright 2004 by DarkGraySerge
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid