C# Class DNSManagement.Extensions.IPHelper

IP Parsing helper

Converts from uint32 to string and back

http://stackoverflow.com/questions/461742/how-to-convert-an-ipv4-address-into-a-integer-in-c
Afficher le fichier Open project: drorgl/MSDNSWebAdmin

Méthodes publiques

Méthode Description
FixHostnames ( string hostname ) : string

Fixes hostnames to have a dot in the end, most dns records has that standard.

GetProtoByName ( string name ) : int

Gets protocol number by name (tcp/udp/icmp etc')

GetServByName ( string name, string protocol ) : int

Gets service port number by name/protocol

http://stackoverflow.com/questions/3457977/convert-service-name-to-port

ParseIP ( string ipaddr ) : IPAddress

ParseIP or return IPAddress without exceptions

ToString ( UInt32 address ) : string

Converts bytes (uint) to ip dot notation

ToUint32 ( string address ) : UInt32

Parses a string and returns uint

Private Methods

Méthode Description
CreateWSAException ( ) : Win32Exception

Method Details

FixHostnames() public static méthode

Fixes hostnames to have a dot in the end, most dns records has that standard.
public static FixHostnames ( string hostname ) : string
hostname string
Résultat string

GetProtoByName() public static méthode

Gets protocol number by name (tcp/udp/icmp etc')
public static GetProtoByName ( string name ) : int
name string protocol name
Résultat int

GetServByName() public static méthode

Gets service port number by name/protocol
http://stackoverflow.com/questions/3457977/convert-service-name-to-port
public static GetServByName ( string name, string protocol ) : int
name string name of service
protocol string protocol the service is using
Résultat int

ParseIP() public static méthode

ParseIP or return IPAddress without exceptions
public static ParseIP ( string ipaddr ) : IPAddress
ipaddr string
Résultat System.Net.IPAddress

ToString() public static méthode

Converts bytes (uint) to ip dot notation
public static ToString ( UInt32 address ) : string
address System.UInt32
Résultat string

ToUint32() public static méthode

Parses a string and returns uint
public static ToUint32 ( string address ) : UInt32
address string ipv4 address
Résultat System.UInt32