using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net.NetworkInformation;
namespace _CS__Ping_Test
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Ping PingSender = new Ping();
PingOptions options = new PingOptions();
options.DontFragment = true;
string data = "aaaaaaaaaaaaaaaaaaaaaaaaaa";
byte[] buffer = Encoding.ASCII.GetBytes(data);
int timeout = 120;
PingReply reply = PingSender.Send("127.0.0.1", timeout, buffer, options);
if (reply.Status == IPStatus.Success)
{
string sAddress = reply.Address.ToString();
string sRoundTripTime = reply.RoundtripTime.ToString();
string sTtl = reply.Options.Ttl.ToString();
string sDontFragment = reply.Options.DontFragment.ToString();
string sBufferLength = reply.Buffer.Length.ToString();
}
}
}
}
'020. Prigraming > 01. C#' 카테고리의 다른 글
[C#] dictionary (0) | 2011.04.01 |
---|---|
[C#] ASCII 변환 알아보자 (0) | 2011.02.16 |
[C#] String to Byte (0) | 2010.09.23 |
[C#] List 제네릭 클래스 (0) | 2010.09.08 |
[C#] 나에겐 여전히 부담되는... [Thread] (0) | 2010.09.08 |
WRITTEN BY
- 테네시왈츠
항상 겸손하게 항상 새롭게 항상 진실하게