-1

I am making a windows form application using c# that will check a url, follow redirection and sees if the redirected url is the one i want.

As a new programmer, I have only handled any network related things in java and my searches of doing the same in c# have been unsuccessful. Could you guys help me out please?

yhware
  • 502
  • 3
  • 13
  • 26
  • You want to use 2 completely and opposite programming languages to do something C# could handle by itself? doesn't make much sense to me. – Prix Mar 26 '14 at 01:55
  • no what I mean is I only have experience in java so I was wondering how i could achieve the objective in c# – yhware Mar 26 '14 at 01:56
  • 2
    Start by using the search on this site, there is plenty of questions that show how to get a page and how to check the page content, more specially you want either webclient/webrequest and htmlagilitypack library. [**Learn how to get the page then how to check the content to see if its what you need.**](http://stackoverflow.com/questions/4510212/how-i-can-get-web-pages-content-and-save-it-into-the-string-variable) – Prix Mar 26 '14 at 01:57
  • thanks:) I will check those out – yhware Mar 26 '14 at 02:01

1 Answers1

1

Use:

WebClient wc= new WebClient();
var str = wc.DownloadString("YourURL");

With WebClient you can send request and get response.

Prix
  • 19,417
  • 15
  • 73
  • 132