本帖最后由 骗子 于 2011-5-17 15:32 编辑
把在论坛东拼西凑的一个东西改了改放到这里,这个是读取本地配置文件,然后选定后点击按钮执行相应操作的。
远程桌面的内容没写
不知道这个符合不符合楼主的一部分需求
#NoTrayIcon
#include <IE.au3>
#include <GuiListView.au3>
#include <GUIConstantsEx.au3>
#include <Array.au3>
;安全相关,绑定IP地址
;~ ;;;;~ MsgBox(0, 0, @IPAddress1 & @CRLF & @IPAddress2)
;~ If @IPAddress1 = "10.220.2.59" Or @IPAddress2 = "10.220.2.59" Or @IPAddress3 = "10.220.2.59" Or @IPAddress4 = "10.220.2.59" Then
;~ Else
;~ MsgBox(4096, "只能在指定机器上运行", "请确认是在规定的机器上使用此程序", 2)
;~ Exit
;~ EndIf
;~ ;;;;;安全相关,绑定IP地址
$dir = @ScriptDir & "\4A配置.ini" ;这个配置文件可以考虑根据你给程序员的用户名密码去FTP或者WEB服务器上获取并替换本地文件
Dim $days
$Form1 = GUICreate("TEST", 280, 270)
$ListView1 = GUICtrlCreateListView(" 服务器IP | 账号 | 加密密码", 10, 10, 260, 100)
$button2 = GUICtrlCreateButton("选定后点击登录相应主机", 5, 120, 220, 25)
GUISetState(@SW_SHOW)
Read()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $button2
$days = StringSplit(GUICtrlRead(GUICtrlRead($ListView1)), "|")
If Not @error Then
$days[3] = _jiami(0, $days[3], '我的密码pass#$*_ (@', 3) ;;;;解密,与下面的加密想对应
MsgBox(0, "服务器IP" & $days[2], "账号" & $days[2] & @CRLF & "密码" & $days[3])
;有了这3项就可以考虑用各种方法远程到服务器上了,
;这里放远程桌面的操作步骤
Else
MsgBox(0, "请选中再点", "你确定你选中了?", 2)
EndIf
EndSwitch
WEnd
Func Read() ;将配置文件的内容读取到窗口中
$z = 0
_GUICtrlListView_DeleteAllItems($ListView1)
$read = IniReadSection($dir, "config")
If Not @error Then
For $i = 1 To $read[0][0]
GUICtrlCreateListViewItem($read[$i][0], $ListView1)
_GUICtrlListView_AddSubItem($ListView1, $z, $read[$i][1], 2)
$z += 1
Next
EndIf
EndFunc ;==>Read
;下面是加解密的内容,也是从论坛中抄的
;~ $sd='qin147原创的字符加密器'
;~ $jm=_jiami(1, $sd, '我的密码pass#$*_ (@',2) ;_jiami( 1加密 0解密 , 要加密字符, 密码 , 等级 ) 密码可以是任何字符(如中文或符号) 等级0-9
;~ $qm=_jiami(0, $jm, '我的密码pass#$*_ (@',2)
;~ MsgBox(0,'qin147字符加密器测试','加密后:'&$jm&@LF _
;~ &@LF _
;~ &'解密后:'&$qm)
Func _jiami($jiami_lp, $jiami_txt, $jiami_pas, $jiami_lev)
Local $tlev, $bhb, $jjxc = 1, $Num
Local $jh[100]
If $jiami_txt = '' Or $jiami_pas = '' Or StringLen($jiami_pas) > 100 _
Or $jiami_lev > 9 Or Int($jiami_lev) <> $jiami_lev Or $jiami_lev < 0 Then Return -1
If $jiami_lp = 1 Then
$sosu = StringLen($jiami_pas)
For $pa_s = 1 To $sosu
$jh[$pa_s] = Asc(StringMid($jiami_pas, $pa_s, 1))
$Num = $Num & $jh[$pa_s]
If $jjxc > 3 Then $jjxc = 1
If $jjxc = 1 Then
$bhb = Int($bhb + $jh[$pa_s])
ElseIf $jjxc = 2 Then
$bhb = Int($bhb * $jh[$pa_s])
ElseIf $jjxc = 3 Then
$bhb = Int($bhb - $jh[$pa_s])
EndIf
$jjxc += 1
Next
$Num = StringLeft($Num, $jiami_lev) & $bhb & StringRight($Num, $jiami_lev)
$jiami_txt = StringTrimLeft(StringToBinary($jiami_txt, 2), 2)
$y_si = $sosu
$j_si = 1
Do
$vi = StringMid($jh[$j_si], 1, 1) + StringMid($jh[$y_si], StringLen($jh[$y_si]), 1)
$tempa = StringMid($jiami_txt, 1, $vi - 1)
$tempb = StringMid($jiami_txt, $vi)
$jiami_txt = $tempa & $jh[$j_si] & $tempb
$y_si -= 1
$j_si += 1
Until $y_si <= 0 And $j_si >= $sosu
$st = StringLen($Num)
$txtshi = StringLen($jiami_txt)
For $kl = 1 To $st
$rtemp = ''
For $vn = 1 To $txtshi Step StringMid($Num, $kl, 1) + 30
$rtemp = StringMid($jiami_txt, $vn, StringMid($Num, $kl, 1) + 30) & $rtemp
Next
$jiami_txt = $rtemp
Next
Return $jiami_txt
ElseIf $jiami_lp = 0 Then
$sosu = StringLen($jiami_pas)
For $pa_s = 1 To $sosu
$jh[$pa_s] = Asc(StringMid($jiami_pas, $pa_s, 1))
$Num = $Num & $jh[$pa_s]
If $jjxc > 3 Then $jjxc = 1
If $jjxc = 1 Then
$bhb = Int($bhb + $jh[$pa_s])
ElseIf $jjxc = 2 Then
$bhb = Int($bhb * $jh[$pa_s])
ElseIf $jjxc = 3 Then
$bhb = Int($bhb - $jh[$pa_s])
EndIf
$jjxc += 1
Next
$Num = StringLeft($Num, $jiami_lev) & $bhb & StringRight($Num, $jiami_lev)
$st = StringLen($Num)
Do
$txtshi = StringLen($jiami_txt)
$rtemp = ''
Do
$rtemp = $rtemp & StringRight($jiami_txt, StringMid($Num, $st, 1) + 30)
$jiami_txt = StringTrimRight($jiami_txt, StringMid($Num, $st, 1) + 30)
$txtshi -= StringMid($Num, $st, 1) + 30
Until $txtshi <= 0
$jiami_txt = $rtemp
$st -= 1
Until $st <= 0
$y_si = $sosu
$j_si = 1
Do
$vi = StringMid($jh[$y_si], 1, 1) + StringMid($jh[$j_si], StringLen($jh[$j_si]), 1)
$tempa = StringMid($jiami_txt, 1, $vi - 1)
$tempb = StringMid($jiami_txt, $vi + StringLen($jh[$y_si]))
$jiami_txt = $tempa & $tempb
$y_si -= 1
$j_si += 1
Until $y_si <= 0
$jiami_txt = '0x' & $jiami_txt
$jiami_txt = BinaryToString($jiami_txt, 2)
Return $jiami_txt
Else
Return -1
EndIf
EndFunc ;==>_jiami
|