初学者, 学习过程中做下面这个练习的完全发现不到问题,但是运行就出错.求老鸟指点!Opt("mustdeclarevars",1)
_main()
Exit
Func _main()
Local $driversdir=EnvGet("systemdrive")&"\drivers"
Local $cameradir=$driversdir&"\camera"
Local $tempdir=EnvGet("windir")&"\temp"
If FileExists($driversdir)Then
Local $r=MsgBox(3+32,"3-3",_
"发现"&$driversdir&",是否删除?"_
&@CRLF&@CRLF&_
"单击“是”,全部删除;"&@CRLF&_
"单击“否”,保留摄像头驱动;"& @CRLF & _
"单击“取消”,不删除")
If $r=6 Then
DirRemove($driversdir,1)
MsgBox(0+64,"3-3","全部的孙子已经干掉")
ElseIf $r=7 Then
DirMove($driversdir&"\camera",_
$tempdir&"\_camera",1)
DirRemove($driversdir,1)
DirCreate($driversdir)
DirMove($tempdir&"\_camera",_
$DriversDir & "\Camera", 1)
MsgBox(0+64,"3-3",_
"除摄像头以外的驱动已删除!")
ElseIf $r=2 Then
MsgBox(0+64,"3-3","全部驱动已经保留!")
EndIf
Else
MsgBox(0,"3-3","未发现"&$driversdir&"!")
EndIf
endfunc
|