This project's intent is to encapsulate the WNet functionnalities, or at list a part of them.
You can either connect using username and password, or ask for an authentication prompt. This operation will create a trustzs connection between the host and the targeted machine.
Native method documentation
// With prompt
string targetUNC = "\\RemoteComputerUNC";
PinvokeWindowsNetworking.ConnectToRemote(targetUNC, null, null, promptUser: true)
// With credentials
string targetUNC = "\\RemoteComputerUNC";
string userName = "DOMAIN\Username"
string password = "123456"
PinvokeWindowsNetworking.ConnectToRemote(targetUNC, userName, password, promptUser: true)
Closes a connection created with WNetUseConnection.
Native method documentation
string targetUNC = "\\RemoteComputerUNC";
PinvokeWindowsNetworking.DisconnectRemote(targetUNC)