ผมทำโปรแกรมล็อกโฟสเดอร์ พอทำเสร็จแล้วมี Error ครับ แก้ไปแก้มา งง ครับ
- Code:
#include <GUIConstants.au3>
$Form1 = GUICreate("โปรแกรมล็อกโฟสเดอร์", 336, 122, 566, 201)
$Button1 = GUICtrlCreateButton("ล็อก-ปลดล๊อกโฟสเดอร์", 160, 72, 121, 41, 0)
$Radio1 = GUICtrlCreateRadio("ล็อกโฟสเดอร์", 48, 72, 81, 17)
$Radio2 = GUICtrlCreateRadio("ปลดล็อกโฟสเดอร์", 48, 96, 105, 17)
$Input1 = GUICtrlCreateInput("", 24, 16, 209, 21)
$Button2 = GUICtrlCreateButton("เลือกโฟสเดอร์", 240, 16, 73, 25, 0)
$Label1 = GUICtrlCreateLabel("จัดทำโปรแกรมโดย Max", 88, 48, 117, 17)
GUISetState(@SW_SHOW)
While 1
$Dir = GUICtrlRead($Input1)
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Radio1
if $Radio1 = True Then
$Radioo1 = 1
Else
$Radioo1 = 0
EndIf
Case $Radio2
if $Radio2 = True Then
$Radioo2 = 1
Else
$Radioo2 = 0
EndIf
Case $Button1
if $Radioo1 = 1 Then
DirMove($Dir,$Dir&".{20D04FE0-3AEA-1069-A2D8-08002B30309D}")
MsgBox(0,"","ล็อกโฟสเดอร์เรียบร้อยแล้ว")
EndIf
if $Radioo2 = 1 Then
$Re = StringReplace($Dir,"" ,".{20D04FE0-3AEA-1069-A2D8-08002B30309D}")
DirMove($Dir,$Re)
MsgBox(0,"","ปลดล็อกโฟสเดอร์เรียบร้อยแล้ว")
EndIf
Case $Button2
$Dirr = FileSelectFolder("เลือกโฟสเดอร์ที่ต้องการล็อก","/")
GUICtrlSetData($Input1,$Dirr)
EndSwitch
WEnd