你测试的时候,尽量在你本来的程序那里测试,要在那里测试通过才行的。
或者定时检测是否运行,不运行就重启。测试代码
做一个新的项目,做个定时计划,定时检测
try
Dim req = System.Net.WebRequest.Create("http://127.0.0.1/test.htm")
req.timeout = 3000
Dim pos = req.GetResponse
Dim stm As System.IO.Stream = pos.GetResponseStream()
Dim reader As New System.IO.StreamReader(stm)
Dim str As String = reader.ReadToEnd
pos.Close
stm.Close
reader.close
'msgbox(str)
catch ex As exception
'msgbox("出错")
'msgbox(ex.message)
Dim ps As System.Diagnostics.Process() = System.Diagnostics.Process.GetProcessesByName("foxtable")
For Each p As System.Diagnostics.Process In ps
If p.MainWindowTitle.Contains("win8代码输入卡顿") Then
p.kill
Dim Proc As new Process
proc.File = "C:\Users\dv rrxaI600 007\Desktop\备份\win8代码输入卡顿的处理_开发版\win8代码输入卡顿的处理_开发版.foxdb"
proc.Start
End If
Next
End try
----------------服务器端假死测试代码
system.threading.thread.sleep(30000) '30秒