Show / Hide Table of Contents

Class WindowsCredentials

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

Inheritance
Object
WindowsCredentials
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 = default(IntPtr))
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 null.

Returns
Type Description
NetworkCredential
Exceptions
Type Condition
PlatformNotSupportedException

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

In This Article
Back to top Copyright Bastian Eicher