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
ファイルを表示 Open project: drorgl/MSDNSWebAdmin

Public Methods

Method 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

Method Description
CreateWSAException ( ) : Win32Exception

Method Details

FixHostnames() public static method

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

GetProtoByName() public static method

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

GetServByName() public static method

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
return int

ParseIP() public static method

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

ToString() public static method

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

ToUint32() public static method

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