📜  如何在 C# 表单中 ping - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:10.853000             🧑  作者: Mango

代码示例1
private void btnPing_Click(object sender, EventArgs e)
{
    Ping ping = new Ping();
    PingReply reply = ping.Send(txtIP.Text, 1000);
    MessageBox.Show(reply.Status.ToString(), "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
}