网址已经存在数组里了,是现成的.直接打开就是了.
#include <ListViewConstants.au3>
Global Const $qIni = @ScriptDir&"\config.ini"
$Form1 = GUICreate("Form1", 623, 449, 192, 124)
$ListView1 = GUICtrlCreateListView("网站|地址", 8, 8, 537, 377)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 80)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 300)
$sec = IniReadSection($qIni,"data")
If @error Then Local $sec[3][2] = [[2], ['web1', 'www.baidu.com'], ['web2', 'www.qq.com']]
Global $lv_item[$sec[0][0]]
For $i = 1 To $sec[0][0]
$lv_item[$i-1] = GUICtrlCreateListViewItem($sec[$i][0]&"|"&$sec[$i][1],$ListView1)
Next
GUISetState()
Local $nMsg = 0
Do
$nMsg = GUIGetMsg()
Switch $nMsg
Case $lv_item[0] To $lv_item[UBound($lv_item)-1]
Local $web = $sec[$nMsg-$lv_item[0]+1][1]
;Local $web = StringRegExpReplace(GUICtrlRead($nMsg), '^[^\|]+.+\|([^\|]+)\|?$', '\1')
;If Not @extended Then ContinueLoop
ShellExecute(@ProgramFilesDir & '\Internet Explorer\iexplore.exe', $web)
EndSwitch
Until $nMs
|