Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB.NET / March 2008

Tip: Looking for answers? Try searching our database.

Sending POST form with WebBrowser

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sweetiecakes - 06 Mar 2008 20:24 GMT
After a brief Google session, I can only find the following:

1. Instructions for pre-.NET VB
2. Other IE controls

I need to send a POST form with the web browser control: I need to do it
with it, because I need "silent authentication" to the website with IE.
How would I do this?
Aaron Smith - 06 Mar 2008 20:59 GMT
> After a brief Google session, I can only find the following:
>
[quoted text clipped - 4 lines]
> with it, because I need "silent authentication" to the website with IE.
> How would I do this?

I did this recently, but kind of "hackish" and I'm not sure this was even
the right way. After digging and not finding anything either, I found out
that you can navigate all the elements of the page on the page load event.
So I found all the fields I needed to fill in, then found the submit button
and invoked that click event for that button. It's been working for about a
year without any issues so far.
Trammel - 07 Mar 2008 01:00 GMT
>> After a brief Google session, I can only find the following:
>>
[quoted text clipped - 11 lines]
> button and invoked that click event for that button. It's been working for
> about a year without any issues so far.

Untested idea:  Cant you just connect to the webserver using sockets/stream,
send the login info then write the returned cookie to the IE folder &
startup/refresh IE?

The string- to send to the webserver would be like:
strPostLogin "POST /login.php HTTP/1.1" & vbcrlf & "Host: yoursite.com" &
vbcrlf & "Content-Type: application/x-www-form-urlencoded" & vbcrlf &
"Content-Length: 42" & vbcrlf & "user=onlyme&pass=youdontwannadoitlikethat!"
& vbcrlf & vcrlf
Aaron Smith - 07 Mar 2008 13:24 GMT
>>> After a brief Google session, I can only find the following:
>>>
[quoted text clipped - 21 lines]
> "Content-Length: 42" & vbcrlf &
> "user=onlyme&pass=youdontwannadoitlikethat!" & vbcrlf & vcrlf

That might be very possible. I didn't even think of doing that when I did
what I had to do. It's worth exploring further.
Tom Shelton - 07 Mar 2008 15:09 GMT
>>>> After a brief Google session, I can only find the following:
>>>>
[quoted text clipped - 24 lines]
> That might be very possible. I didn't even think of doing that when I did
> what I had to do. It's worth exploring further.

Have you looked at System.Net.WebClient?

Tom Shelton
kimiraikkonen - 07 Mar 2008 16:30 GMT
> After a brief Google session, I can only find the following:
>
[quoted text clipped - 4 lines]
> with it, because I need "silent authentication" to the website with IE.
> How would I do this?

These may help:
http://support.microsoft.com/kb/311294
http://www.codeproject.com/KB/cs/multipart_request_C_.aspx

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.