#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GUIListView.au3>
#include <IE.au3>
#region ### START Koda GUI section ### Form=C:\Users\Administrator\Desktop\Form1.kxf
$Form1 = GUICreate("生成器", 615, 438, 192, 124)
$Label1 = GUICtrlCreateLabel("记事本路径:", 48, 56, 76, 17)
$Button1 = GUICtrlCreateButton("一键生成", 144, 120, 321, 33)
$Input1 = GUICtrlCreateInput("", 120, 53, 345, 21)
$Button2 = GUICtrlCreateButton("浏览", 480, 49, 49, 25)
GUISetState()
Opt("TrayMenuMode", 1) ; 默认托盘菜单项目(脚本已暂停/退出脚本) (Script Paused/Exit) 将不显示.
#endregion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button2
$var = FileOpenDialog("打开", @DesktopDir & "", "文本文件 (*.txt)", 1 + 4)
If @error Then
MsgBox(16, "提示", "没有选择文件!")
Else
$var = StringReplace($var, "|", @CRLF)
GUICtrlSetData($Input1, $var)
EndIf
Case $Button1
Local $path = GUICtrlRead($Input1)
If $path = "" Then
MsgBox(16, "提示", "目录不能为空!")
ElseIf StringMid($path, 2, 2) <> ":" Then
MsgBox(16, "提示", "路径错误,请输入完整路径。")
Else
MsgBox(0, "提示", "路径正确,")
EndIf
EndSwitch
WEnd
为什么我直接粘贴路径到input里面,提示错误呢?问题出在哪里了。谢谢。 |