Ping 클래스

정의

애플리케이션에서 네트워크를 통해 원격 컴퓨터에 액세스할 수 있는지 여부를 확인하는 데 사용하는 클래스입니다.

public ref class Ping : System::ComponentModel::Component
public ref class Ping : IDisposable
public ref class Ping : System::ComponentModel::Component, IDisposable
public class Ping : System.ComponentModel.Component
public class Ping : IDisposable
public class Ping : System.ComponentModel.Component, IDisposable
type Ping = class
    inherit Component
type Ping = class
    interface IDisposable
type Ping = class
    inherit Component
    interface IDisposable
Public Class Ping
Inherits Component
Public Class Ping
Implements IDisposable
Public Class Ping
Inherits Component
Implements IDisposable
상속
상속
Ping
구현

예제

다음 코드 예제에서는 클래스를 Ping 동기적으로 사용 하는 방법을 보여 줍니다.

#using <System.dll>

using namespace System;
using namespace System::Net;
using namespace System::Net::NetworkInformation;
using namespace System::Text;

// args[1] can be an IPaddress or host name.
int main()
{
   array<String^>^args = Environment::GetCommandLineArgs();
   
   Ping ^ pingSender = gcnew Ping;
   PingOptions ^ options = gcnew 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";
   array<Byte>^buffer = Encoding::ASCII->GetBytes( data );
   int timeout = 120;
   PingReply ^ reply = pingSender->Send( args[ 1 ], 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 );
   }

   
}
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);
            }
        }
    }
}
open System.Net.NetworkInformation
open System.Text

// args[0] can be an IPaddress or host name.
[<EntryPoint>]
let main args =
    let pingSender = new Ping()

    // Use the default Ttl value which is 128,
    // but change the fragmentation behavior.
    let options = PingOptions()
    options.DontFragment <- true

    // Create a buffer of 32 bytes of data to be transmitted.
    let data = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
    let buffer = Encoding.ASCII.GetBytes data
    let timeout = 120
    let reply: PingReply = pingSender.Send(args.[0], timeout, buffer, options)

    match reply.Status with
    | IPStatus.Success ->
        printfn "Address: %O" reply.Address
        printfn "RoundTrip time: %d" reply.RoundtripTime
        printfn "Time to live: %d" reply.Options.Ttl
        printfn "Don't fragment: %b" reply.Options.DontFragment
        printfn "Buffer size: %d" reply.Buffer.Length
        0
    | _ ->
        eprintfn "Error sending ping: %O" reply
        eprintfn "Error was: %O" reply.Status
        1

다음 코드 예제에서는 클래스를 Ping 비동기적으로 사용하는 방법을 보여 줍니다.

#using <System.dll>

using namespace System;
using namespace System::Text;
using namespace System::Net;
using namespace System::Net::NetworkInformation;
using namespace System::ComponentModel;
using namespace System::Threading;
void PingCompletedCallback( Object^ sender, PingCompletedEventArgs^ e );
void DisplayReply( PingReply^ reply );
int main()
{
   array<String^>^args = Environment::GetCommandLineArgs();
   if ( args->Length == 1 )
      throw gcnew ArgumentException( "Ping needs a host or IP Address." );

   String^ who = args[ 1 ];
   AutoResetEvent^ waiter = gcnew AutoResetEvent( false );
   
   Ping ^ pingSender = gcnew Ping;
   
   // When the PingCompleted event is raised,
   // the PingCompletedCallback method is called.
   pingSender->PingCompleted += gcnew PingCompletedEventHandler( PingCompletedCallback );
   
   // Create a buffer of 32 bytes of data to be transmitted.
   String^ data = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
   array<Byte>^buffer = Encoding::ASCII->GetBytes( data );
   
   // Wait 12 seconds for a reply.
   int timeout = 12000;
   
   // Set options for transmission:
   // The data can go through 64 gateways or routers
   // before it is destroyed, and the data packet
   // cannot be fragmented.
   PingOptions ^ options = gcnew PingOptions( 64,true );
   Console::WriteLine( "Time to live: {0}", options->Ttl );
   Console::WriteLine( "Don't fragment: {0}", options->DontFragment );
   
   // Send the ping asynchronously.
   // Use the waiter as the user token.
   // When the callback completes, it can wake up this thread.
   pingSender->SendAsync( who, timeout, buffer, options, waiter );
   
   // Prevent this example application from ending.
   // A real application should do something useful
   // when possible.
   waiter->WaitOne();
   Console::WriteLine( "Ping example completed." );
}


void PingCompletedCallback( Object^ /*sender*/, PingCompletedEventArgs^ e )
{
   
   // If the operation was canceled, display a message to the user.
   if ( e->Cancelled )
   {
      Console::WriteLine( "Ping canceled." );
      
      // Let the main thread resume. 
      // UserToken is the AutoResetEvent object that the main thread 
      // is waiting for.
      (dynamic_cast<AutoResetEvent^>(e->UserState))->Set();
   }

   
   // If an error occurred, display the exception to the user.
   if ( e->Error != nullptr )
   {
      Console::WriteLine( "Ping failed:" );
      Console::WriteLine( e->Error->ToString() );
      
      // Let the main thread resume. 
      (dynamic_cast<AutoResetEvent^>(e->UserState))->Set();
   }

   PingReply ^ reply = e->Reply;
   DisplayReply( reply );
   
   // Let the main thread resume.
   (dynamic_cast<AutoResetEvent^>(e->UserState))->Set();
}


void DisplayReply( PingReply ^ reply )
{
   if ( reply == nullptr )
      return;

   Console::WriteLine( "ping status: {0}", reply->Status );
   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 );
   }
}
using System;
using System.Text;
using System.Net;
using System.Net.NetworkInformation;
using System.ComponentModel;
using System.Threading;

namespace Examples.System.Net.NetworkInformation.PingTest
{
    public class PingExample
    {
        public static void Main (string[] args)
        {
            if (args.Length == 0)
                throw new ArgumentException ("Ping needs a host or IP Address.");

            string who = args[0];
            AutoResetEvent waiter = new AutoResetEvent (false);

            Ping pingSender = new Ping ();

            // When the PingCompleted event is raised,
            // the PingCompletedCallback method is called.
            pingSender.PingCompleted += new PingCompletedEventHandler (PingCompletedCallback);

            // Create a buffer of 32 bytes of data to be transmitted.
            string data = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
            byte[] buffer = Encoding.ASCII.GetBytes (data);

            // Wait 12 seconds for a reply.
            int timeout = 12000;

            // Set options for transmission:
            // The data can go through 64 gateways or routers
            // before it is destroyed, and the data packet
            // cannot be fragmented.
            PingOptions options = new PingOptions (64, true);

            Console.WriteLine ("Time to live: {0}", options.Ttl);
            Console.WriteLine ("Don't fragment: {0}", options.DontFragment);

            // Send the ping asynchronously.
            // Use the waiter as the user token.
            // When the callback completes, it can wake up this thread.
            pingSender.SendAsync(who, timeout, buffer, options, waiter);

            // Prevent this example application from ending.
            // A real application should do something useful
            // when possible.
            waiter.WaitOne ();
            Console.WriteLine ("Ping example completed.");
        }

        private static void PingCompletedCallback (object sender, PingCompletedEventArgs e)
        {
            // If the operation was canceled, display a message to the user.
            if (e.Cancelled)
            {
                Console.WriteLine ("Ping canceled.");

                // Let the main thread resume.
                // UserToken is the AutoResetEvent object that the main thread
                // is waiting for.
                ((AutoResetEvent)e.UserState).Set ();
            }

            // If an error occurred, display the exception to the user.
            if (e.Error != null)
            {
                Console.WriteLine ("Ping failed:");
                Console.WriteLine (e.Error.ToString ());

                // Let the main thread resume.
                ((AutoResetEvent)e.UserState).Set();
            }

            PingReply reply = e.Reply;

            DisplayReply (reply);

            // Let the main thread resume.
            ((AutoResetEvent)e.UserState).Set();
        }

        public static void DisplayReply (PingReply reply)
        {
            if (reply == null)
                return;

            Console.WriteLine ("ping status: {0}", reply.Status);
            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);
            }
        }
    }
}

설명

애플리케이션 사용을 Ping 원격 컴퓨터에 연결할 수 있는지 여부를 검색 하는 클래스입니다.

네트워크 토폴로지는 원격 호스트에 성공적으로 연결할 수 있는지 여부를 Ping 결정할 수 있습니다. 프록시, NAT(네트워크 주소 변환) 장비 또는 방화벽의 존재 및 구성으로 인해 성공하지 못할 Ping 수 있습니다. 성공 Ping 하면 원격 호스트가 네트워크에서 연결할 수 있음을 나타냅니다. 원격 호스트에 상위 수준 서비스(예: 웹 서버)가 있는 것은 보장되지 않습니다.

이 클래스는 Ping.exe 명령줄 도구와 유사한 기능을 제공합니다. 및 SendAsync 메서드는 Send 원격 컴퓨터에 ICMP(Internet Control Message Protocol) 에코 요청 메시지를 보내고 해당 컴퓨터에서 ICMP 에코 응답 메시지를 기다립니다. ICMP 메시지에 대한 자세한 설명은 에서 https://www.ietf.org제공되는 RFC 792를 참조하세요.

다음 형식은 클래스와 함께 Ping 사용되며 아래에 자세히 설명되어 있습니다.

형식 이름 설명
IPStatus ICMP 에코 요청 메시지의 결과를 설명하는 상태 코드를 정의합니다.
PingOptions 요청 패킷을 전달할 수 있는 횟수()Ttl 및 조각화할 수 있는지 여부를 제어하는 설정을 구성하거나 검색할 수 있습니다(DontFragment ).
PingReply ICMP 에코 요청의 결과를 포함합니다.
PingException 복구할 수 없는 오류가 발생하면 throw됩니다.
PingCompletedEventArgs 호출이 완료되거나 취소될 때 SendAsync 발생하는 이벤트와 PingCompleted 연결된 데이터를 포함합니다.
PingCompletedEventHandler 호출이 완료되거나 취소될 때 호출되는 콜백 메서드를 SendAsync 제공하는 대리자입니다.

및 메서드는 Send 개체의 회신을 PingReply 반환 SendAsync 합니다. 속성은 PingReply.Status 요청의 결과를 나타내는 값을 반환 IPStatus 합니다.

요청을 보낼 때 원격 컴퓨터를 지정해야 합니다. 호스트 이름 문자열, 문자열 형식의 IP 주소 또는 IPAddress 개체를 제공하여 이 작업을 수행할 수 있습니다.

다음 유형의 정보를 지정할 수도 있습니다.

  • 요청과 함께 사용할 데이터입니다. buffer 를 지정하면 특정 크기의 패킷이 원격 호스트를 왕복하는 데 필요한 시간과 네트워크 경로의 최대 전송 단위를 학습할 수 있습니다. (매개 변수를 Send 사용하는 또는 SendAsync 오버로드를 buffer 참조하세요.)

  • 전송 중에 ICMP Echo 패킷을 조각화할 수 있는지 여부입니다. (매개 변수를 DontFragmentSend 사용하는 속성 및 또는 SendAsync 오버로드를 options 참조하세요.)

  • 라우팅 노드(예: 라우터 또는 게이트웨이)가 대상 컴퓨터에 도달하거나 삭제되기 전에 패킷을 전달할 수 있는 횟수입니다. 매개 변수를 Send 사용하는 및 또는 SendAsync 오버로드를 options 참조하세요Ttl.

  • 회신을 수신해야 하는 시간 제한입니다. (매개 변수를 Send 사용하는 또는 SendAsync 오버로드를 timeout 참조하세요.

클래스는 Ping 요청을 보내기 위한 동기 및 비동기 메서드를 모두 제공합니다. 사용 하 여 애플리케이션 회신을 기다리는 동안 차단 해야 하는 경우는 Send 메서드, 이러한 메서드는 동기적입니다. 애플리케이션을 차단 하지 않아야 하는 경우 사용 하 여 비동기 SendAsync 메서드. 에 대한 SendAsync 호출은 스레드 풀에서 자동으로 할당되는 자체 스레드에서 실행됩니다. 비동기 작업이 완료되면 이벤트가 발생합니다 PingCompleted . 애플리케이션 사용을 PingCompletedEventHandler 에 대 한 호출 되는 방법을 지정 하는 대리자 PingCompleted 이벤트입니다. 를 호출SendAsync하기 전에 이벤트에 대리자를 추가 PingCompletedEventHandler 해야 합니다. 대리자의 메서드는 호출 결과를 설명하는 개체가 PingReply 포함된 개체를 받 PingCompletedEventArgs 습니다SendAsync.

클래스의 Ping 동일한 instance 사용하여 여러 동시 ICMP Echo 요청을 생성할 수 없습니다. Send 호출이 진행 중인 동안 SendAsync 호출하거나 이전의 모든 호출이 완료되기 전에 여러 번 호출 SendAsync 하면 가 발생합니다InvalidOperationException.

생성자

Ping()

Ping 클래스의 새 인스턴스를 초기화합니다.

속성

CanRaiseEvents

구성 요소가 이벤트를 발생시킬 수 있는지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 Component)
Container

IContainer을 포함하는 Component를 가져옵니다.

(다음에서 상속됨 Component)
DesignMode

Component가 현재 디자인 모드인지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 Component)
Events

Component에 연결된 이벤트 처리기의 목록을 가져옵니다.

(다음에서 상속됨 Component)
Site

ComponentISite를 가져오거나 설정합니다.

(다음에서 상속됨 Component)

메서드

CreateObjRef(Type)

원격 개체와 통신하는 데 사용되는 프록시 생성에 필요한 모든 관련 정보가 들어 있는 개체를 만듭니다.

(다음에서 상속됨 MarshalByRefObject)
Dispose()

관리되지 않는 리소스를 해제하고, Ping에서 사용하는 관리되는 리소스를 삭제합니다.

Dispose()

Component에서 사용하는 모든 리소스를 해제합니다.

(다음에서 상속됨 Component)
Dispose(Boolean)

Ping 개체에서 사용하는 관리되지 않는 리소스를 해제하고, 필요에 따라 관리되는 리소스를 삭제합니다.

Dispose(Boolean)

Component에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 해제할 수 있습니다.

(다음에서 상속됨 Component)
Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetLifetimeService()
사용되지 않음.

이 인스턴스의 수명 정책을 제어하는 현재의 수명 서비스 개체를 검색합니다.

(다음에서 상속됨 MarshalByRefObject)
GetService(Type)

Component 또는 해당 Container에서 제공하는 서비스를 나타내는 개체를 반환합니다.

(다음에서 상속됨 Component)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
InitializeLifetimeService()
사용되지 않음.

이 인스턴스의 수명 정책을 제어하는 수명 서비스 개체를 가져옵니다.

(다음에서 상속됨 MarshalByRefObject)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
MemberwiseClone(Boolean)

현재 MarshalByRefObject 개체의 단순 복사본을 만듭니다.

(다음에서 상속됨 MarshalByRefObject)
OnPingCompleted(PingCompletedEventArgs)

PingCompleted 이벤트를 발생시킵니다.

Send(IPAddress)

지정된 IPAddress를 사용하는 컴퓨터에 ICMP(Internet Control Message Protocol) Echo 메시지를 보내고 해당 컴퓨터로부터 이에 대응하는 ICMP Echo Reply 메시지를 받으려고 시도합니다.

Send(IPAddress, Int32)

지정된 IPAddress를 사용하는 컴퓨터에 ICMP(Internet Control Message Protocol) Echo 메시지와 지정된 데이터 버퍼를 보내고 해당 컴퓨터로부터 이에 대응하는 ICMP Echo Reply 메시지를 받으려고 시도합니다. 이 메서드를 통해 작업의 시간 제한 값을 지정할 수 있습니다.

Send(IPAddress, Int32, Byte[])

지정된 IPAddress를 사용하는 컴퓨터에 ICMP(Internet Control Message Protocol) Echo 메시지와 지정된 데이터 버퍼를 보내고 해당 컴퓨터로부터 이에 대응하는 ICMP Echo Reply 메시지를 받으려고 시도합니다. 이 오버로드를 통해 작업의 시간 제한 값을 지정할 수 있습니다.

Send(IPAddress, Int32, Byte[], PingOptions)

지정된 IPAddress를 사용하는 컴퓨터에 ICMP(Internet Control Message Protocol) Echo 메시지와 지정된 데이터 버퍼를 보내고 해당 컴퓨터로부터 이에 대응하는 ICMP Echo Reply 메시지를 받으려고 시도합니다. 이 오버로드를 사용하여 작업의 제한 시간 값을 지정하고 ICMP Echo 메시지 패킷의 조각화 및 Time-to-Live 값을 제어할 수 있습니다.

Send(IPAddress, TimeSpan, Byte[], PingOptions)

지정된 IPAddress가 있는 컴퓨터에 ICMP(Internet Control Message Protocol) 에코 메시지를 보내고 해당 컴퓨터에서 해당 ICMP 에코 응답 메시지를 수신하려고 시도합니다.

Send(String)

지정된 컴퓨터에 ICMP(Internet Control Message Protocol) Echo 메시지를 보내고 해당 컴퓨터로부터 이에 대응하는 ICMP Echo Reply 메시지를 받으려고 시도합니다.

Send(String, Int32)

지정된 컴퓨터에 ICMP(Internet Control Message Protocol) Echo 메시지를 보내고 해당 컴퓨터로부터 이에 대응하는 ICMP Echo Reply 메시지를 받으려고 시도합니다. 이 메서드를 통해 작업의 시간 제한 값을 지정할 수 있습니다.

Send(String, Int32, Byte[])

지정된 컴퓨터에 ICMP(Internet Control Message Protocol) Echo 메시지와 지정된 데이터 버퍼를 보내고 해당 컴퓨터로부터 이에 대응하는 ICMP Echo Reply 메시지를 받으려고 시도합니다. 이 오버로드를 통해 작업의 시간 제한 값을 지정할 수 있습니다.

Send(String, Int32, Byte[], PingOptions)

지정된 컴퓨터에 ICMP(Internet Control Message Protocol) Echo 메시지와 지정된 데이터 버퍼를 보내고 해당 컴퓨터로부터 이에 대응하는 ICMP Echo Reply 메시지를 받으려고 시도합니다. 이 오버로드를 사용하여 작업의 제한 시간 값을 지정하고 ICMP 패킷의 조각화 및 Time-to-Live 값을 제어할 수 있습니다.

Send(String, TimeSpan, Byte[], PingOptions)

지정된 컴퓨터에 ICMP(Internet Control Message Protocol) 에코 메시지를 보내고 해당 컴퓨터에서 해당 ICMP 에코 응답 메시지를 수신하려고 시도합니다.

SendAsync(IPAddress, Int32, Byte[], Object)

지정된 IPAddress를 사용하는 컴퓨터에 ICMP(Internet Control Message Protocol) Echo 메시지와 지정된 데이터 버퍼를 보내고 해당 컴퓨터로부터 이에 대응하는 ICMP Echo Reply 메시지를 받는 작업을 비동기적으로 시도합니다. 이 오버로드를 통해 작업의 시간 제한 값을 지정할 수 있습니다.

SendAsync(IPAddress, Int32, Byte[], PingOptions, Object)

지정된 IPAddress를 사용하는 컴퓨터에 ICMP(Internet Control Message Protocol) Echo 메시지와 지정된 데이터 버퍼를 보내고 해당 컴퓨터로부터 이에 대응하는 ICMP Echo Reply 메시지를 받는 작업을 비동기적으로 시도합니다. 이 오버로드를 사용하여 작업의 제한 시간 값을 지정하고 ICMP Echo 메시지 패킷의 조각화 및 Time-to-Live 값을 제어할 수 있습니다.

SendAsync(IPAddress, Int32, Object)

지정된 IPAddress를 사용하는 컴퓨터에 ICMP(Internet Control Message Protocol) Echo 메시지를 보내고 해당 컴퓨터로부터 이에 대응하는 ICMP Echo Reply 메시지를 받는 작업을 비동기적으로 시도합니다. 이 오버로드를 통해 작업의 시간 제한 값을 지정할 수 있습니다.

SendAsync(IPAddress, Object)

지정된 IPAddress를 사용하는 컴퓨터에 ICMP(Internet Control Message Protocol) Echo 메시지를 보내고 해당 컴퓨터로부터 이에 대응하는 ICMP Echo Reply 메시지를 받는 작업을 비동기적으로 시도합니다.

SendAsync(String, Int32, Byte[], Object)

지정된 컴퓨터에 ICMP(Internet Control Message Protocol) Echo 메시지와 지정된 데이터 버퍼를 보내고 해당 컴퓨터로부터 이에 대응하는 ICMP Echo Reply 메시지를 받는 작업을 비동기적으로 시도합니다. 이 오버로드를 통해 작업의 시간 제한 값을 지정할 수 있습니다.

SendAsync(String, Int32, Byte[], PingOptions, Object)

지정된 컴퓨터에 ICMP(Internet Control Message Protocol) Echo 메시지와 지정된 데이터 버퍼를 보내고 해당 컴퓨터로부터 이에 대응하는 ICMP Echo Reply 메시지를 받는 작업을 비동기적으로 시도합니다. 이 오버로드를 사용하여 작업의 제한 시간 값을 지정하고 ICMP 패킷의 조각화 및 Time-to-Live 값을 제어할 수 있습니다.

SendAsync(String, Int32, Object)

지정된 컴퓨터에 ICMP(Internet Control Message Protocol) Echo 메시지를 보내고 해당 컴퓨터로부터 이에 대응하는 ICMP Echo Reply 메시지를 받는 작업을 비동기적으로 시도합니다. 이 오버로드를 통해 작업의 시간 제한 값을 지정할 수 있습니다.

SendAsync(String, Object)

지정된 컴퓨터에 ICMP(Internet Control Message Protocol) Echo 메시지를 보내고 해당 컴퓨터로부터 이에 대응하는 ICMP Echo Reply 메시지를 받는 작업을 비동기적으로 시도합니다.

SendAsyncCancel()

ICMP(Internet Control Message Protocol) Echo 메시지를 보내고 이에 대응하는 ICMP Echo Reply 메시지를 받기 위한, 보류 중인 모든 비동기 요청을 취소합니다.

SendPingAsync(IPAddress)

지정된 IPAddress를 사용하는 컴퓨터에 ICMP(Internet Control Message Protocol) Echo 메시지와 지정된 데이터 버퍼를 보내고 해당 컴퓨터로부터 이에 대응하는 ICMP Echo Reply 메시지를 받는 작업을 비동기 작업으로 보냅니다.

SendPingAsync(IPAddress, Int32)

지정된 IPAddress를 사용하는 컴퓨터에 ICMP(Internet Control Message Protocol) Echo 메시지와 지정된 데이터 버퍼를 보내고 해당 컴퓨터로부터 이에 대응하는 ICMP Echo Reply 메시지를 받는 작업을 비동기 작업으로 보냅니다. 이 오버로드를 통해 작업의 시간 제한 값을 지정할 수 있습니다.

SendPingAsync(IPAddress, Int32, Byte[])

지정된 IPAddress를 사용하는 컴퓨터에 ICMP(Internet Control Message Protocol) Echo 메시지와 지정된 데이터 버퍼를 보내고 해당 컴퓨터로부터 이에 대응하는 ICMP Echo Reply 메시지를 받는 작업을 비동기 작업으로 보냅니다. 이 오버로드를 사용하면 작업의 시간 초과 값과 송수신하는 데 사용할 수 있는 버퍼를 지정할 수 있습니다.

SendPingAsync(IPAddress, Int32, Byte[], PingOptions)

지정된 IPAddress를 사용하는 컴퓨터에 지정된 데이터 버퍼의 ICMP(Internet Control Message Protocol) Echo 메시지를 보내고, 해당 컴퓨터로부터 이에 해당하는 ICMP Echo Reply 메시지를 비동기 작업으로 받습니다. 이 오버로드를 사용하여 작업의 제한 시간 값을 지정하고 보내고 받는 데 사용할 버퍼를 지정하며 ICMP Echo 메시지 패킷의 조각화 및 Time-to-Live 값을 제어할 수 있습니다.

SendPingAsync(IPAddress, TimeSpan, Byte[], PingOptions, CancellationToken)

지정된 IPAddress를 사용하는 컴퓨터에 지정된 데이터 버퍼의 ICMP(Internet Control Message Protocol) Echo 메시지를 보내고, 해당 컴퓨터로부터 이에 해당하는 ICMP Echo Reply 메시지를 비동기 작업으로 받습니다. 이 오버로드를 사용하면 작업에 대한 제한 시간 값, 송신 및 수신에 사용할 버퍼, 조각화 및 TL(Time-to-Live) 값, ICMP 에코 메시지 패킷에 대한 을 CancellationToken 지정할 수 있습니다.

SendPingAsync(String)

지정된 컴퓨터에 ICMP(Internet Control Message Protocol) Echo 메시지와 지정된 데이터 버퍼를 보내고 해당 컴퓨터로부터 이에 대응하는 ICMP Echo Reply 메시지를 받는 작업을 비동기 작업으로 보냅니다.

SendPingAsync(String, Int32)

지정된 컴퓨터에 ICMP(Internet Control Message Protocol) Echo 메시지와 지정된 데이터 버퍼를 보내고 해당 컴퓨터로부터 이에 대응하는 ICMP Echo Reply 메시지를 받는 작업을 비동기 작업으로 보냅니다. 이 오버로드를 통해 작업의 시간 제한 값을 지정할 수 있습니다.

SendPingAsync(String, Int32, Byte[])

지정된 컴퓨터에 ICMP(Internet Control Message Protocol) Echo 메시지와 지정된 데이터 버퍼를 보내고 해당 컴퓨터로부터 이에 대응하는 ICMP Echo Reply 메시지를 받는 작업을 비동기 작업으로 보냅니다. 이 오버로드를 사용하면 작업의 시간 초과 값과 송수신하는 데 사용할 수 있는 버퍼를 지정할 수 있습니다.

SendPingAsync(String, Int32, Byte[], PingOptions)

지정된 컴퓨터에 ICMP(Internet Control Message Protocol) Echo 메시지와 지정된 데이터 버퍼를 보내고 해당 컴퓨터로부터 이에 대응하는 ICMP Echo Reply 메시지를 받는 작업을 비동기 작업으로 보냅니다. 이 오버로드를 사용하여 작업의 제한 시간 값을 지정하고 보내고 받는 데 사용할 버퍼를 지정하며 ICMP Echo 메시지 패킷의 조각화 및 Time-to-Live 값을 제어할 수 있습니다.

SendPingAsync(String, TimeSpan, Byte[], PingOptions, CancellationToken)

지정된 데이터 버퍼가 있는 ICMP(Internet Control Message Protocol) 에코 메시지를 지정된 컴퓨터에 보내고 해당 컴퓨터에서 해당 ICMP 에코 회신 메시지를 비동기 작업으로 받습니다. 이 오버로드를 사용하면 작업에 대한 제한 시간 값, 송신 및 수신에 사용할 버퍼, 조각화 및 TL(Time-to-Live) 값, ICMP 에코 메시지 패킷에 대한 을 CancellationToken 지정할 수 있습니다.

ToString()

Component의 이름이 포함된 String을 반환합니다(있는 경우). 이 메서드는 재정의할 수 없습니다.

(다음에서 상속됨 Component)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

이벤트

Disposed

Dispose() 메서드를 호출하여 구성 요소를 삭제할 때 발생합니다.

(다음에서 상속됨 Component)
PingCompleted

ICMP(Internet Control Message Protocol) Echo 메시지를 보내고 이에 대응하는 ICMP Echo Reply 메시지를 받기 위한 비동기 작업이 완료되거나 취소될 때 발생합니다.

명시적 인터페이스 구현

IDisposable.Dispose()

Ping 클래스의 인스턴스에서 사용하는 모든 리소스를 해제합니다.

적용 대상

추가 정보