Class Netrc
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
Methods
Load(string)
Loads credentials from a .netrc file.
public static Netrc Load(string path)
Parameters
path
stringThe path of the file to load.
Returns
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()