Table of Contents

Class Netrc

Namespace
NanoByte.Common.Net
Assembly
NanoByte.Common.dll

Represents data loaded from a .netrc file as a map from host names to credentials.

public class Netrc : Dictionary<string, NetworkCredential>
Inheritance
Netrc
Extension Methods

Properties

DefaultPath

The default path for the .netrc file. Usually in the home directory. Can be overriden via NETRC environment variable.

public static string DefaultPath { get; }

Property Value

string

Methods

Load(string)

Loads credentials from a .netrc file.

public static Netrc Load(string path)

Parameters

path string

The path of the file to load.

Returns

Netrc

Exceptions

IOException

A problem occurred while loading the file.

UnauthorizedAccessException

Read access to the file was denied.

LoadSafe()

Loads credentials from DefaultPath. Catches any exceptions and returns empty Netrc instead.

public static Netrc LoadSafe()

Returns

Netrc