Table of Contents

Class WindowsCredentials

Namespace
NanoByte.Common.Native
Assembly
NanoByte.Common.dll

Provides an interface to the Windows Credentials API. Supported on Windows XP or newer.

public static class WindowsCredentials
Inheritance
object
WindowsCredentials

Methods

IsCredentialStored(string)

Determines whether there are any credentials stored for a specific target.

public static bool IsCredentialStored(string target)

Parameters

target string

A string uniquely identifying the target the credentials are intended for.

Returns

bool

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 string

A string uniquely identifying the target the credentials are intended for.

flags WindowsCredentialsFlags

Flags for configuring the prompt.

Returns

NetworkCredential

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 string

A string uniquely identifying the target the credentials are intended for.

flags WindowsCredentialsFlags

Flags for configuring the prompt.

title string

The title of the dialog.

message string

The message to display in the dialog.

owner IntPtr

The parent window for the dialog; can be null.

Returns

NetworkCredential

Exceptions

PlatformNotSupportedException

The current platform does not support the Credentials API. Needs Windows XP or newer.