Click here to Skip to main content
Click here to Skip to main content

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 -->

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
No Biography provided

Comments and Discussions

 
GeneralThanks! Pinmemberethedy5-Feb-10 1:41 
GeneralGetting error while trying to get UNC path PinmemberMember 173583711-Jun-09 9:21 
GeneralGreat article PinmemberTomV@CodeProject7-Aug-07 21:55 
GeneralWNetConnectionDialog1 Pinmembernmdange11-Mar-04 3:19 

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.

| Advertise | Privacy | Mobile
Web04 | 2.8.140721.1 | Last Updated 31 Jan 2004
Article Copyright 2004 by DarkGraySerge
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid