PDA

View Full Version : HTTP.TestConnection Question


nrgyzer
08-11-2005, 09:51 AM
Hello,
I want build a app which repeat HTTP.TestConnection until the connection is true. Thx for help.

Sorry for bad english.

Worm
08-11-2005, 10:22 AM
use the page timer, put your test connection code in the On Timer event. Stop the timer when it returns true.

nrgyzer
08-11-2005, 10:27 AM
Ok, Thx, I'll try it and an other question is, how can I enter the AuthData by HTTP.Download or how must I enter this data?

TJ_Tigger
08-11-2005, 11:46 AM
AuthData is a table. You can define the table with your parameters and then use it in the HTTP.Download action

AuthData
(table) A table containing basic HTTP authentication information that can be used to gain access to the file. (This parameter is optional. If the download does not require HTTP authentication, just leave this parameter blank.) The table is indexed by the following keys:

KEY TYPE DESCRIPTION
UserName - string - The user name to be used during HTTP authentication.
Password - string - The password to be used during HTTP authentication.



tAuthData = {UserName = "Harry", Password = "Potter"};
HTTP.Download("http://www.hogwarts.com/downloads/potionsbook.zip", _TempFolder.."\\potionsbook.zip", MODE_BINARY, 20, 80, tAuthData, nil, nil);

--or you can define it in the string
HTTP.Download("http://www.hogwarts.com/downloads/potionsbook.zip", _TempFolder.."\\potionsbook.zip", MODE_BINARY, 20, 80, {UserName = "Harry", Password = "Potter"}, nil, nil);


Same difference

Tigg

nrgyzer
08-11-2005, 02:22 PM
OK, great THX TJ_Tigger

pooriapanahi
03-11-2006, 04:20 PM
hi worm,
would u pls give me an example for this :
use the page timer, put your test connection code in the On Timer event. Stop the timer when it returns true.

thanks :)

TJS
03-20-2006, 12:49 PM
hi worm,
would u pls give me an example for this :


thanks :)


On the page in your project where you want to test the connection:

On Show Event

if not HTTP.GetConnectionState().Connected then
Page.StartTimer(1000);
end

On Timer Event

if HTTP.GetConnectionState().Connected then
Page.StopTimer();
end

TJS
03-20-2006, 01:21 PM
I just gave you an AMS6 answer to you AMS5 question. My apologies if my reply is not relevant.