请问一下如何编写应用程序测试服务器连接是否正常。比如qq的代理服务器设置中有一个测试按钮,这个按钮的事件是如何编写的?请各位帮忙啊!

解决方案 »

  1.   

    up!java当中的socket应该可以的吧!
      

  2.   

    create a class with Main() function, write some code to read date from database in the function.
      

  3.   

    o,sorry.May be my question is not so clear!
      我是说,这个服务器是web服务器,比如某个网站的服务器等等......
    我可以用url.openConnection()返回一个流,从中读取到数据。但是,这些数据能说明服务器是正常的,网络连接正常吗?It is not a database server>>>
      

  4.   

    是否可以通过这个方法来测试啊?
    public URL(String protocol,
               String host,
               int port,
               String file)
        throws MalformedURLExceptionurl.openConnection()...