Hallo,
habe meinen Code etwas umgeschrieben.
Im Prinzip geht es wobei ich noch Probleme habe.
Ich sende das ganze von einem Barcode Scanner und der ist ab und zu schneller als mein Input Feld aufgerufen ist. Habe schon gelesen und auch schon ein Zwischenspeicher Programm gefunden, allerdings habe ich es nicht ganz verstanden. Somit auch nicht in meinen Code Integriert.
Ich kann zwar jetzt prüfen ob das Fenster geschlossen ist allerdings nicht parallel ob ich ausgeloggt bin.
Hierzu hier der HTML Code der Logout Seite.
Spoiler anzeigen
HTML
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<meta http-equiv='cache-control' content='no-cache' /><meta http-equiv='pragma' content='no-cache' />
<meta http-equiv='expires' content='0'/><meta http-equiv='expires' content='Di, 13 12 2011 15:14:50 GMT' />
<meta name = "viewport" content = "initial-scale=1.0,target-densitydpi=160">
<title>Zeit</title>
<style type="text/css">
textarea {
-webkit-border-radius: 1px;
font: -webkit-control;
}
input, keygen, select, button, isindex {
-webkit-border-radius: 1px;
font: -webkit-control;
white-space: nowrap;
}
input:focus, textarea:focus, isindex:focus, keygen:focus, select:focus {
outline: none;
}
input, textarea, keygen, select, button, isindex {
margin: 0__qem;
font-family: Microsoft Sans Serif;
letter-spacing: normal;
word-spacing: normal;
line-height: normal;
text-transform: none;
text-indent: 0;
text-shadow: none;
display: inline-block;
text-align: -webkit-auto;
}
body { font-family:Microsoft Sans Serif;
font-size:14px;
color:#000000;
background-color:#FCFCF2; }
html, body {
margin: 0;
padding: 0;
height: 98%; /* WICHTIG!!! STRECKT ANZEIGENBEREICH AUF 100% */
}
#wrapper {
width: 100%;
min-height: 100%; /* Mindesthoehe for moderne Browser */
height:auto; /* Important Regel for moderne Browser */
height:100%; /* Mindesthoehe for den IE */
overflow: hidden; /* FF Scroll-leiste */
}
</style>
<script type="text/javascript">
var fns=null;
var mob=false;
var tablet=false;
var wd=screen.width-5;
var navim=navigator.appName;
if(navim.indexOf("xplorer")>0) wd=screen.width-10;
var userA=navigator.userAgent;
if(userA.indexOf("iPad")>-1 ||(userA.indexOf("Mobile")<0 && userA.indexOf("Android")>-1 )) tablet=true;
else if((userA.indexOf("Mobile")>-1 && userA.indexOf("Android")>-1)|| userA.indexOf("iPhone")>-1 ) mob=true;
var ht=screen.height-80;
function fClose(){
if(fns&&!fns.closed) { fns.close(); fns=null;}
}
function fnsClose(){
window.scrollTo(0,1);
if(navigator.userAgent.indexOf("Mobile")<0 && navigator.userAgent.indexOf("Android")<0){
try{
if(top.opener!=null && top.opener.fns!=null){
window.close();
top.opener.focus();
}
} catch(e){}
}
}
function getWinInfo(win)
{
if(!win) win = window;
var s = new Object();
//var windowWidth, windowHeight;
if (win.innerHeight) { // all except Explorer
s.windowWidth = win.innerWidth;
s.windowHeight = win.innerHeight;
if(document.body && document.body.clientHeight){s.windowHeight = document.body.clientHeight; }
if(document.body && document.body.clientWidth) {s.windowWidth = document.body.clientWidth; }
s.xPos = win.screenX;
s.yPos = win.screenY;
} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
s.windowWidth = document.documentElement.clientWidth;
s.windowHeight = document.documentElement.clientHeight;
s.xPos = window.screenLeft;
s.yPos = window.screenTop;
} else if (document.body) { // other Explorers
s.windowWidth = document.body.clientWidth;
s.windowHeight = document.body.clientHeight;
s.xPos = window.screenLeft;
s.yPos = window.screenTop;
if(window.screenX) s.xPos=window.screenX;
if(window.screenY) s.yPos=window.screenY;
}
s.screenWidth=screen.width;
s.screenHeight=screen.height;
s.outerHeight=window.outerHeight;
s.outerWidth=window.outerWidth;
return s;
}
function initSmartphone(){
/*if(mob){
var ref='ScreenWidth='+screen.width+'&ScreenHeight='+screen.height+'&Smartphone=1';
if(userA.indexOf("Android")>-1 && userA.indexOf("Mobile")>-1){ref+='&Android=1';}
else if(userA.indexOf("Apple")>-1) ref+='&Apple=1';
ref='./twwebclient?'+ref;
if(document.getElementById('divDiv')!=null)
document.getElementById('divDiv').style.display='inline';
document.location=ref;
}*/
}
function LdClient(noW){
var userA=navigator.userAgent;
var ref='ScreenWidth='+screen.width+'&ScreenHeight='+screen.height+"&navigator="+userA;
if(userA.indexOf("iPad")<0 &&(userA.indexOf("Mobile")>-1|| userA.indexOf("iPhone")>-1)) {
ref+='&mobile=1';
if(userA.indexOf("iPhone")>-1) ref+='&Smartphone=1';
else if(userA.indexOf("Android")>-1){ref+='&Android=1';ref+='&Smartphone=1';}
else if(userA.indexOf("Apple")>-1) ref+='&Apple=1';
else ref+='&Smartphone=1';
if(noW==0) ref='./twwebclient?'+ref;
else if(noW==1) ref='./twwebcontrolstandclient?'+ref;
else ref='./twwebcontrolstandconfig?'+ref;
document.location=ref;
}
else {
try{
fClose();
var temp= new Date();
var wName = "webclient";
wName = wName+(temp.getTime());
wd=screen.width;
ht=screen.height;
if(userA.indexOf("Android")>-1){ref+='&Android=1';}
else if(userA.indexOf("Apple")>-1) ref+='&Apple=1';
if(tablet||userA.indexOf("iPad")>-1||((userA.indexOf("Mobile")<0&& userA.indexOf("Android")>-1))){
ref+='&Tablet=1';
if(noW==0) ref='./zeitbclient?'+ref;
else if(noW==1) ref='./zeitcontrolstandclient?'+ref;
else if(noW==2) ref='./zeitcontrolstandconfig?'+ref;
else ref='./zeitcontrol?'+ref;
tablet=true;
document.location=ref;
}
else if(navim.indexOf("xplorer")>0){
if(noW==0) ref='./zeitclient?'+ref;
else if(noW==1) ref='./zeitcontrolstandclient?'+ref;
else if(noW==2) ref='./zeitcontrolstandconfig?'+ref;
else ref='./zeitcontrol?'+ref;
window.location.replace(ref);
}
else {
if(noW==0) ref='./zeitclient?'+ref;
else if(noW==1) ref='./zeitcontrolstandclient?'+ref;
else if(noW==2) ref='./zeitcontrolstandconfig?'+ref;
else ref='./zeitcontrol?'+ref;
if(top.opener && top.opener.document.getElementById("divDiv")!=null) window.location.replace(ref);
else if(window.menubar.visible||window.toolbar.visible)
{fns= window.open(ref, wName,'width='+wd+',height='+ht+',top=0,left=0,menu=false,status=yes,scrollbars=yes,resizable=yes');fns.focus();}
else window.location.replace(ref);
}
}
catch(e){}
}
}
function closeNachLogout(){
if(top.opener && top.opener.document.getElementById("divDiv")!=null){
top.opener.fClose();
}
}
//-->
</script>
<link rel="shortcut icon" href="./img/favicon.ico" type="image/x-icon"/></head>
<html>
<body onLoad="closeNachLogout();">
<table id="mt" style='text-align:center;vertical-align:middle;background-color:#FCFCF2;color:#000000;font-size:15px;border-spacing:0px;width:100%;height:100%;border:none'>
<tr ><td valign='middle' style='text-align:center;vertical-align:middle;height:100%'>
<table border='1' style='padding-left: 5px;padding-right: 5px;padding-top: 5px;padding-bottom: 5px;vertical-align:top;text-align:center;overflow:hidden;border-color:#C0C0C0;text-align:center;font-size:15px;border-spacing:1px;margin:auto;border-width:1px;border:1px;'>
<tr ><td style='vertical-align:middle;background-color:#FF0000;text-align:center;margin:auto' colspan='2'><img style='background-color:transparent;width:300px;' src='./img/zeit_logo.png' title=''></td></tr>
<tr>
<td colspan="2" style='text-align:center;vertical-align:middle;width:290px;height:145px;cursor:pointer;color:#003B8D;' onMouseOver="javascript:style.textDecoration='underline'" onMouseOut="javascript:style.textDecoration='none'" onClick="LdClient(0)"><img src="./img/aktivitaeten.png" style='width:100px' title="WebClient" /><br>WEB Client</td>
<!--
<td style='text-align:center;vertical-align:middle;width:145px;height:145px;cursor:pointer;color:#003B8D;' onMouseOver="javascript:style.textDecoration='underline'" onMouseOut="javascript:style.textDecoration='none'" onClick="LdClient(0)"><img src="./img/aktivitaeten.png" style='width:100px' title="WebClient" /><br>WEB Client</td>
<td style='text-align:center;vertical-align:middle;width:145px;height:145px;cursor:pointer;color:#003B8D;' onMouseOver="javascript:style.textDecoration='underline'" onMouseOut="javascript:style.textDecoration='none'" onClick="LdClient(3)"><img src="./img/zeiterfassung-TB.png" style='width:100px' title="WEB Client Konfiguration" /><br>WEB Client Konfiguration</td>
-->
</tr>
</table>
</td></tr>
</table>
<div id='divDiv' style='opacity:0.20;height:100%;top:0px;left:0px;filter:alpha(opacity=20);width:100%;position:absolute;display:none;background-color:#ffffff' onclick='return false'><div id='f1_container'><div id='f1_card'><div class='face_front' style='border-color:#FF0000;border:2px solid;opacity:0.20;margin:50px;top:35%;font-size:18px;left:35%;filter:alpha(opacity=20);position:absolute;background-color:#D3D3D3'><p style="margin:30px 40px; font-weight:bold; color:#ff0000;">Daten werden geladen�</p></div></div></div></div></body></html>
Alles anzeigen
Spoiler anzeigen
AutoIt
#include <EditConstants.au3>
#include <Array.au3>
#include <IE.au3>
#include <Crypt.au3>
;~ Opt('GUIOnEventMode', 1)
;~ Opt('TrayOnEventMode', 1)
;~ Opt('TrayMenuMode', 1)
;~ Opt('TrayIconHide', 1)
;~ GUICtrlSetOnEvent(-1,"_Exit")
HotKeySet ( "|" , "_Ablauf" )
HotKeySet ( "~" , "_exit" )
While sleep(25)
WEnd
Func _Ablauf()
_MSG()
_Entschluesseln()
_Tool()
EndFunc
Func _MSG()
Global $passwdtest = InputBox("Urlaub", "Login", "", "*",190,130)
sleep (500)
GLOBAL $pwb = StringSplit($passwdtest, "%")
EndFunc
Func _Entschluesseln()
Global $1 = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
Local $hKey = _Crypt_DeriveKey($1, $CALG_AES_256)
$sOutput = _Crypt_DecryptData($pwb[2], $hKey, $CALG_USERKEY)
$Output =BinaryToString($sOutput)
RunAsWait ( 'tor', '123456', '123456', 0, @ComSpec & ' /c taskkill.exe /F /IM iexplore.exe', @WindowsDir ,@SW_HIDE )
sleep (1000)
$oIE = _IECreate("")
_IENavigate($oIE, "http://10.10.10.10:80/abcdef/123456")
_IELoadWait($oIE, 0, 30000)
$oForm = _IEFormGetCollection($oIE, 0)
$oUsername = _IEFormElementGetObjByname($oForm, "UID")
$oPassword = _IEFormElementGetObjByName($oForm, "PWD")
_IEFormElementSetValue($oUsername, $pwb[1])
_IEFormElementSetValue($oPassword, $Output)
_IEFormSubmit($oForm)
_Crypt_DestroyKey($hKey)
EndFunc
Func _Tool()
WinWaitClose ("xxxx Internet Explorer")
$oIEe1 = _IECreate ("http://10.10.10.10/rb")
EndFunc
Func _Exit()
Exit
EndFunc
Alles anzeigen
Danke schon mal für die Hilfe.
Steffen