By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,456 Members | 1,303 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,456 IT Pros & Developers. It's quick & easy.

How to logon and post this to a web form

P: n/a
Hi,
I am trying to use my vb.net app as a replacement to a normal browser
to interface with a website.
I am trying to achieve 2 things:
1) logon to the website
2) complete forms and submit data to the website (would I need to store
cookies once I have logged on?)

I've looked at various webrequest, POST resources without any luck. The
logic behind what I need to do seems straightforward, but I'm finding
this really hard applying it to code.

The post data details are as follows:
1) for logon:
Mime type : application/x-www-form-urlencoded
languageSelector : en%2CGBR
username : xxxxx
password : xxxxxxx
LoginBTN :Login

Request Header Name Request Header Value
POST /account/login/LoginAction.do HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/x-shockwave-flash, application/vnd.ms-excel,
application/vnd.ms-powerpoint, application/msword, */*
Referer: http://www.betfair.com/Header.do
Accept-Language: en-gb
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;
..NET CLR 1.1.4322)
Host: www.betfair.com
Content-Length: 93
Connection: Keep-Alive
Cache-Control: no-cache
Cookie:

2) for sending form info:
Mime Type : application/x-www-form-urlencoded
BetIDs :
origin : placeBets
SelectionIDs :5861|5862|
BidTypes :B|B|
Odds :1000|1000|
NewOdds :
Stakes :2|2|
NewStakes :
Modes :
SubEventIds :
BetType :O
ei :3337261
iid :GreyHound
fa :pb
iCard :
placeBets_oddsLayProfitLiability : Liability

Request Header Name Request Header Value
POST /betting/BetsManipulationAction.do HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/x-shockwave-flash, application/vnd.ms-excel,
application/vnd.ms-powerpoint, application/msword, */*
Referer:
http://www.betfair.com/betting/Marke...570&origin=NHR
Accept-Language: en-gb
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;
..NET CLR 1.1.4322)
Host: www.betfair.com
Content-Length: 237
Connection: Keep-Alive
Cache-Control: no-cache
Cookie:

I believe this is all the information I need to be able to do this, but
as I said, knowing where to start is a nightmare :-)

Any help, in particular code examples would be hugely appreciated.

Many thanks,

Mike

Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
system.web
you need that..
then you need to make a http object
i think it is
system.web.httpcontext.
you should not need to set anything as far as vars. You should make a post
just like you would in web page
I have code that ports any web page and displays it on my own. If you want
that email me
cc*********@hotmail.com
subject..Code
<my***@pearcey2001.freeserve.co.uk> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Hi,
I am trying to use my vb.net app as a replacement to a normal browser
to interface with a website.
I am trying to achieve 2 things:
1) logon to the website
2) complete forms and submit data to the website (would I need to store
cookies once I have logged on?)

I've looked at various webrequest, POST resources without any luck. The
logic behind what I need to do seems straightforward, but I'm finding
this really hard applying it to code.

The post data details are as follows:
1) for logon:
Mime type : application/x-www-form-urlencoded
languageSelector : en%2CGBR
username : xxxxx
password : xxxxxxx
LoginBTN :Login

Request Header Name Request Header Value
POST /account/login/LoginAction.do HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/x-shockwave-flash, application/vnd.ms-excel,
application/vnd.ms-powerpoint, application/msword, */*
Referer: http://www.betfair.com/Header.do
Accept-Language: en-gb
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;
.NET CLR 1.1.4322)
Host: www.betfair.com
Content-Length: 93
Connection: Keep-Alive
Cache-Control: no-cache
Cookie:

2) for sending form info:
Mime Type : application/x-www-form-urlencoded
BetIDs :
origin : placeBets
SelectionIDs :5861|5862|
BidTypes :B|B|
Odds :1000|1000|
NewOdds :
Stakes :2|2|
NewStakes :
Modes :
SubEventIds :
BetType :O
ei :3337261
iid :GreyHound
fa :pb
iCard :
placeBets_oddsLayProfitLiability : Liability

Request Header Name Request Header Value
POST /betting/BetsManipulationAction.do HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/x-shockwave-flash, application/vnd.ms-excel,
application/vnd.ms-powerpoint, application/msword, */*
Referer:
http://www.betfair.com/betting/Marke...570&origin=NHR
Accept-Language: en-gb
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;
.NET CLR 1.1.4322)
Host: www.betfair.com
Content-Length: 237
Connection: Keep-Alive
Cache-Control: no-cache
Cookie:

I believe this is all the information I need to be able to do this, but
as I said, knowing where to start is a nightmare :-)

Any help, in particular code examples would be hugely appreciated.

Many thanks,

Mike

Nov 21 '05 #2

P: n/a
Thanks Chris,

I would be very grateful for the code - I've sent you an email.

Does anyone else have any suggestions please?

Thanks,

Mike.

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.