@author HuHui
@功能:持续检测网络是否连通
/
package comhhnet;
import javaioBufferedReader;
import javaioBufferedWriter;
import javaioFile;
import javaioFileWriter;
import javaioIOException;
import javaioInputStream;
import javaioInputStreamReader;
import javatextSimpleDateFormat;
import javautilDate;
public class NetworkState implements Runnable {
public static void main(String[] args) {
// TODO Auto-generated method stub
NetworkState ns = new NetworkState();
new Thread(ns)start();//启动线程
}
// 判断网络状态
public void isConnect() {
Runtime runtime = RuntimegetRuntime();
try {
Process process = runtimeexec("ping " + ">
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)