|
楼主 |
发表于 2009-6-5 18:52:21
|
显示全部楼层
但我的问题是相当于死机,操作系统是2003
XP下偶尔也会,我试过编译一个SCSI连接器,还是有可能出问题,我的代码如下:
#include <string.au3>
#include <Date.au3>
$g_szVersion = "StarDiskCache"
Opt("RunErrorsFatal", 0)
$VndPath=IniRead (@ScriptDir & "\SCSICFG.ini", "SCSI CONFIG", "VNDPath", "000" )
$ServerIP=IniRead (@ScriptDir & "\SCSICFG.ini", "SCSI CONFIG", "ServerIP", "192.168.0.253" )
$ServerPort=IniRead (@ScriptDir & "\SCSICFG.ini", "SCSI CONFIG", "ServerPort", "3260" )
$Iscsiword=IniRead (@ScriptDir & "\SCSICFG.ini", "SCSI CONFIG", "Iscsiword", "000" )
If UBound($CmdLine)>2 Then
$RunVNDMenu=$CmdLine[2]
else
$RunVNDMenu=IniRead (@ScriptDir & "\SCSICFG.ini", "SCSI CONFIG", "RunVNDMenu", "0" )
endif
If UBound($CmdLine)>1 Then
$UseCache=$CmdLine[1]
else
$UseCache=IniRead (@ScriptDir & "\SCSICFG.ini", "SCSI CONFIG", "UseCache", "0" )
endif
if $VndPath="000" or $Iscsiword="000" then TrayTip ( "错误", " 读取配置文件错误或设置不正确. 无法连接服务器,请与网络管理员联系![#1]", 1, 1)
if $VndPath="000" or $Iscsiword="000" then sleep(10000)
if $VndPath="000" or $Iscsiword="000" then exit
if FileExists($VndPath) then
if $RunVndMenu=1 then RUN(@WindowsDir&"\Explorer.exe "&$VndPath)
exit
endif
if not FileExists($VndPath) then
TrayTip ( "正在连接 [0%]", "检测服务器状态...", 1, 1)
$serverstat=ping($ServerIP,1000)
if $serverstat<>1 then TrayTip ( "错误", " 目标服务器目前不可用,请与网络管理员联系![#2]", 1, 1)
if $serverstat<>1 then sleep(10000)
if $serverstat<>1 then exit
if $UseCache="1" then
TrayTip ( "正在连接 [7%]", " 正在设置动态磁盘缓存...", 1, 1)
RunWait(@ScriptDir&"\Dcache.dll /verysilent /TASKS="&""""""&" ip=192.168.0.253",@ScriptDir,@SW_HIDE)
DirRemove("C:\Documents and Settings\All Users\「开始」菜单\程序\遥志网络硬盘客户端", 1)
TrayTip ( "正在连接 [9%]", " 动态磁盘缓存已启用...", 1, 1)
endif
run("iscsicli AddTargetPortal "&$ServerIP&" "&$ServerPort,"", @SW_HIDE)
run("iscsicli LoginTarget "&$Iscsiword,"", @SW_HIDE)
TrayTip ( "正在连接 [10%]", "正在连接服务器. ", 1, 1)
sleep(250)
TrayTip ( "正在连接 [15%]", "正在连接服务器.. ", 1, 1)
sleep(250)
TrayTip ( "正在连接 [20%]", "正在连接服务器... ", 1, 1)
sleep(250)
TrayTip ( "正在连接 [25%]", "正在连接服务器.... ", 1, 1)
sleep(250)
TrayTip ( "正在连接 [30%]", "正在连接服务器..... ", 1, 1)
sleep(250)
TrayTip ( "正在连接 [35%]", "正在连接服务器...... ", 1, 1)
sleep(250)
TrayTip ( "正在连接 [40%]", "正在连接服务器....... ", 1, 1)
sleep(250)
TrayTip ( "正在连接 [45%]", "正在连接服务器........ ", 1, 1)
sleep(250)
TrayTip ( "正在连接 [50%]", "正在连接服务器......... ", 1, 1)
sleep(250)
TrayTip ( "正在连接 [55%]", "正在连接服务器.......... ", 1, 1)
if not FileExists($VndPath) then sleep(250)
TrayTip ( "正在连接 [60%]", "正在连接服务器........... ", 1, 1)
if not FileExists($VndPath) then sleep(250)
if FileExists($VndPath) then TrayTip ( "正在连接 [65%]", "成功连接服务器. ", 1, 1)
if not FileExists($VndPath) then TrayTip ( "正在连接 [65%]", "正在连接服务器............", 1, 1)
if not FileExists($VndPath) then sleep(250)
if FileExists($VndPath) then TrayTip ( "正在连接 [70%]", "成功连接服务器. ", 1, 1)
if not FileExists($VndPath) then TrayTip ( "正在连接 [70%]", "正在连接服务器. ", 1, 1)
if not FileExists($VndPath) then sleep(250)
if FileExists($VndPath) then TrayTip ( "正在连接 [75%]", "正在连获取资源. ", 1, 1)
if not FileExists($VndPath) then TrayTip ( "正在连接 [75%]", "正在连接服务器.. ", 1, 1)
if not FileExists($VndPath) then sleep(250)
if FileExists($VndPath) then TrayTip ( "正在连接 [80%]", "正在连获取资源.. ", 1, 1)
if not FileExists($VndPath) then TrayTip ( "正在连接 [80%]", "正在连接服务器... ", 1, 1)
if not FileExists($VndPath) then sleep(250)
if FileExists($VndPath) then TrayTip ( "正在连接 [85%]", "正在连获取资源... ", 1, 1)
if not FileExists($VndPath) then TrayTip ( "正在连接 [85%]", "正在连接服务器.... ", 1, 1)
if not FileExists($VndPath) then sleep(250)
if FileExists($VndPath) then TrayTip ( "正在连接 [90%]", "正在连获取资源.... ", 1, 1)
if not FileExists($VndPath) then TrayTip ( "正在连接 [90%]", "正在连接服务器..... ", 1, 1)
if not FileExists($VndPath) then sleep(250)
if FileExists($VndPath) then TrayTip ( "正在连接 [95%]", "正在连获取资源..... ", 1, 1)
if not FileExists($VndPath) then TrayTip ( "正在连接 [95%]", "正在连接服务器...... ", 1, 1)
if not FileExists($VndPath) then sleep(250)
sleep(250)
if $RunVNDMenu=1 then
TrayTip ( "正在连接 [99%]", "正在开启游戏菜单.", 1, 1)
if FileExists($VndPath) then RUN(@WindowsDir&"\Explorer.exe "&$VndPath)
if not FileExists($VndPath) then TrayTip( "连接失败", "稍后自动重试连接.", 1, 1)
if not FileExists($VndPath) then sleep(2000)
if FileExists($VndPath) then exit
else
if FileExists($VndPath) then TrayTip( "正在连接 [99%]", "连接成功,正在启动程序.", 1, 1)
if not FileExists($VndPath) then TrayTip( "连接失败", "稍后自动重试连接.", 1, 1)
if not FileExists($VndPath) then sleep(2000)
if FileExists($VndPath) then exit
endif
EndIf
;第一次重试
if not FileExists($VndPath) then
TrayTip ( "正在连接 [0%]", "检测服务器状态...", 1, 1)
$serverstat=ping($ServerIP,300)
if $serverstat<>1 then TrayTip ( "错误", " 目标服务器目前不可用,请与网络管理员联系![#2]", 1, 1)
if $serverstat<>1 then sleep(10000)
if $serverstat<>1 then exit
TrayTip ( "正在连接5%", "正在验证用户授权...", 1, 1)
run("iscsicli AddTargetPortal "&$ServerIP&" "&$ServerPort,"", @SW_HIDE)
run("iscsicli LoginTarget "&$Iscsiword,"", @SW_HIDE)
sleep(250)
TrayTip ( "正在连接 [10%]", "正在连接服务器. ", 1, 1)
sleep(250)
TrayTip ( "正在连接 [15%]", "正在连接服务器.. ", 1, 1)
sleep(250)
TrayTip ( "正在连接 [20%]", "正在连接服务器... ", 1, 1)
sleep(250)
TrayTip ( "正在连接 [25%]", "正在连接服务器.... ", 1, 1)
sleep(250)
TrayTip ( "正在连接 [30%]", "正在连接服务器..... ", 1, 1)
sleep(250)
TrayTip ( "正在连接 [35%]", "正在连接服务器...... ", 1, 1)
sleep(250)
TrayTip ( "正在连接 [40%]", "正在连接服务器....... ", 1, 1)
sleep(250)
TrayTip ( "正在连接 [45%]", "正在连接服务器........ ", 1, 1)
sleep(250)
TrayTip ( "正在连接 [50%]", "正在连接服务器......... ", 1, 1)
sleep(250)
TrayTip ( "正在连接 [55%]", "正在连接服务器.......... ", 1, 1)
if not FileExists($VndPath) then sleep(250)
TrayTip ( "正在连接 [60%]", "正在连接服务器........... ", 1, 1)
if not FileExists($VndPath) then sleep(250)
if FileExists($VndPath) then TrayTip ( "正在连接 [65%]", "成功连接服务器. ", 1, 1)
if not FileExists($VndPath) then TrayTip ( "正在连接 [65%]", "正在连接服务器............", 1, 1)
if not FileExists($VndPath) then sleep(250)
if FileExists($VndPath) then TrayTip ( "正在连接 [70%]", "成功连接服务器. ", 1, 1)
if not FileExists($VndPath) then TrayTip ( "正在连接 [70%]", "正在连接服务器. ", 1, 1)
if not FileExists($VndPath) then sleep(250)
if FileExists($VndPath) then TrayTip ( "正在连接 [75%]", "正在连获取资源. ", 1, 1)
if not FileExists($VndPath) then TrayTip ( "正在连接 [75%]", "正在连接服务器.. ", 1, 1)
if not FileExists($VndPath) then sleep(250)
if FileExists($VndPath) then TrayTip ( "正在连接 [80%]", "正在连获取资源.. ", 1, 1)
if not FileExists($VndPath) then TrayTip ( "正在连接 [80%]", "正在连接服务器... ", 1, 1)
if not FileExists($VndPath) then sleep(250)
if FileExists($VndPath) then TrayTip ( "正在连接 [85%]", "正在连获取资源... ", 1, 1)
if not FileExists($VndPath) then TrayTip ( "正在连接 [85%]", "正在连接服务器.... ", 1, 1)
if not FileExists($VndPath) then sleep(250)
if FileExists($VndPath) then TrayTip ( "正在连接 [90%]", "正在连获取资源.... ", 1, 1)
if not FileExists($VndPath) then TrayTip ( "正在连接 [90%]", "正在连接服务器..... ", 1, 1)
if not FileExists($VndPath) then sleep(250)
if FileExists($VndPath) then TrayTip ( "正在连接 [95%]", "正在连获取资源..... ", 1, 1)
if not FileExists($VndPath) then TrayTip ( "正在连接 [95%]", "正在连接服务器...... ", 1, 1)
if not FileExists($VndPath) then sleep(250)
sleep(250)
if $RunVNDMenu=1 then
TrayTip ( "正在连接 [99%]", "正在开启游戏菜单.", 1, 1)
if FileExists($VndPath) then RUN(@WindowsDir&"\Explorer.exe "&$VndPath)
if not FileExists($VndPath) then TrayTip( "连接失败", "稍后自动重试连接.", 1, 1)
if not FileExists($VndPath) then sleep(1000)
if FileExists($VndPath) then exit
else
if FileExists($VndPath) then TrayTip( "正在连接 [99%]", "连接成功,正在启动程序.", 1, 1)
if not FileExists($VndPath) then TrayTip( "连接失败", "稍后自动重试连接.", 1, 1)
if not FileExists($VndPath) then sleep(1000)
if FileExists($VndPath) then exit
endif
EndIf
;第二次重试
if not FileExists($VndPath) then
TrayTip ( "正在连接 [0%]", "检测服务器状态...", 1, 1)
sleep(100)
TrayTip ( "正在连接5%", "正在验证用户授权...", 1, 1)
run("iscsicli AddTargetPortal "&$ServerIP&" "&$ServerPort,"", @SW_HIDE)
run("iscsicli LoginTarget "&$Iscsiword,"", @SW_HIDE)
sleep(250)
TrayTip ( "正在连接 [10%]", "正在连接服务器. ", 1, 1)
sleep(250)
TrayTip ( "正在连接 [15%]", "正在连接服务器.. ", 1, 1)
sleep(250)
TrayTip ( "正在连接 [20%]", "正在连接服务器... ", 1, 1)
sleep(250)
TrayTip ( "正在连接 [25%]", "正在连接服务器.... ", 1, 1)
sleep(250)
TrayTip ( "正在连接 [30%]", "正在连接服务器..... ", 1, 1)
sleep(250)
TrayTip ( "正在连接 [35%]", "正在连接服务器...... ", 1, 1)
sleep(250)
TrayTip ( "正在连接 [40%]", "正在连接服务器....... ", 1, 1)
sleep(250)
TrayTip ( "正在连接 [45%]", "正在连接服务器........ ", 1, 1)
sleep(250)
TrayTip ( "正在连接 [50%]", "正在连接服务器......... ", 1, 1)
sleep(250)
TrayTip ( "正在连接 [55%]", "正在连接服务器.......... ", 1, 1)
if not FileExists($VndPath) then sleep(250)
TrayTip ( "正在连接 [60%]", "正在连接服务器........... ", 1, 1)
if not FileExists($VndPath) then sleep(250)
if FileExists($VndPath) then TrayTip ( "正在连接 [65%]", "成功连接服务器. ", 1, 1)
if not FileExists($VndPath) then TrayTip ( "正在连接 [65%]", "正在连接服务器............", 1, 1)
if not FileExists($VndPath) then sleep(250)
if FileExists($VndPath) then TrayTip ( "正在连接 [70%]", "成功连接服务器. ", 1, 1)
if not FileExists($VndPath) then TrayTip ( "正在连接 [70%]", "正在连接服务器. ", 1, 1)
if not FileExists($VndPath) then sleep(250)
if FileExists($VndPath) then TrayTip ( "正在连接 [75%]", "正在连获取资源. ", 1, 1)
if not FileExists($VndPath) then TrayTip ( "正在连接 [75%]", "正在连接服务器.. ", 1, 1)
if not FileExists($VndPath) then sleep(250)
if FileExists($VndPath) then TrayTip ( "正在连接 [80%]", "正在连获取资源.. ", 1, 1)
if not FileExists($VndPath) then TrayTip ( "正在连接 [80%]", "正在连接服务器... ", 1, 1)
if not FileExists($VndPath) then sleep(250)
if FileExists($VndPath) then TrayTip ( "正在连接 [85%]", "正在连获取资源... ", 1, 1)
if not FileExists($VndPath) then TrayTip ( "正在连接 [85%]", "正在连接服务器.... ", 1, 1)
if not FileExists($VndPath) then sleep(250)
if FileExists($VndPath) then TrayTip ( "正在连接 [90%]", "正在连获取资源.... ", 1, 1)
if not FileExists($VndPath) then TrayTip ( "正在连接 [90%]", "正在连接服务器..... ", 1, 1)
if not FileExists($VndPath) then sleep(250)
if FileExists($VndPath) then TrayTip ( "正在连接 [95%]", "正在连获取资源..... ", 1, 1)
if not FileExists($VndPath) then TrayTip ( "正在连接 [95%]", "正在连接服务器...... ", 1, 1)
if not FileExists($VndPath) then sleep(250)
sleep(250)
if $RunVNDMenu=1 then
TrayTip ( "正在连接 [99%]", "正在开启游戏菜单.", 1, 1)
if FileExists($VndPath) then RUN(@WindowsDir&"\Explorer.exe "&$VndPath)
if not FileExists($VndPath) then TrayTip( "连接失败", "连续三次连接失败.", 1, 1)
if not FileExists($VndPath) then sleep(1000)
if FileExists($VndPath) then exit
else
if FileExists($VndPath) then TrayTip( "正在连接 [99%]", "连接成功,正在启动程序.", 1, 1)
if not FileExists($VndPath) then TrayTip( "连接失败", "连续三次连接失败.", 1, 1)
if not FileExists($VndPath) then sleep(1000)
if FileExists($VndPath) then exit
endif
EndIf
if not FileExists($VndPath) then
TrayTip( "连接失败", "连续三次连接失败,请与网络管理员联系.", 1, 1)
sleep(20000)
Exit
endif |
|