Skip to content

XalbatEcheverria/WindowsNetworking.Standard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

WindowsNetworking

This project's intent is to encapsulate WNet functionnalities, or at list part of them.

Currently supported WNet features

Connect to remote with WNetUseConnection

You can either connect using username and password, or ask for an authentication prompt. This operation will create a trust connection between the host and the targeted machine.
Native method documentation

// With prompt
  string targetUNC = "\\RemoteComputerUNC";
  PinvokeWindowsNetworking.ConnectToRemote(targetUNC, null, null, prompUser: true)

// With credentials
  string targetUNC = "\\RemoteComputerUNC";
  string userName = "DOMAIN\Username"
  string password = "123456"
  PinvokeWindowsNetworking.ConnectToRemote(targetUNC, userName, password, prompUser: true)

Disconnect from remote with WNetCancelConnection2

Closes a connection created with WNetUseConnection.
Native method documentation

  string targetUNC = "\\RemoteComputerUNC";
  PinvokeWindowsNetworking.DisconnectRemote(targetUNC)

About

WNet C# encapsulation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages