本帖最后由 afan 于 2010-9-17 18:07 编辑
木子恢复得挺快呀~
$Form1 = GUICreate("Form1", 354, 292, 192, 124)
$Input1 = GUICtrlCreateInput('', 32, 16, 281, 21)
GUICtrlSetData(-1, 'CNTV-CBox 网络电视客户端 安装')
$Input2 = GUICtrlCreateInput('', 32, 48, 281, 21)
GUICtrlSetData(-1, '欢迎使用"CNTV-CBox 网络电视客户端"安装向导')
$Edit1 = GUICtrlCreateEdit("", 32, 80, 281, 145)
GUICtrlSetData(-1, "")
$Button1 = GUICtrlCreateButton("Button1", 32, 240, 281, 25)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3
Exit
Case $Button1
$sI1 = GUICtrlRead($Input1)
If StringRegExp($sI1, '"') Then
$sI1 = "'" & $sI1 & "'"
Else
$sI1 = '"' & $sI1 & '"'
Endif
$sI2 = GUICtrlRead($Input2)
If StringRegExp($sI2, '"') Then
$sI2 = "'" & $sI2 & "'"
Else
$sI2 = '"' & $sI2 & '"'
Endif
GUICtrlSetData($Edit1, "WinActivate(" & $sI1 & ", " & $sI2 & ")" & @CRLF)
EndSwitch
WEnd
另注:如果没有单引号的介入其实就都用单引号就OK了$sI1 = "'" & GUICtrlRead($Input1) & "'"
$sI2 = "'" & GUICtrlRead($Input2) & "'"
GUICtrlSetData($Edit1, "WinActivate(" & $sI1 & ", " & $sI2 & ")" & @CRLF)
如果有单双引号混搭的情况可参考一下此贴 http://www.autoitx.com/thread-10929-1-1.html |