Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim b As Boolean = My.Computer.Network.Ping("192.168.1.1", 1000) '返回ping结果,true表示通,false表示不通,1000表示1000毫秒内返回结果
My.Computer.FileSystem.WriteAllText("c:\1.txt", b.ToString & vbCrLf, True) '写入到c盘的1.txt文件中并自动加换行回车符
End Sub