C# Класс BF2Statistics.HostsFile

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
OrigContents List

Защищенные свойства (Protected)

Свойство Тип Описание
Entries IPAddress>.Dictionary
HostFile System.IO.FileInfo
Security System.Security.AccessControl.FileSecurity
WorldSid System.Security.Principal.SecurityIdentifier

Открытые методы

Метод Описание
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

Защищенные методы

Метод Описание
ParseEntries ( ) : void

Описание методов

Get() публичный Метод

Returns the IP address for the provided domain name
public Get ( string Domain ) : IPAddress
Domain string The domain name
Результат System.Net.IPAddress

GetLines() публичный Метод

Returns a list of all current hosts file lines
public GetLines ( ) : IPAddress>.Dictionary
Результат IPAddress>.Dictionary

HasAnyEntry() публичный Метод

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
Результат bool

HasEntry() публичный Метод

Returns whether the hostsfile contains the specified domain name
public HasEntry ( string Domain ) : bool
Domain string The domain name
Результат bool

HostsFile() публичный Метод

public HostsFile ( ) : System
Результат System

ParseEntries() защищенный Метод

protected ParseEntries ( ) : void
Результат void

Remove() публичный Метод

Removes a domain name from the hosts file
public Remove ( string Domain ) : bool
Domain string The domain name
Результат bool

RemoveAll() публичный Метод

Removes all of the specified domain names from the hosts file
public RemoveAll ( IEnumerable Domains ) : bool
Domains IEnumerable
Результат bool

Save() публичный Метод

Saves all currently set domains and IPs to the hosts file
public Save ( ) : void
Результат void

Set() публичный Метод

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
Результат void

Описание свойств

Entries защищенное свойство

A list of "hostname" => "IPAddress" in the hosts file.
protected Dictionary Entries
Результат IPAddress>.Dictionary

HostFile защищенное свойство

The fileinfo object for the HostsFile
protected FileInfo,System.IO HostFile
Результат System.IO.FileInfo

OrigContents публичное свойство

Each line of the hosts file stored in a list. ALl redirects are removed from this list before being stored here.
public List OrigContents
Результат List

Security защищенное свойство

Hosts file security object
protected FileSecurity,System.Security.AccessControl Security
Результат System.Security.AccessControl.FileSecurity

WorldSid защищенное статическое свойство

The windows permission that represents everyone
protected static SecurityIdentifier,System.Security.Principal WorldSid
Результат System.Security.Principal.SecurityIdentifier