HostConnectDrive Method (IntPtr, String, String, NetworkCredential, Boolean, Boolean, Boolean) |
Creates a connection to a network resource. The function can redirect a local device to a network resource.
Namespace: Alphaleonis.Win32.NetworkAssembly: AlphaFS (in AlphaFS.dll) Version: 2.0
Syntax public static string ConnectDrive(
IntPtr winOwner,
string localName,
string remoteName,
NetworkCredential credentials,
bool prompt,
bool updateProfile,
bool saveCredentials
)
Public Shared Function ConnectDrive (
winOwner As IntPtr,
localName As String,
remoteName As String,
credentials As NetworkCredential,
prompt As Boolean,
updateProfile As Boolean,
saveCredentials As Boolean
) As String
public:
static String^ ConnectDrive(
IntPtr winOwner,
String^ localName,
String^ remoteName,
NetworkCredential^ credentials,
bool prompt,
bool updateProfile,
bool saveCredentials
)
static member ConnectDrive :
winOwner : IntPtr *
localName : string *
remoteName : string *
credentials : NetworkCredential *
prompt : bool *
updateProfile : bool *
saveCredentials : bool -> string
Parameters
- winOwner
- Type: SystemIntPtr
Handle to a window that the provider of network resources can use as an owner window for dialog boxes. - localName
- Type: SystemString
The name of a local device to be redirected, such as "F:". When localName is or
string.Empty, the last available drive letter will be used. Letters are assigned beginning with Z:, then Y: and so on.
- remoteName
- Type: SystemString
The network resource to connect to. The string can be up to MAX_PATH characters in length. - credentials
- Type: System.NetNetworkCredential
An instance of NetworkCredential which provides credentials for password-based authentication schemes such as basic,
digest, NTLM, and Kerberos authentication.
- prompt
- Type: SystemBoolean
always pop-ups an authentication dialog box. - updateProfile
- Type: SystemBoolean
successful network resource connections will be saved. - saveCredentials
- Type: SystemBoolean
When the operating system prompts for a credential, the credential should be saved by the credential manager when true.
Return Value
Type:
StringIf
localName is
or
string.Empty, returns the last available drive letter, null otherwise.
See Also