Показать полную графическую версию : VNC авторизация
Может есть у кого готовый или помогите создать скрипт для автоматической авторизации при vnc подключении.
Требуется входить как с доменной авторизацией так и просто по паролю (окна при этих авторизациях разные).
т.е. нужен процесс или служба работающая в ожидании нужного окна (запрос авторизации по VNC)
и при появлении требуемого (их бывает два - с доменной авторизацией и авторизация по паролю - они разные) окна
осуществляла ввод (нужного) логина + пароля (в случае с доменной авторизацией) или просто пароля (в случае обычной авторизации).
думаю многим очень будет полезна данная наработка
решение (http://forum.oszone.net/post-1730822-17.html)
реализация с ini файлом (http://forum.oszone.net/post-1733686-30.html)
Данные окна с доменной авторизацией
Title:Ultr@VNC Авторизация
Class:#32770
Поле с логином
Class:Edit
Instance:1
Поле с паролем
Class:Edit
Instance:2
Данные окна с авторизацией по паролю
Title:VNC Авторизация
Class:#32770
Поле с паролем
Class:Edit
Instance:1
madmasles
11-08-2011, 12:47
batyaPS,
А есть кнопка, на которую надо нажимать?
madmasles,
Данные окна с доменной авторизацией
Title:Ultr@VNC Авторизация
Class:#32770
Поле с логином
Class:Edit
Instance:1
Поле с паролем
Class:Edit
Instance:2
кнопка "войти"
Class:Button
Instance:1
Данные окна с авторизацией по паролю
Title:VNC Авторизация
Class:#32770
Поле с паролем
Class:Edit
Instance:1
кнопка "войти"
Class:Button
Instance:1
либо Enter
madmasles
11-08-2011, 16:51
batyaPS,
Попробуйте так:#NoTrayIcon (http://www.autoitscript.com/autoit3/docs/keywords.htm##notrayicon)
#include (http://www.autoitscript.com/autoit3/docs/keywords.htm##include) <WinAPIEx.au3>;Yashied, http://autoit-script.ru/index.php/topic,47.0.html
Opt (http://www.autoitscript.com/autoit3/docs/functions/Opt.htm)('MustDeclareVars', 1)
Opt (http://www.autoitscript.com/autoit3/docs/functions/Opt.htm)('TrayMenuMode', 1)
Global (http://www.autoitscript.com/autoit3/docs/keywords.htm#Global) $sTitleScript = @ScriptName (http://www.autoitscript.com/autoit3/docs/macros.htm#@scriptname) & '{[/@$@\]}', $sTitleLogPass = '[Title:Ultr@VNC Авторизация;Class:#32770]', _
$sTitlePass = '[Title:VNC Авторизация;Class:#32770]', $fLogPass, $fPass, $nExitItem, $msg
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) WinExists (http://www.autoitscript.com/autoit3/docs/functions/WinExists.htm)($sTitleScript) Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then) Exit (http://www.autoitscript.com/autoit3/docs/keywords.htm#Exit)
AutoItWinSetTitle (http://www.autoitscript.com/autoit3/docs/functions/AutoItWinSetTitle.htm)($sTitleScript)
HotKeySet (http://www.autoitscript.com/autoit3/docs/functions/HotKeySet.htm)('{Esc}', '_Exit')
$nExitItem = TrayCreateItem (http://www.autoitscript.com/autoit3/docs/functions/TrayCreateItem.htm)('Выход')
TraySetState (http://www.autoitscript.com/autoit3/docs/functions/TraySetState.htm)()
TraySetToolTip (http://www.autoitscript.com/autoit3/docs/functions/TraySetToolTip.htm)('<VNC Авторизация>' & @LF (http://www.autoitscript.com/autoit3/docs/macros.htm#@lf) & 'Выход - нажать кнопку "Esc"')
_WinAPI_EmptyWorkingSet()
While (http://www.autoitscript.com/autoit3/docs/keywords.htm#While) 1
$msg = TrayGetMsg (http://www.autoitscript.com/autoit3/docs/functions/TrayGetMsg.htm)()
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) WinExists (http://www.autoitscript.com/autoit3/docs/functions/WinExists.htm)($sTitleLogPass) Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then)
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) Not (http://www.autoitscript.com/autoit3/docs/keywords.htm#Not) $fLogPass Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then)
_AvtorLogPass()
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) Not (http://www.autoitscript.com/autoit3/docs/keywords.htm#Not) @error (http://www.autoitscript.com/autoit3/docs/macros.htm#@error) Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then) $fLogPass = True (http://www.autoitscript.com/autoit3/docs/keywords.htm#True)
EndIf (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndIf)
Else (http://www.autoitscript.com/autoit3/docs/keywords.htm#Else)
$fLogPass = False (http://www.autoitscript.com/autoit3/docs/keywords.htm#False)
EndIf (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndIf)
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) WinExists (http://www.autoitscript.com/autoit3/docs/functions/WinExists.htm)($sTitlePass) Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then)
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) Not (http://www.autoitscript.com/autoit3/docs/keywords.htm#Not) $fPass Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then)
_AvtorPass()
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) Not (http://www.autoitscript.com/autoit3/docs/keywords.htm#Not) @error (http://www.autoitscript.com/autoit3/docs/macros.htm#@error) Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then) $fPass = True (http://www.autoitscript.com/autoit3/docs/keywords.htm#True)
EndIf (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndIf)
Else (http://www.autoitscript.com/autoit3/docs/keywords.htm#Else)
$fPass = False (http://www.autoitscript.com/autoit3/docs/keywords.htm#False)
EndIf (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndIf)
Switch (http://www.autoitscript.com/autoit3/docs/keywords.htm#Switch) $msg
Case (http://www.autoitscript.com/autoit3/docs/keywords.htm#Case) 0
ContinueLoop (http://www.autoitscript.com/autoit3/docs/keywords.htm#ContinueLoop)
Case (http://www.autoitscript.com/autoit3/docs/keywords.htm#Case) $nExitItem
_Exit()
EndSwitch (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndSwitch)
WEnd (http://www.autoitscript.com/autoit3/docs/keywords.htm#WEnd)
Func (http://www.autoitscript.com/autoit3/docs/keywords.htm#Func) _AvtorLogPass()
Local (http://www.autoitscript.com/autoit3/docs/keywords.htm#Local) $h_Win, $n_Log = '[Class:Edit;Instance:1]', $n_Pass = '[Class:Edit;Instance:2]', _
$n_Button = '[Class:Button;Instance:1]', $s_Log = 'TestUser', $s_Pass = 'TestPass';свои данные поставьте
$h_Win = WinGetHandle (http://www.autoitscript.com/autoit3/docs/functions/WinGetHandle.htm)($sTitleLogPass)
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) Not (http://www.autoitscript.com/autoit3/docs/keywords.htm#Not) $h_Win Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then) Return (http://www.autoitscript.com/autoit3/docs/keywords.htm#Return) SetError (http://www.autoitscript.com/autoit3/docs/functions/SetError.htm)(1)
ControlSetText (http://www.autoitscript.com/autoit3/docs/functions/ControlSetText.htm)($h_Win, '', $n_Log, $s_Log)
ControlSetText (http://www.autoitscript.com/autoit3/docs/functions/ControlSetText.htm)($h_Win, '', $n_Pass, $s_Pass)
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) ControlGetText (http://www.autoitscript.com/autoit3/docs/functions/ControlGetText.htm)($h_Win, '', $n_Log) <> $s_Log Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then) Return (http://www.autoitscript.com/autoit3/docs/keywords.htm#Return) SetError (http://www.autoitscript.com/autoit3/docs/functions/SetError.htm)(1)
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) ControlGetText (http://www.autoitscript.com/autoit3/docs/functions/ControlGetText.htm)($h_Win, '', $n_Pass) <> $s_Pass Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then) Return (http://www.autoitscript.com/autoit3/docs/keywords.htm#Return) SetError (http://www.autoitscript.com/autoit3/docs/functions/SetError.htm)(1)
ControlClick (http://www.autoitscript.com/autoit3/docs/functions/ControlClick.htm)($h_Win, '', $n_Button)
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) WinExists (http://www.autoitscript.com/autoit3/docs/functions/WinExists.htm)($h_Win) Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then) Return (http://www.autoitscript.com/autoit3/docs/keywords.htm#Return) SetError (http://www.autoitscript.com/autoit3/docs/functions/SetError.htm)(1)
Return (http://www.autoitscript.com/autoit3/docs/keywords.htm#Return) SetError (http://www.autoitscript.com/autoit3/docs/functions/SetError.htm)(0)
EndFunc (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndFunc) ;==>_AvtorLogPass
Func (http://www.autoitscript.com/autoit3/docs/keywords.htm#Func) _AvtorPass()
Local (http://www.autoitscript.com/autoit3/docs/keywords.htm#Local) $h_Win, $n_Pass = '[Class:Edit;Instance:1]', $n_Button = '[Class:Button;Instance:1]', _
$s_Pass = 'TestPass';свои данные поставьте
$h_Win = WinGetHandle (http://www.autoitscript.com/autoit3/docs/functions/WinGetHandle.htm)($sTitlePass)
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) Not (http://www.autoitscript.com/autoit3/docs/keywords.htm#Not) $h_Win Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then) Return (http://www.autoitscript.com/autoit3/docs/keywords.htm#Return) SetError (http://www.autoitscript.com/autoit3/docs/functions/SetError.htm)(1)
ControlSetText (http://www.autoitscript.com/autoit3/docs/functions/ControlSetText.htm)($h_Win, '', $n_Pass, $s_Pass)
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) ControlGetText (http://www.autoitscript.com/autoit3/docs/functions/ControlGetText.htm)($h_Win, '', $n_Pass) <> $s_Pass Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then) Return (http://www.autoitscript.com/autoit3/docs/keywords.htm#Return) SetError (http://www.autoitscript.com/autoit3/docs/functions/SetError.htm)(1)
ControlClick (http://www.autoitscript.com/autoit3/docs/functions/ControlClick.htm)($h_Win, '', $n_Button)
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) WinExists (http://www.autoitscript.com/autoit3/docs/functions/WinExists.htm)($h_Win) Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then) Return (http://www.autoitscript.com/autoit3/docs/keywords.htm#Return) SetError (http://www.autoitscript.com/autoit3/docs/functions/SetError.htm)(1)
Return (http://www.autoitscript.com/autoit3/docs/keywords.htm#Return) SetError (http://www.autoitscript.com/autoit3/docs/functions/SetError.htm)(0)
EndFunc (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndFunc) ;==>_AvtorPass
Func (http://www.autoitscript.com/autoit3/docs/keywords.htm#Func) _Exit()
Exit (http://www.autoitscript.com/autoit3/docs/keywords.htm#Exit)
EndFunc (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndFunc) ;==>_Exit
При компиляции ошибка
Aut2Exe Error
Line 2 (File .......)
#include <WinAPIEx.au3>
Error: Error opening the file/
у меня чего то в наборе не хватает я так понимаю ??
Расширение стандартной AutoIt библиотеки WinAPI.au3 (http://autoit-script.ru/index.php/topic,47.0.html)
madmasles
11-08-2011, 20:53
При компиляции ошибка »Как Вы считаете, я во второй строке кода дал ссылку просто так?
Как Вы считаете, я во второй строке кода дал ссылку просто так? »
я заметил, скачал, положил в папку с программой, но ошибка повторяеться
Всё, разобрался. Окна отлавливаются, ввод логина+пароля / пароля осуществляеться.
Кнопка "Войти" не отрабатывает .
madmasles
12-08-2011, 11:55
Кнопка "Войти" не отрабатывает »Попробуйте заменить;...
ControlClick (http://www.autoitscript.com/autoit3/docs/functions/ControlClick.htm)($h_Win, '', $n_Button)
;на
ControlSend (http://www.autoitscript.com/autoit3/docs/functions/ControlSend.htm)($h_Win, '', '', '{ENTER}')
;или на
ControlSend (http://www.autoitscript.com/autoit3/docs/functions/ControlSend.htm)($h_Win, '', $n_Button, '{ENTER}')
Попробуйте заменить »
испробовал оба варианта.
чет не хочет нажиматься.
может задержку надо сделать ?
madmasles
12-08-2011, 14:16
может задержку надо сделать ? »Попробуйте, мне проверить негде.
может задержку надо сделать ? »
Попробуйте, мне проверить негде. »
чет не получается .
может заменить нажатие ентер на клик мыши ?
madmasles
12-08-2011, 17:50
batyaPS,
Интересно, что покажет этот код при открытом окне.$hWin = WinGetHandle (http://www.autoitscript.com/autoit3/docs/functions/WinGetHandle.htm)('[Title:Ultr@VNC Авторизация;Class:#32770]')
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) $hWin Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then)
MsgBox (http://www.autoitscript.com/autoit3/docs/functions/MsgBox.htm)(64, 'Info', ControlGetHandle (http://www.autoitscript.com/autoit3/docs/functions/ControlGetHandle.htm)($hWin, '', '[Class:Button;Instance:1]'))
Else (http://www.autoitscript.com/autoit3/docs/keywords.htm#Else)
MsgBox (http://www.autoitscript.com/autoit3/docs/functions/MsgBox.htm)(16, 'Error', 'Нет окна')
EndIf (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndIf)
El Sanchez
12-08-2011, 21:25
Интересно, что покажет этот код при открытом окне. »
madmasles, дескриптор определяет. Проблема в другом, а именно в ControlGetText - возвращает пустую строку, до кнопки дело не доходит, т.к. после условия _AvtorPass()/_AvtorLogPass() вернут эррор. А так оба варианта нажатия отрабатывают.
madmasles
12-08-2011, 22:23
ControlGetText - возвращает пустую строку »
А если так попробовать:#NoTrayIcon (http://www.autoitscript.com/autoit3/docs/keywords.htm##notrayicon)
#include (http://www.autoitscript.com/autoit3/docs/keywords.htm##include) <WinAPIEx.au3>;Yashied, http://autoit-script.ru/index.php/topic,47.0.html
Opt (http://www.autoitscript.com/autoit3/docs/functions/Opt.htm)('MustDeclareVars', 1)
Opt (http://www.autoitscript.com/autoit3/docs/functions/Opt.htm)('TrayMenuMode', 1)
Global (http://www.autoitscript.com/autoit3/docs/keywords.htm#Global) $sTitleScript = @ScriptName (http://www.autoitscript.com/autoit3/docs/macros.htm#@scriptname) & '{[/@$@\]}', $sTitleLogPass = '[Title:Ultr@VNC Авторизация;Class:#32770]', _
$sTitlePass = '[Title:VNC Авторизация;Class:#32770]', $fLogPass, $fPass, $nExitItem, $msg
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) WinExists (http://www.autoitscript.com/autoit3/docs/functions/WinExists.htm)($sTitleScript) Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then) Exit (http://www.autoitscript.com/autoit3/docs/keywords.htm#Exit)
AutoItWinSetTitle (http://www.autoitscript.com/autoit3/docs/functions/AutoItWinSetTitle.htm)($sTitleScript)
HotKeySet (http://www.autoitscript.com/autoit3/docs/functions/HotKeySet.htm)('{Esc}', '_Exit')
$nExitItem = TrayCreateItem (http://www.autoitscript.com/autoit3/docs/functions/TrayCreateItem.htm)('Выход')
TraySetState (http://www.autoitscript.com/autoit3/docs/functions/TraySetState.htm)()
TraySetToolTip (http://www.autoitscript.com/autoit3/docs/functions/TraySetToolTip.htm)('<VNC Авторизация>' & @LF (http://www.autoitscript.com/autoit3/docs/macros.htm#@lf) & 'Выход - нажать кнопку "Esc"')
_WinAPI_EmptyWorkingSet()
While (http://www.autoitscript.com/autoit3/docs/keywords.htm#While) 1
$msg = TrayGetMsg (http://www.autoitscript.com/autoit3/docs/functions/TrayGetMsg.htm)()
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) WinExists (http://www.autoitscript.com/autoit3/docs/functions/WinExists.htm)($sTitleLogPass) Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then)
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) Not (http://www.autoitscript.com/autoit3/docs/keywords.htm#Not) $fLogPass Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then)
_AvtorLogPass()
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) Not (http://www.autoitscript.com/autoit3/docs/keywords.htm#Not) @error (http://www.autoitscript.com/autoit3/docs/macros.htm#@error) Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then) $fLogPass = True (http://www.autoitscript.com/autoit3/docs/keywords.htm#True)
EndIf (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndIf)
Else (http://www.autoitscript.com/autoit3/docs/keywords.htm#Else)
$fLogPass = False (http://www.autoitscript.com/autoit3/docs/keywords.htm#False)
EndIf (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndIf)
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) WinExists (http://www.autoitscript.com/autoit3/docs/functions/WinExists.htm)($sTitlePass) Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then)
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) Not (http://www.autoitscript.com/autoit3/docs/keywords.htm#Not) $fPass Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then)
_AvtorPass()
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) Not (http://www.autoitscript.com/autoit3/docs/keywords.htm#Not) @error (http://www.autoitscript.com/autoit3/docs/macros.htm#@error) Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then) $fPass = True (http://www.autoitscript.com/autoit3/docs/keywords.htm#True)
EndIf (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndIf)
Else (http://www.autoitscript.com/autoit3/docs/keywords.htm#Else)
$fPass = False (http://www.autoitscript.com/autoit3/docs/keywords.htm#False)
EndIf (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndIf)
Switch (http://www.autoitscript.com/autoit3/docs/keywords.htm#Switch) $msg
Case (http://www.autoitscript.com/autoit3/docs/keywords.htm#Case) 0
ContinueLoop (http://www.autoitscript.com/autoit3/docs/keywords.htm#ContinueLoop)
Case (http://www.autoitscript.com/autoit3/docs/keywords.htm#Case) $nExitItem
_Exit()
EndSwitch (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndSwitch)
WEnd (http://www.autoitscript.com/autoit3/docs/keywords.htm#WEnd)
Func (http://www.autoitscript.com/autoit3/docs/keywords.htm#Func) _AvtorLogPass()
Local (http://www.autoitscript.com/autoit3/docs/keywords.htm#Local) $h_Win, $n_Log = '[Class:Edit;Instance:1]', $n_Pass = '[Class:Edit;Instance:2]', _
$n_Button = '[Class:Button;Instance:1]', $s_Log = 'TestUser', $s_Pass = 'TestPass';свои данные поставьте
$h_Win = WinGetHandle (http://www.autoitscript.com/autoit3/docs/functions/WinGetHandle.htm)($sTitleLogPass)
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) Not (http://www.autoitscript.com/autoit3/docs/keywords.htm#Not) $h_Win Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then) Return (http://www.autoitscript.com/autoit3/docs/keywords.htm#Return) SetError (http://www.autoitscript.com/autoit3/docs/functions/SetError.htm)(1)
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) Not (http://www.autoitscript.com/autoit3/docs/keywords.htm#Not) ControlSetText (http://www.autoitscript.com/autoit3/docs/functions/ControlSetText.htm)($h_Win, '', $n_Log, $s_Log) Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then) Return (http://www.autoitscript.com/autoit3/docs/keywords.htm#Return) SetError (http://www.autoitscript.com/autoit3/docs/functions/SetError.htm)(1)
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) Not (http://www.autoitscript.com/autoit3/docs/keywords.htm#Not) ControlSetText (http://www.autoitscript.com/autoit3/docs/functions/ControlSetText.htm)($h_Win, '', $n_Pass, $s_Pass) Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then) Return (http://www.autoitscript.com/autoit3/docs/keywords.htm#Return) SetError (http://www.autoitscript.com/autoit3/docs/functions/SetError.htm)(1)
ControlClick (http://www.autoitscript.com/autoit3/docs/functions/ControlClick.htm)($h_Win, '', $n_Button)
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) WinExists (http://www.autoitscript.com/autoit3/docs/functions/WinExists.htm)($h_Win) Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then) Return (http://www.autoitscript.com/autoit3/docs/keywords.htm#Return) SetError (http://www.autoitscript.com/autoit3/docs/functions/SetError.htm)(1)
Return (http://www.autoitscript.com/autoit3/docs/keywords.htm#Return) SetError (http://www.autoitscript.com/autoit3/docs/functions/SetError.htm)(0)
EndFunc (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndFunc) ;==>_AvtorLogPass
Func (http://www.autoitscript.com/autoit3/docs/keywords.htm#Func) _AvtorPass()
Local (http://www.autoitscript.com/autoit3/docs/keywords.htm#Local) $h_Win, $n_Pass = '[Class:Edit;Instance:1]', $n_Button = '[Class:Button;Instance:1]', _
$s_Pass = 'TestPass';свои данные поставьте
$h_Win = WinGetHandle (http://www.autoitscript.com/autoit3/docs/functions/WinGetHandle.htm)($sTitlePass)
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) Not (http://www.autoitscript.com/autoit3/docs/keywords.htm#Not) $h_Win Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then) Return (http://www.autoitscript.com/autoit3/docs/keywords.htm#Return) SetError (http://www.autoitscript.com/autoit3/docs/functions/SetError.htm)(1)
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) Not (http://www.autoitscript.com/autoit3/docs/keywords.htm#Not) ControlSetText (http://www.autoitscript.com/autoit3/docs/functions/ControlSetText.htm)($h_Win, '', $n_Pass, $s_Pass) Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then) Return (http://www.autoitscript.com/autoit3/docs/keywords.htm#Return) SetError (http://www.autoitscript.com/autoit3/docs/functions/SetError.htm)(1)
ControlClick (http://www.autoitscript.com/autoit3/docs/functions/ControlClick.htm)($h_Win, '', $n_Button)
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) WinExists (http://www.autoitscript.com/autoit3/docs/functions/WinExists.htm)($h_Win) Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then) Return (http://www.autoitscript.com/autoit3/docs/keywords.htm#Return) SetError (http://www.autoitscript.com/autoit3/docs/functions/SetError.htm)(1)
Return (http://www.autoitscript.com/autoit3/docs/keywords.htm#Return) SetError (http://www.autoitscript.com/autoit3/docs/functions/SetError.htm)(0)
EndFunc (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndFunc) ;==>_AvtorPass
Func (http://www.autoitscript.com/autoit3/docs/keywords.htm#Func) _Exit()
Exit (http://www.autoitscript.com/autoit3/docs/keywords.htm#Exit)
EndFunc (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndFunc) ;==>_Exit
El Sanchez
13-08-2011, 11:53
madmasles, спасибо, работает. Мне этот код тоже пригодится.
madmasles, большое спасибо. всё работает.
маленькая хотелка - можно ли что бы логин и пароли брал из инишника лежащего рядом с exe?
© OSzone.net 2001-2012
vBulletin v3.6.4, Copyright ©2000-2025, Jelsoft Enterprises Ltd.