|
-
Feb 10th, 2012, 02:29 AM
#1
Thread Starter
Junior Member
Connecting to a website
I'm looking to have a program connect to a specific website, enter data, and then return something but without using the WebBrowser.
For instance, I want it to:
Connect to a website
Login to the website
Return if it logged me in or some error
etc
I'm kindof new to VB so I'm not sure how to go about this so any help would be appreciated, thank you. 
Edit: I read up a little bit about using WebClient and I understand a small bit of it but not much
Last edited by Sai-B0t; Feb 10th, 2012 at 02:42 AM.
-
Feb 10th, 2012, 03:52 AM
#2
Re: Connecting to a website
The WebClient is the simplest option. It has methods to download data in three ways: as binary data (Byte array), as text (String) or to a file. It also has corresponding methods to upload data in the same three ways. There's a fourth upload method for values, which basically corresponds to form fields in a web page. It sounds like that is they the way to go for you so that's what you should research first.
If you need more fine-grained control than the WebClient offers then you can use an HttpWebRequest and HttpWebResponse. You can also use the two in conjunction via the GetWebRequest and GetWebResponse methods of the WebClient.
-
Feb 10th, 2012, 03:58 AM
#3
Thread Starter
Junior Member
Re: Connecting to a website
Yeah, thank you that is what i'm looking for, but all of the information i've found while researching was on that topic, but unrelated of what i'm trying to do and I have no idea of how to do it.
-
Feb 10th, 2012, 05:03 AM
#4
Re: Connecting to a website
If you want to perform multiple actions within a session then you will need to look at the HttpWebRequest and HttpWebResponse classes, which are able to use the same cookies for multiple transactions. That way, when you login and get an authentication cookie, you can use that cookie with subsequent requests. Look for examples that use the HttpWebRequest.CookieContainer property and the HttpWebResponse.Cookies property.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|