简体   繁体   中英

Navigating a Web Page and Submitting Data

I'm looking for some information on interacting with websites with C#. I would like to navigate threw pages and also submit data.

I'm not really sure what way to go about it, Also I'm not sure if C# is even the best choice as far as language.

Any thoughts ? Reference Materials ?

Thanks

A good start to developing websites in asp.net (both c# and vb) is Beginning asp.net 4 in c# & VB by Imar Spaanjaars . He also has a lot of good material on his blog.

The ASP.Net site from Microsoft is a good resource too and WebMatrix is a good development platform.

In terms of learning c#, Csharp-station has lots of tutorials and the Yellow book by Rob Miles is a good resource also.

UPDATE

In response to the last comment, Screen Scraping may be what you are looking for.

You can request a web page using C# with something like this (stolen from here ):

    private static string GetWebText(string url)
    {
        HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);

        request.UserAgent = "A .NET Web Crawler";

        WebResponse response = request.GetResponse();
        Stream stream = response.GetResponseStream();
        StreamReader reader = new StreamReader(stream);
        string htmlText = reader.ReadToEnd();

        return htmlText;
    }

Next, I'd use the HTML Agility Pack to parse the HTML and do whatever you need.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM