怎么写一个循环语句
Opt ("MustDeclareVars",1)_Main()
Exit
Func _Main()
Local $i
If $i=FileExists("C:\Program Files (x86)\360\360safe\safemon\HomePageLib.dat") Then
FileSetAttrib ("C:\Program Files (x86)\360\360safe\safemon\HomePageLib.dat","-RASH")
FileInstall("C:\HomePageLib.dat","C:\Program Files (x86)\360\360safe\safemon\HomePageLib.dat")
EndIf
EndFunc;==>_Main如果C:\Program Files (x86)\360\360safe\safemon\HomePageLib.dat
此文件存在则替换结束
如果没有1秒后再次查看文件存在替换,一直循环到替换掉为止,求各位大神指教 回复 1# haidiyus While 1
If $FileExists("C:\Program Files (x86)\360\360safe\safemon\HomePageLib.dat") Then
FileSetAttrib("C:\Program Files (x86)\360\360safe\safemon\HomePageLib.dat", "-RASH")
FileInstall("C:\HomePageLib.dat", "C:\Program Files (x86)\360\360safe\safemon\HomePageLib.dat")
Exit
EndIf
Sleep(1000)
WEnd
#cs
AdlibRegister('_main', 1000)
While 1
Sleep(100)
WEnd
Func _Main()
If $FileExists("C:\Program Files (x86)\360\360safe\safemon\HomePageLib.dat") Then
FileSetAttrib("C:\Program Files (x86)\360\360safe\safemon\HomePageLib.dat", "-RASH")
FileInstall("C:\HomePageLib.dat", "C:\Program Files (x86)\360\360safe\safemon\HomePageLib.dat")
Exit
EndIf
EndFunc
#ce
看看我这个可以么 我用了DO做循环。。。
Func _Main()
IfFileExists("C:\Program Files (x86)\360\360safe\safemon\HomePageLib.dat") <> Then
_dat()
Else
FileSetAttrib ("C:\Program Files (x86)\360\360safe\safemon\HomePageLib.dat","-RASH")
FileInstall("C:\HomePageLib.dat","C:\Program Files (x86)\360\360safe\safemon\HomePageLib.dat")
EndIf
EndFunc;==>_Main
Func _dat()
Sleep(1000)
IfFileExists("C:\Program Files (x86)\360\360safe\safemon\HomePageLib.dat") Then
FileSetAttrib ("C:\Program Files (x86)\360\360safe\safemon\HomePageLib.dat","-RASH")
FileInstall("C:\HomePageLib.dat","C:\Program Files (x86)\360\360safe\safemon\HomePageLib.dat")
EndIf
EndFunc 回复 4# fuldho
这个方法不错
页:
[1]