wuups ![]()
Habs ausgebessert.
wuups ![]()
Habs ausgebessert.
Hi,
mein SchülerVz Client ist endlich fertig geworden. Ihr braucht wie immer die WinHTTP Includes ( Siehe Shoutbox Chat ).
Hab es aber auch als exe drin.
Ihr könnt damit bequem in den Buschfunk schreiben und bekommt alles in einer tollen Rich Edit angezeigt ![]()
Großes Dankeschön an Progandy der mir geholfen hat!
Client ist im Anhang.
Viel Spass damit
Gruss Greek
Edit: Habs neu hochgeladen, Fehler ausgebessert.
Edit2: GetNewestContent.exe ist wieder drin.
Zeilensprung gibts nicht, du musst dein Komplettes Script in eine Schleife setzen,
[autoit]Global $Wieoft=0
Do
;Dein Komplettes Script hier rein
$Wieoft+=1
Until $Wieoft=3
So?
[autoit]#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$MainGUI = GUICreate("", 400, 400, -1, -1)
GUISetBkColor(0xFFFFFF)
$Input = GUICtrlCreateInput("Bla und Blub",165,187,70,20,Default,$WS_EX_TOOLWINDOW)
GUISetState()
While 1
$msg = GUIGetMsg()
Switch $msg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Systemsteuerung -> Windows Firewall -> Ausnahmen, wenn du das Beispiel ausführst steht anschließend Outlook Express drin.
Edit: Oder haste jetzt die Ports gemeint? Die weis ich auch net wo die nachschaut, wahrscheinlich damit:
http://msdn.microsoft.com/en-us/library/aa366434(VS.85).aspx
Hier nochma für Programme
;~ ' Set constants
Const $NET_FW_PROFILE_DOMAIN = 0
Const $NET_FW_PROFILE_STANDARD = 1
;~ ' Scope
Const $NET_FW_SCOPE_ALL = 0
;~ ' IP Version <entity type="ndash"/> ANY is the only allowable setting for now
Const $NET_FW_IP_VERSION_ANY = 2
;~ ' Declare variables
Dim $errornum
;~ ' Create the firewall manager object.
Dim $fwMgr
$fwMgr = ObjCreate("HNetCfg.FwMgr")
;~ ' Get the current profile for the local firewall policy.
Dim $profile
$profile = $fwMgr.LocalPolicy.CurrentProfile
Dim $app
$app = ObjCreate("HNetCfg.FwAuthorizedApplication")
$oMyError = ObjEvent("AutoIt.Error","MyErrFunc") ; Initialize a COM error handler
[/autoit] [autoit][/autoit] [autoit]$app.ProcessImageFileName = "%PROGRAMFILES%\Outlook Express\msimn.exe"
$app.Name = "Outlook Express"
$app.Scope = $NET_FW_SCOPE_ALL
;~ ' Use either Scope or RemoteAddresses, but not both
;~ 'app.RemoteAddresses = "*"
$app.IpVersion = $NET_FW_IP_VERSION_ANY
$app.Enabled = TRUE
;~ ' Use this line if you want to add the app, but disabled.
;~ 'app.Enabled = FALSE
;~ $errornum = 0
$profile.AuthorizedApplications.Add($app)
;~ $errornum = Err.Number
;~ if $errornum <> 0 then MsgBox(0,"","Adding authorized application failed with: " & $errornum)
; This is my custom defined error handler
Func MyErrFunc()
Msgbox(0,"COM-Error","We intercepted a COM Error !" & @CRLF & @CRLF & _
"err.description is: " & @TAB & $oMyError.description & @CRLF & _
"err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _
"err.number is: " & @TAB & hex($oMyError.number,8) & @CRLF & _
"err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _
"err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _
"err.source is: " & @TAB & $oMyError.source & @CRLF & _
"err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _
"err.helpcontext is: " & @TAB & $oMyError.helpcontext _
)
Local $err = $oMyError.number
If $err = 0 Then $err = -1
$g_eventerror = $err ; to check for after this function returns
Endfunc
Da sieht du es auch bei Ausnahmen das er es hinzugefügt hat.
SchülerVz Client für Buschfunk hab ich schon Programmiert, ist aber noch nirgends gepostet, fehlt noch "der letzte Schliff".
Werde es bestimmt bald posten, einfach mal warten ![]()
Gruss Greek
Hi,
hast du Mozilla Firefox installiert?
Wenn ja dann lad dir das Addon Live HTTP Headers runter, dort drückst auf mitschneiden ( automatisch an ) und betätigst dann den Button. Dann hast du das Packet in der Forum wie du es brauchst:
[autoit]#include <WinHTTP.au3>
[/autoit][autoit][/autoit][autoit][/autoit][autoit]$post="loginUsername="&$username&"&loginPassword="&$pw&"&url=%2Findex.php&useCookies=1" ; die post in deinem Paket hier rein
$hw_open = _WinHttpOpen("Einloggen")
$hw_connect = _WinHttpConnect($hw_open, "www.deineadresse.de")
$h_openRequest = _WinHttpOpenRequest($hw_connect,"POST", "/index.php?form=UserLogin","HTTP/1.1", "http://www.autoitbot.de/") ;/index.php?... da musst das aus dem Paket ausfüllen
_WinHttpSendRequest($h_openRequest, "Content-Type: application/x-www-form-urlencoded"& @CRLF, $post)
_WinHttpReceiveResponse($h_openRequest)
Local $data=""
Do
$data&=_WinHttpReadData($h_openRequest)
Until @error
FileWrite ("body.html", $data)
_WinHttpCloseHandle($h_openRequest)
_WinHttpCloseHandle($hw_connect)
_WinHttpCloseHandle($hw_open)
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GUIConstants.au3>
$hGUI = GUICreate("",600, 440,-1,-1,$WS_POPUP,$WS_EX_LAYERED) ; erzeugt ein GUI
guictrlcreatepic("simple1.bmp",20,20,100,100,Default,$WS_EX_TRANSPARENT) ;hier der testkandidat
GUICtrlSetState(-1,$GUI_DISABLE)
$pic = GUICtrlCreatePic("simple4.bmp",0,0,600,440);gui wird transparent bis auf das bild (custom gui desgin möglich)
GUICtrlSetState(-1,$GUI_DISABLE)
GUICtrlCreateLabel("Test",50,50,50,50,Default,$WS_EX_TRANSPARENT)
GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)
GUISetState (@SW_SHOW)
[/autoit][autoit][/autoit][autoit][/autoit][autoit]While 1
[/autoit][autoit][/autoit][autoit]If GUIGetMsg() = $GUI_EVENT_CLOSE Then ExitLoop
Wend
![]()
Edit:
Ah hast es ja schon Editiert ^^, sieht doch ganz normal aus?
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GUIConstants.au3>
$hGUI = GUICreate("",600, 440,-1,-1,$WS_POPUP,$WS_EX_LAYERED) ; erzeugt ein GUI
guictrlcreatepic("simple1.bmp",20,20,100,100,Default,$WS_EX_TRANSPARENT) ;hier der testkandidat
GUICtrlSetState(-1,$GUI_DISABLE)
$pic = GUICtrlCreatePic("simple4.bmp",0,0,600,440);gui wird transparent bis auf das bild (custom gui desgin möglich)
GUICtrlSetState(-1,$GUI_DISABLE)
GUISetState (@SW_SHOW)
[/autoit][autoit][/autoit][autoit][/autoit][autoit]While 1
[/autoit][autoit][/autoit][autoit]If GUIGetMsg() = $GUI_EVENT_CLOSE Then ExitLoop
Wend
Mit IE so:
[autoit]#include <IE.au3>
[/autoit][autoit][/autoit][autoit]MsgBox( 0, "Ausgelesener Wert", "Wert: "&_GetCountdownValue())
[/autoit][autoit][/autoit][autoit]Func _GetCountdownValue()
$oIE = _IECreate ( "http://www.jjam.de/JavaScript/Datum_Uhrzeit/Countdown.html",0,0)
$oForm = _IEFormGetObjByName ( $oIE, "countdownform" )
$oText = _IEFormElementGetObjByName ( $oForm, "countdowninput" )
[/autoit][autoit][/autoit][autoit]$JavaDatum = _IEFormElementGetValue($oText)
[/autoit][autoit][/autoit][autoit]_IEQuit($oIE)
[/autoit][autoit][/autoit][autoit]Return $JavaDatum
EndFunc
Gruss Greek
Scite ist immer bei AutoIt dabei, aber nur die Lite Version, musst dir noch das richtige laden.
[Blockierte Grafik: http://img9.imageshack.us/img9/7931/unbenanntck.jpg]
Edit: Mist, jetzt hab ich extra ein Bild gemacht^^
Du musst angeben was du auch includen willst, jeh mehr du includes desto größer wird dann Script, es kennt so umso mehr Constanten und Funktionen ( die in der #Include stehen und du benötigst )
Für ein GUI brauchst du später meistens diese Includes:
[autoit]#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Damit kennt es schon $GUI_EVENT_CLOSE ( und vieles mehr natürlich ), was heißt das du auf das X zum schließen gedrückt hast, Beispiel:
[autoit]#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$MainGUI = GUICreate("",400,300,-1,-1) ; -1 bedeutet zentrierte ausrichtung
GUISetState()
While 1
$msg = GUIGetMsg()
Switch $msg
Case $GUI_EVENT_CLOSE ; auf X zum schließen gedrückt
Exit
EndSwitch
WEnd
Mit einem Array geht das:
[autoit]#include <Array.au3>
[/autoit][autoit][/autoit][autoit]Dim $aMax[6] = [25,30,45,12.5,50.8,20]
[/autoit][autoit][/autoit][autoit]MsgBox(0,"",_ArrayMax($aMax))
[/autoit]Jup steht nur leider so nicht in der Hilfe, hab dennen mal geschrieben
Edit:
Hab Bug Report gemacht, ist in 3.3.3.0 gefixed ![]()
Vielen Dank für die ganzen Antworten!
mit
HttpSetUserAgent
hat es tatsächlich geklappt!
Und ich dachte immer, das mit neuen AutoIt Versionen nur Vorteile und keine Nachteile gibt....
Nochmals Vielen Dank!
Ah sehr gut ![]()
Die haben es in die Hilfe nur für InetGet geschrieben, habs dennen mal gepostet ![]()
Hab 3.3.0.0 noch auf meinem Netbook drauf, da war es noch open source:
Func _INetGetSource($s_URL, $s_Header = '')
If StringLeft($s_URL, 7) <> 'http://' And StringLeft($s_URL,
<> 'https://' Then $s_URL = 'http://' & $s_URL
Local $h_DLL = DllOpen("wininet.dll")
Local $ai_IRF, $s_Buf = ''
Local $ai_IO = DllCall($h_DLL, 'int', 'InternetOpen', 'str', "AutoIt v3", 'int', 0, 'int', 0, 'int', 0, 'int', 0)
If @error Or $ai_IO[0] = 0 Then
DllClose($h_DLL)
SetError(1)
Return ""
EndIf
Local $ai_IOU = DllCall($h_DLL, 'int', 'InternetOpenUrl', 'int', $ai_IO[0], 'str', $s_URL, 'str', $s_Header, 'int', StringLen($s_Header), 'int', 0x80000000, 'int', 0)
If @error Or $ai_IOU[0] = 0 Then
DllCall($h_DLL, 'int', 'InternetCloseHandle', 'int', $ai_IO[0])
DllClose($h_DLL)
SetError(1)
Return ""
EndIf
Local $v_Struct = DllStructCreate('udword')
DllStructSetData($v_Struct, 1, 1)
While DllStructGetData($v_Struct, 1) <> 0
$ai_IRF = DllCall($h_DLL, 'int', 'InternetReadFile', 'int', $ai_IOU[0], 'str', '', 'int', 256, 'ptr', DllStructGetPtr($v_Struct))
$s_Buf &= StringLeft($ai_IRF[2], DllStructGetData($v_Struct, 1))
WEnd
DllCall($h_DLL, 'int', 'InternetCloseHandle', 'int', $ai_IOU[0])
DllCall($h_DLL, 'int', 'InternetCloseHandle', 'int', $ai_IO[0])
DllClose($h_DLL)
Return $s_Buf
EndFunc ;==>_INetGetSource
AutoIt v3 ist der Agent, einfach ändern.
Edit: Scheint aber trotzdem nicht mit 3.3.2.0 zu gehen.