|
原代码
$0Address = IniRead("config.ini", "Proxy", "0Address", "")
$0Port = IniRead("config.ini", "Proxy", "0Port", "")
$0Name = IniRead("config.ini", "Proxy", "0Name", "")
$0pass = IniRead("config.ini", "Proxy", "0pass", "")
$1Address = IniRead("config.ini", "Proxy", "1Address", "")
$1Port = IniRead("config.ini", "Proxy", "1Port", "")
$1Name = IniRead("config.ini", "Proxy", "1Name", "")
$1pass = IniRead("config.ini", "Proxy", "1pass", "")
$Proxy_ON = IniRead("config.ini", "Proxy", "Proxy_ON", "0")
.....................
Func _ProxyOn()
If $Proxy_ON = 1 Then
HttpSetProxy(2, $0Address & ':' & $0Port, $0Name, $0pass);使用代理1 132
ElseIf $Proxy_ON = 2 Then
HttpSetProxy(2, $1Address & ':' & $1Port, $1Name, $1pass);使用代理2 130
ElseIf $Proxy_ON = 3 Then
HttpSetProxy(2, IniRead("config.ini", "Proxy", "Proxy_3", ""));文献代理 一般 能用
Else
HttpSetProxy(1);不使用代理
EndIf
If $iconFreeFlag = True Then HttpSetProxy(1) ;proxytag
EndFunc ;==>_ProxyOn
-------------
HttpSetProxy(2, IniRead("config.ini", "Proxy", "Proxy_3", ""));文献代理 一般 能用
这个是错误的,不用看。
现在想把ini代理数增加,原来只用2个代理,现在可能会增加到8个代理。
如果一个一个增加,比较麻烦了,怎么写,能让上面2段代码变得简单一些呢? |
|