UtilNetworkPing Method
Pings the specified address or hostname to determine whether a remote computer is accessible over the network.
Namespace: DevCase.Core.Networking.CommonAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static bool Ping(
string address,
int timeOut = 1000,
byte[] bufferData = null,
bool fragmentData = false,
int timeToLive = 128
)
Public Shared Function Ping (
address As String,
Optional timeOut As Integer = 1000,
Optional bufferData As Byte() = Nothing,
Optional fragmentData As Boolean = false,
Optional timeToLive As Integer = 128
) As Boolean
Dim address As String
Dim timeOut As Integer
Dim bufferData As Byte()
Dim fragmentData As Boolean
Dim timeToLive As Integer
Dim returnValue As Boolean
returnValue = UtilNetwork.Ping(address,
timeOut, bufferData, fragmentData,
timeToLive)
public:
static bool Ping(
String^ address,
int timeOut = 1000,
array<unsigned char>^ bufferData = nullptr,
bool fragmentData = false,
int timeToLive = 128
)
static member Ping :
address : string *
?timeOut : int *
?bufferData : byte[] *
?fragmentData : bool *
?timeToLive : int
(* Defaults:
let _timeOut = defaultArg timeOut 1000
let _bufferData = defaultArg bufferData null
let _fragmentData = defaultArg fragmentData false
let _timeToLive = defaultArg timeToLive 128
*)
-> bool
No code example is currently available or this language may not be supported.
- address String
-
The computer that is the destination for the ICMP echo message.
The value specified for this parameter can be a hostname or an IP address.
- timeOut Int32 (Optional)
-
The maximum number of milliseconds (after sending the echo message) to wait for the ICMP echo reply message.
Default value is 200.
- bufferData Byte (Optional)
-
The data to be sent with the ICMP echo message and returned in the ICMP echo reply message.
The array cannot contain more than 65,500 bytes.
- fragmentData Boolean (Optional)
-
Controls the fragmentation of the data sent to the remote host.
If set to , the data is sent in multiple packets.
Default value is .
- timeToLive Int32 (Optional)
-
The number of routing nodes that can forward the Ping data before it is discarded.
Default value is 128.
Boolean if ping operation success,
otherwise.
This is a code example.
No code example is currently available or this language may not be supported.
Dim isAvailable As Boolean = Ping("www.google.com")
Dim isAvailable As Boolean =
Ping("www.google.com", timeOut:=1000, bufferData:=Encoding.ASCII.GetBytes("Hello"), fragmentData:=True)
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.