Class WindowsCredentials
Provides an interface to the Windows Credentials API. Supported on Windows XP or newer.
Namespace: NanoByte.Common.Native
Assembly: NanoByte.Common.dll
Syntax
public static class WindowsCredentials : Object
Methods
IsCredentialStored(String)
Determines whether there are any credentials stored for a specific target.
Declaration
public static bool IsCredentialStored(string target)
Parameters
Type | Name | Description |
---|---|---|
String | target | A string uniquely identifying the target the credentials are intended for. |
Returns
Type | Description |
---|---|
Boolean |
Exceptions
Type | Condition |
---|---|
PlatformNotSupportedException | The current platform does not support the Credentials API. Needs Windows XP or newer. |
PromptCli(String, WindowsCredentialsFlags)
Prompts the user for credentials using a command-line interface.
Declaration
public static NetworkCredential PromptCli(string target, WindowsCredentialsFlags flags)
Parameters
Type | Name | Description |
---|---|---|
String | target | A string uniquely identifying the target the credentials are intended for. |
WindowsCredentialsFlags | flags | Flags for configuring the prompt. |
Returns
Type | Description |
---|---|
NetworkCredential |
Exceptions
Type | Condition |
---|---|
PlatformNotSupportedException | The current platform does not support the Credentials API. Needs Windows XP or newer. |
PromptGui(String, WindowsCredentialsFlags, String, String, IntPtr)
Prompts the user for credentials using a GUI dialog.
Declaration
public static NetworkCredential PromptGui(string target, WindowsCredentialsFlags flags, string title = null, string message = null, IntPtr owner = 0)
Parameters
Type | Name | Description |
---|---|---|
String | target | A string uniquely identifying the target the credentials are intended for. |
WindowsCredentialsFlags | flags | Flags for configuring the prompt. |
String | title | The title of the dialog. |
String | message | The message to display in the dialog. |
IntPtr | owner | The parent window for the dialog; can be |
Returns
Type | Description |
---|---|
NetworkCredential |
Exceptions
Type | Condition |
---|---|
PlatformNotSupportedException | The current platform does not support the Credentials API. Needs Windows XP or newer. |