Class WindowsCredentials
Provides an interface to the Windows Credentials API. Supported on Windows XP or newer.
public static class WindowsCredentials
- Inheritance
-
WindowsCredentials
Methods
IsCredentialStored(string)
Determines whether there are any credentials stored for a specific target.
public static bool IsCredentialStored(string target)
Parameters
target
stringA string uniquely identifying the target the credentials are intended for.
Returns
Exceptions
- 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.
public static NetworkCredential PromptCli(string target, WindowsCredentialsFlags flags)
Parameters
target
stringA string uniquely identifying the target the credentials are intended for.
flags
WindowsCredentialsFlagsFlags for configuring the prompt.
Returns
Exceptions
- 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.
public static NetworkCredential PromptGui(string target, WindowsCredentialsFlags flags, string? title = null, string? message = null, IntPtr owner = default)
Parameters
target
stringA string uniquely identifying the target the credentials are intended for.
flags
WindowsCredentialsFlagsFlags for configuring the prompt.
title
stringThe title of the dialog.
message
stringThe message to display in the dialog.
owner
IntPtrThe parent window for the dialog; can be
null
.
Returns
Exceptions
- PlatformNotSupportedException
The current platform does not support the Credentials API. Needs Windows XP or newer.