Jump to content
  • Advertisement
Sign in to follow this  
NecoSpes

[C#]Internet Stuff

This topic is 3735 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I was looking at the System.Web classes and there's a lot of them. I'm not sure which one to use. Which one would I want to: 1. Log in a website(Like espn.com or a forum like this) 2. Search a site that has search box 3. Get info from a site 4. Get info from a java application that updates and stuff(like ESPN's live draft application) Bonus question: Do you know any good tutorials for it? Thanks a lot.

Share this post


Link to post
Share on other sites
Advertisement
This depends on the website and what you have access to. In the case of ESPN, you could go with WebRequest classes and parse the output you get back. If the web site exposes some sort of web service, you can point Visual Studio at it and then call the functions on the service as if they were an included library. If given a choice, go with the web service way of doing things, since Visual Studio will give you everything you need.

I don't know how to access specific items within a web page.

Share this post


Link to post
Share on other sites
Try this out. I'm not sure exactly what you're trying to do, but this tutorial should get you started.

Microsoft Web Browser Automation using C#

I found the link while I was writing an automated test tool for a website. Search google for things related to C# WebBrowser, Automation, HtmlElement, and javascript stuff.

Let me know if that doesn't help.

-Artum.


Edit:

Oh, and some sample source code...

//This gets a list of all HTML 'Elements' that are of the INPUT type tag.
HtmlElementCollection MyElementCollection = WebBrowser.Document.GetElementsByTagName("input");
//Loop through all of the matching tags and find the one you want, i'm looking for a value=submit element
foreach (HtmlElement Elm in MyElementCollection)
{
if(Elm.GetAttribute("value") == "submit")
{
//click the button
Elm.InvokeMember("click");
break;
}
}

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!