Func LoginBitvise()
If _GUICtrlListView_GetItemCount($listViewSSH)>=1 Then
ProcessClose("BvSsh.exe")
$row=_GUICtrlListView_GetSelectedIndices($listViewSSH)
$row+=1
$aItem = GUICtrlRead(GUICtrlRead($listViewSSH))
_GUICtrlListView_SetItemSelected($listViewSSH,$row,True,True)
_GUICtrlListView_ClickItem($listViewSSH,$row)
$textTemp = StringSplit($aItem,"|")
ReDim $textTemp[6]
$ip=$textTemp[2]
$id=$textTemp[3]
$password=$textTemp[4]
Global $nation=$textTemp[5]
Local $sDir=RegRead("HKEY_CLASSES_ROOT\Bitvise.SSH.Client4.60.Profile\DefaultIcon","")
$sDir=StringTrimRight($sDir,2)
$bitvise =$sDir &" -profile="&@WorkingDir&"\tenten.bscp"&" -host="&$ip&" -port=22 -username="&$id&" -password="&$password&" -loginOnStartup -exitOnLogout"
Run($bitvise)
$delay=0
$auth=0
While $delay<=30
If ProcessExists("BvSsh.exe") Then
$auth=WinExists("Host Key Verification")
if $auth =1 Then
$auth=WinGetHandle("Host Key Verification")
WinActivate($auth)
ControlClick("Host Key Verification","Accept and &Save","[CLASS:Button;INSTANCE:1]")
ExitLoop
EndIf
Sleep(500)
$delay+=1
Else
ExitLoop
EndIf
WEnd
$answer=""
$doi=0
Do
$answer = ControlGetText("Bitvise SSH Client","","[CLASS:Button;INSTANCE:1]")
Sleep(1000)
$doi+=1
WinClose("User Authentication Banner")
WinClose("Bitvise xterm - tenten.bscp - "&$ip&":22")
WinClose("Bitvise SFTP - tenten.bscp - "&$ip&":22")
WinClose("Bvtermc Error")
WinClose("Totermc Error")
Until $doi=10 or StringCompare($answer,"Logout")=0
Switch $answer
Case "Abort"
LoginBitvise()
Case ""
LoginBitvise()
EndSwitch
EndIf
WinClose("User Authentication Banner")
EndFunc
Func ChangeSocks()
Do
LoginBitvise()
Until CheckCountry1($ip)=1
WinClose("Bitvise xterm - tenten.bscp - "&$ip&":22")
WinClose("Bitvise SFTP - tenten.bscp - "&$ip&":22")
EndFunc
Code cùi dùng tạm