form1的activate
thisform.text1.value="正在检测网络,请等待..."
owsh=createobject("wscript.shell")
owsh.run (" /c ping -n 1 -r 9 192.168.1.65>D:\jyfw\ip.txt",0,.t.)
IF FILE('D:\jyfw\ip.txt')
IF AT('来自 192.168.1.65 的回复',FILETOSTR('D:\jyfw\ip.txt'))>10
DELETE FILE D:\jyfw\ip.txt
thisform.text1.value="正在检测服务器联通性,请等待..."
THISFORM.REFRESH
if not directory('Z:\')
thisform.text1.value="正在连接服务器,请等待..."
THISFORM.REFRESH
run/n net use Z: \\192.168.1.65\data shared
if thisform.serverconnecttest()=1
=MESSAGEBOX('连接服务器失败,请联系系统管理员。错误代码3','信息提示')
thisform.release
else
thisform.text1.value="正在检查主要数据文件的完整性,请等待..."
THISFORM.REFRESH
if databasecomplete()=0
thisform.userdatebasecheck()
thisform.text1.value="检测完成,正在登录"
*THISFORM.REFRESH
*do form dlbd
*thisform.release
else
e='重要数据文件丢失,请联系系统管理员。代码:'+alltrim(str(thisform.databasecomplete()))
=MESSAGEBOX(e,'信息提示')
thisform.release
endi
endi
else
if thisform.serverconnecttest()=1
=MESSAGEBOX('连接服务器失败,请联系系统管理员。错误代码3','信息提示')
thisform.release
else
thisform.text1.value="正在检查主要数据文件的完整性,请等待..."
THISFORM.REFRESH
if thisform.databasecomplete()=0
thisform.userdatebasecheck()
thisform.text1.value="检测完成,正在登录"
*THISFORM.REFRESH
*do form dlbd
*thisform.release
else
e='重要数据文件丢失,请联系系统管理员。代码:'+alltrim(str(thisform.databasecomplete()))
=MESSAGEBOX(e,'信息提示')
thisform.release
endi
endi
endif
else
DELETE FILE D:\jyfw\ip.txt
=MESSAGEBOX('网络连接失败,请检查网络或联系网络管理员。错误代码1','信息提示')
thisform.release
endi
else
=MESSAGEBOX('检测网络失败,操作系统异常,请联系系统管理员。错误代码2','信息提示')
thisform.release
endi