C# Class BF2Statistics.HostsFile

Afficher le fichier Open project: BF2Statistics/ControlCenter Class Usage Examples

Méthodes publiques

Свойство Type Description
OrigContents List

Protected Properties

Свойство Type Description
Entries IPAddress>.Dictionary
HostFile System.IO.FileInfo
Security System.Security.AccessControl.FileSecurity
WorldSid System.Security.Principal.SecurityIdentifier

Méthodes publiques

Méthode Description
Get ( string Domain ) : IPAddress

Returns the IP address for the provided domain name

GetLines ( ) : IPAddress>.Dictionary

Returns a list of all current hosts file lines

HasAnyEntry ( IEnumerable Domains ) : bool

Returns whether the hostsfile contains any of the domain names provided

HasEntry ( string Domain ) : bool

Returns whether the hostsfile contains the specified domain name

HostsFile ( ) : System
Remove ( string Domain ) : bool

Removes a domain name from the hosts file

RemoveAll ( IEnumerable Domains ) : bool

Removes all of the specified domain names from the hosts file

Save ( ) : void

Saves all currently set domains and IPs to the hosts file

Set ( string Domain, IPAddress Ip ) : void

Sets a domain name with an IP in the hosts file

Méthodes protégées

Méthode Description
ParseEntries ( ) : void

Method Details

Get() public méthode

Returns the IP address for the provided domain name
public Get ( string Domain ) : IPAddress
Domain string The domain name
Résultat System.Net.IPAddress

GetLines() public méthode

Returns a list of all current hosts file lines
public GetLines ( ) : IPAddress>.Dictionary
Résultat IPAddress>.Dictionary

HasAnyEntry() public méthode

Returns whether the hostsfile contains any of the domain names provided
public HasAnyEntry ( IEnumerable Domains ) : bool
Domains IEnumerable An array of domain names to check for
Résultat bool

HasEntry() public méthode

Returns whether the hostsfile contains the specified domain name
public HasEntry ( string Domain ) : bool
Domain string The domain name
Résultat bool

HostsFile() public méthode

public HostsFile ( ) : System
Résultat System

ParseEntries() protected méthode

protected ParseEntries ( ) : void
Résultat void

Remove() public méthode

Removes a domain name from the hosts file
public Remove ( string Domain ) : bool
Domain string The domain name
Résultat bool

RemoveAll() public méthode

Removes all of the specified domain names from the hosts file
public RemoveAll ( IEnumerable Domains ) : bool
Domains IEnumerable
Résultat bool

Save() public méthode

Saves all currently set domains and IPs to the hosts file
public Save ( ) : void
Résultat void

Set() public méthode

Sets a domain name with an IP in the hosts file
public Set ( string Domain, IPAddress Ip ) : void
Domain string The domain name
Ip System.Net.IPAddress The IP address
Résultat void

Property Details

Entries protected_oe property

A list of "hostname" => "IPAddress" in the hosts file.
protected Dictionary Entries
Résultat IPAddress>.Dictionary

HostFile protected_oe property

The fileinfo object for the HostsFile
protected FileInfo,System.IO HostFile
Résultat System.IO.FileInfo

OrigContents public_oe property

Each line of the hosts file stored in a list. ALl redirects are removed from this list before being stored here.
public List OrigContents
Résultat List

Security protected_oe property

Hosts file security object
protected FileSecurity,System.Security.AccessControl Security
Résultat System.Security.AccessControl.FileSecurity

WorldSid protected_oe static_oe property

The windows permission that represents everyone
protected static SecurityIdentifier,System.Security.Principal WorldSid
Résultat System.Security.Principal.SecurityIdentifier