www.pudn.com > TestToolsProject.rar > TelnetProcessConnectStateMonitor.java, change:2014-06-11,size:992b


package com.mervyn.testsource; 
 
import javax.swing.JOptionPane; 
 
public class TelnetProcessConnectStateMonitor extends Thread{ 
	boolean ProcessState=false; 
	SimpleThreadSource GetThreadState=new  SimpleThreadSource(); 
	 
	public TelnetProcessConnectStateMonitor() 
	{ 
		System.out.println("程序运行状态:"+ProcessState);	  
	} 
	public void run() 
	{ 
		try { 
			TelnetProcessConnectStateMonitor.sleep(2500); 
		} catch (InterruptedException e) { 
			// TODO 自动生成 catch 块 
			e.printStackTrace(); 
		} 
		ProcessState=SimpleThreadSource.ThreadState;//return the thread running state. 
		if(ProcessState==false) 
		{ 
			JOptionPane.showMessageDialog(null, "程序版本错误或Telnet端口已经关闭,Telent连接目标失败!", 
								"错误信息", JOptionPane.ERROR_MESSAGE); 
		} 
		else 
		{ 
			//System.out.println("修改前的状态:"+GetThreadState.ThreadState); 
			SimpleThreadSource.ThreadState=false; 
			//System.out.println("修改后的状态:"+GetThreadState.ThreadState); 
		} 
	} 
}