C# Класс SharpCifs.UniAddress

Under normal conditions it is not necessary to use this class to use jCIFS properly.

Under normal conditions it is not necessary to use this class to use jCIFS properly. Name resolusion is handled internally to the jcifs.smb package.

This class is a wrapper for both Jcifs.Netbios.NbtAddress and System.Net.IPAddress . The name resolution mechanisms used will systematically query all available configured resolution services including WINS, broadcasts, DNS, and LMHOSTS. See Setting Name Resolution Properties and the jcifs.resolveOrder property. Changing jCIFS name resolution properties can greatly affect the behavior of the client and may be necessary for proper operation.

This class should be used in favor of InetAddress to resolve hostnames on LANs and WANs that support a mixture of NetBIOS/WINS and DNS resolvable hosts.

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

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

Метод Описание
Equals ( object obj ) : bool

Compare two addresses for equality.

Compare two addresses for equality. Two UniAddresss are equal if they are both UniAddress' and refer to the same IP address.

FirstCalledName ( ) : string

Guess first called name to try for session establishment.

Guess first called name to try for session establishment. This method is used exclusively by the jcifs.smb package.

GetAddress ( ) : object

Return the underlying NbtAddress or InetAddress.

Return the underlying NbtAddress or InetAddress.

GetAllByName ( string hostname, bool possibleNtDomainOrWorkgroup ) : SharpCifs.UniAddress[]
GetByName ( string hostname ) : UniAddress

Determines the address of a host given it's host name.

Determines the address of a host given it's host name. The name can be a machine name like "jcifs.samba.org", or an IP address like "192.168.1.15".

GetByName ( string hostname, bool possibleNtDomainOrWorkgroup ) : UniAddress

Lookup hostname and return it's UniAddress.

Lookup hostname and return it's UniAddress. If the possibleNTDomainOrWorkgroup parameter is true an addtional name query will be performed to locate a master browser.

GetHashCode ( ) : int

Return the IP address of this address as a 32 bit integer.

Return the IP address of this address as a 32 bit integer.

GetHostAddress ( ) : string

Return the IP address as text such as "192.168.1.15".

Return the IP address as text such as "192.168.1.15".

GetHostIpAddress ( ) : IPAddress
GetHostName ( ) : string

Return the hostname of this address such as "MYCOMPUTER".

Return the hostname of this address such as "MYCOMPUTER".

NextCalledName ( ) : string

Guess next called name to try for session establishment.

Guess next called name to try for session establishment. This method is used exclusively by the jcifs.smb package.

ToString ( ) : string

Return the a text representation of this address such as MYCOMPUTER/192.168.1.15.

Return the a text representation of this address such as MYCOMPUTER/192.168.1.15.

UniAddress ( object addr ) : System

Create a UniAddress by wrapping an InetAddress or NbtAddress.

Create a UniAddress by wrapping an InetAddress or NbtAddress.

Приватные методы

Метод Описание
IsAllDigits ( string hostname ) : bool
IsDotQuadIp ( string hostname ) : bool
LookupServerOrWorkgroup ( string name, IPAddress svr ) : SharpCifs.Netbios.NbtAddress[]
UniAddress ( ) : System

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

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

Compare two addresses for equality.
Compare two addresses for equality. Two UniAddresss are equal if they are both UniAddress' and refer to the same IP address.
public Equals ( object obj ) : bool
obj object
Результат bool

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

Guess first called name to try for session establishment.
Guess first called name to try for session establishment. This method is used exclusively by the jcifs.smb package.
public FirstCalledName ( ) : string
Результат string

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

Return the underlying NbtAddress or InetAddress.
Return the underlying NbtAddress or InetAddress.
public GetAddress ( ) : object
Результат object

GetAllByName() публичный статический Метод

public static GetAllByName ( string hostname, bool possibleNtDomainOrWorkgroup ) : SharpCifs.UniAddress[]
hostname string
possibleNtDomainOrWorkgroup bool
Результат SharpCifs.UniAddress[]

GetByName() публичный статический Метод

Determines the address of a host given it's host name.
Determines the address of a host given it's host name. The name can be a machine name like "jcifs.samba.org", or an IP address like "192.168.1.15".
if there is an error resolving the name ///
public static GetByName ( string hostname ) : UniAddress
hostname string NetBIOS or DNS hostname to resolve
Результат UniAddress

GetByName() публичный статический Метод

Lookup hostname and return it's UniAddress.
Lookup hostname and return it's UniAddress. If the possibleNTDomainOrWorkgroup parameter is true an addtional name query will be performed to locate a master browser.
public static GetByName ( string hostname, bool possibleNtDomainOrWorkgroup ) : UniAddress
hostname string
possibleNtDomainOrWorkgroup bool
Результат UniAddress

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

Return the IP address of this address as a 32 bit integer.
Return the IP address of this address as a 32 bit integer.
public GetHashCode ( ) : int
Результат int

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

Return the IP address as text such as "192.168.1.15".
Return the IP address as text such as "192.168.1.15".
public GetHostAddress ( ) : string
Результат string

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

public GetHostIpAddress ( ) : IPAddress
Результат System.Net.IPAddress

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

Return the hostname of this address such as "MYCOMPUTER".
Return the hostname of this address such as "MYCOMPUTER".
public GetHostName ( ) : string
Результат string

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

Guess next called name to try for session establishment.
Guess next called name to try for session establishment. This method is used exclusively by the jcifs.smb package.
public NextCalledName ( ) : string
Результат string

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

Return the a text representation of this address such as MYCOMPUTER/192.168.1.15.
Return the a text representation of this address such as MYCOMPUTER/192.168.1.15.
public ToString ( ) : string
Результат string

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

Create a UniAddress by wrapping an InetAddress or NbtAddress.
Create a UniAddress by wrapping an InetAddress or NbtAddress.
public UniAddress ( object addr ) : System
addr object
Результат System