java,php,asp.net,linux,javascript,mysql,mssql,oracle,编程

Ping java

转载请注明:http://www.pmjava.com/Article/ShowInfo.asp?ID=56606
import java.io.*;

public class Ping
{
   
public static void main(String args[])
    {
        String str
= "127.0.0.1";
        String line
= null;
       
try
        {
            Process pro
= Runtime.getRuntime().exec("ping " + str);
            BufferedReader buf
= new BufferedReader(new InputStreamReader(pro.getInputStream()));
           
while ((line = buf.readLine()) != null)
                System.out.println(line);
        }
       
catch (Exception ex)
        {
            System.out.println(ex.getMessage());
        }
    }

}
                    

posted on 2009-06-10 21:40 rrong_m 阅读(87) 评论(0)  编辑  收藏

<2024年5月>
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

导航

统计

常用链接

随笔档案

文章分类

文章档案

java编程

搜索

积分与排名

最新评论

阅读排行榜

评论排行榜