Sign in to follow this  
Followers 0
fielmann

Communicate with a webserver

8 posts in this topic

#1 ·  Posted (edited)

What I need is to communicate with a webserver:

1) start communication

2) enter username

3) enter password

4) check that login was correct

Thats all. :party:

Can I make that without (embeded) IE? :)

I think I could realize that with TCP commands? :)

Edited by fielmann

Share this post


Link to post
Share on other sites



i suggest using _IE*


[quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys

Share this post


Link to post
Share on other sites

i suggest using _IE*

I need a plain and basis method.

Is it possible without _IE ?

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I need a plain and basis method.

Is it possible without _IE ?

But, it's just so simple with _IE:

Func goCheckID()
    ProgressOn("Checking credentials", "Checking credentials...")
    ProgressSet("5", "Connecting to server...")
    $ocheckID = _IECreate("http://KB.mysite.com/login.aspx", 0, 0, 1, 1)

    ;- grab a collection of form details
    $oFormID = _IEFormGetCollection($ocheckID, 0)

    ;- grab the login box
    $oQueryID = _IEFormElementGetCollection ($oFormID, 1)

    ;- set the value of login box
    _IEFormElementSetValue ($oQueryID, $username)

    ;- grab the password box
    $oQueryID = _IEFormElementGetCollection ($oFormID, 2)

    ;- set the value of the password box
    _IEFormElementSetValue ($oQueryID, $password)

    ;- grab the login button
    $loginID = _IEGetObjByName($ocheckID, "ucUserLogin:_ctl3")

    ;- click the login button
    ProgressSet("10", "Logging in....")
    _IEAction($loginID, "click")
    _IELoadWait($ocheckID)

        ;- evaluate the source
    $sHTMLid = _IEDocReadHTML($ocheckID)
    if StringInStr($sHTMLid, "Username and password not found!", 0) Then
        _IEQuit($ocheckID)
        progressoff()
        MsgBox(0, "error", "invalid username/password")
        call("goGetID")
    Else
        ProgressOff()
        _IEQuit($ocheckID)
    EndIf
    
EndFunc
Edited by zackrspv

-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Share this post


Link to post
Share on other sites

But, it's just so simple with _IE:

Func goCheckID()
    ProgressOn("Checking credentials", "Checking credentials...")
    ProgressSet("5", "Connecting to server...")
    $ocheckID = _IECreate("http://KB.mysite.com/login.aspx", 0, 0, 1, 1)

    ;- grab a collection of form details
    $oFormID = _IEFormGetCollection($ocheckID, 0)

    ;- grab the login box
    $oQueryID = _IEFormElementGetCollection ($oFormID, 1)

    ;- set the value of login box
    _IEFormElementSetValue ($oQueryID, $username)

    ;- grab the password box
    $oQueryID = _IEFormElementGetCollection ($oFormID, 2)

    ;- set the value of the password box
    _IEFormElementSetValue ($oQueryID, $password)

    ;- grab the login button
    $loginID = _IEGetObjByName($ocheckID, "ucUserLogin:_ctl3")

    ;- click the login button
    ProgressSet("10", "Logging in....")
    _IEAction($loginID, "click")
    _IELoadWait($ocheckID)

        ;- evaluate the source
    $sHTMLid = _IEDocReadHTML($ocheckID)
    if StringInStr($sHTMLid, "Username and password not found!", 0) Then
        _IEQuit($ocheckID)
        progressoff()
        MsgBox(0, "error", "invalid username/password")
        call("goGetID")
    Else
        ProgressOff()
        _IEQuit($ocheckID)
    EndIf
    
EndFunc
hello?

anybody @ home? :)

I don't want to use it :)

Share this post


Link to post
Share on other sites

hello?

anybody @ home? :)

I don't want to use it :)

Well,

That really wasn't my point. But it's okay if you don't understand that. My point was: It's simple, it's clean, and it's pretty darned quick. Why would you not want to use what's already there.

Sure, you can write one using TCP functions, but that would take forever.

You want to connect to a webserver, so in reality, you need some sort of 'browser' which can understand webserver messages; ie _IE functions. Just seems simple to me lol


-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Share this post


Link to post
Share on other sites

Well,

That really wasn't my point. But it's okay if you don't understand that. My point was: It's simple, it's clean, and it's pretty darned quick. Why would you not want to use what's already there.

Sure, you can write one using TCP functions, but that would take forever.

You want to connect to a webserver, so in reality, you need some sort of 'browser' which can understand webserver messages; ie _IE functions. Just seems simple to me lol

I need a fast solution!

Direct TCP functions are faster than slow IE functions.

Any idea how to realize 1st TCP communication?

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

I need a fast solution!

Direct TCP functions are faster than slow IE functions.

Any idea how to realize 1st TCP communication?

Best thing i can tell you; aside from programming everything like you want directly in TCP will be a long drawn out process, is to take a look at this post:

http://www.autoitscript.com/forum/index.php?showtopic=20589

Edited by zackrspv

-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0