PingReply.Status プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > PingReply.Status プロパティの意味・解説 

PingReply.Status プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

ICMP (インターネット コントロール メッセージ プロトコル) エコー要求送信と、対応する ICMP エコー応答メッセージ受信の処理のステータス取得します

名前空間: System.Net.NetworkInformation
アセンブリ: System (system.dll 内)
構文構文

Dim instance As PingReply
Dim value As IPStatus

value = instance.Status
public IPStatus Status { get; }
public:
property IPStatus Status {
    IPStatus get ();
}
/** @property */
public IPStatus get_Status ()

プロパティ
要求結果を示す IPStatus 値。

解説解説
使用例使用例

Ping クラス使用してICMP エコー要求同期的送信し応答表示するコード例次に示します

using System;
using System.Net;
using System.Net.NetworkInformation;
using System.Text;

namespace Examples.System.Net.NetworkInformation.PingTest
{
    public class PingExample
    {
        // args[0] can be an IPaddress or host name.
        public static void
 Main (string[] args)
        {
            Ping pingSender = new Ping ();
            PingOptions options = new PingOptions ();

            // Use the default Ttl value which is 128,
            // but change the fragmentation behavior.
            options.DontFragment = true;

            // Create a buffer of 32 bytes of data to be transmitted.
            string data = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
            byte[] buffer = Encoding.ASCII.GetBytes (data);
            int timeout = 120;
            PingReply reply = pingSender.Send (args[0], timeout, buffer, options);
            if (reply.Status == IPStatus.Success)
            {
                Console.WriteLine ("Address: {0}", reply.Address.ToString
 ());
                Console.WriteLine ("RoundTrip time: {0}", reply.RoundtripTime);
                Console.WriteLine ("Time to live: {0}", reply.Options.Ttl);
                Console.WriteLine ("Don't fragment: {0}", reply.Options.DontFragment);
                Console.WriteLine ("Buffer size: {0}", reply.Buffer.Length);
            }
        }
    }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
PingReply クラス
PingReply メンバ
System.Net.NetworkInformation 名前空間



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「PingReply.Status プロパティ」の関連用語

PingReply.Status プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



PingReply.Status プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS