回复 6# 515276542
变通下即可:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 294, 187, 192, 124)
$Edit1 = GUICtrlCreateEdit("", 16, 16, 265, 113)
GUICtrlSetBkColor($Edit1, 0xFFFFFF)
GUICtrlSetState($Edit1, $GUI_DISABLE)
GUICtrlSetData(-1, "")
$Button1 = GUICtrlCreateButton("获取U盘", 152, 152, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
move()
EndSwitch
WEnd
Func move()
$zi = " 已连接的设备盘符为 ==> "
$drive = DriveGetDrive("REMOVABLE");获取一个含有指定驱动器盘符, "REMOVABLE(可移动驱动器)"
If Not @error Then
Local $daxie = ""
For $i = 1 To $drive[0]
$daxie &= StringUpper($drive[$i]) & Chr(32);将小写盘符转换大写
Next
GUICtrlSetData($Edit1, $zi & $daxie);修改指定控件的数据,$Edit2是那个输入框
Else
MsgBox(16, "警告!", "未发现有U盘。", "", $Form1);显示一个简单的对话框
EndIf
EndFunc ;==>move
|