0

I have a website named:

string url="http://180.92.171.80/ffs/data-flow-list-based/flood-forecasted-site/"

When I give the station name, River name, Basin name, It returns me present Water level. I want to do it in C#. I can read HTML code from C#. But there is no value in HTML. Where to start or how I can do it easily? Anyone have any idea?

3
  • Do you have URL which accepts necessary parameters and returns Water level, OR are you asking us to find such URL? Commented Jun 15, 2014 at 7:05
  • I have necessary parameters but I want to embedd in C# code. Commented Jun 15, 2014 at 7:12
  • You are trying to get the data from a webpage by modifying the link to it. Well it's not a web service that you are calling and so the returned data will be in html, if you are asking that if you need to parse the html returned, then yes you have to. Commented Jun 15, 2014 at 7:30

1 Answer 1

1

Check out the WebClient class. You can use the DownloadString() method to get the html from your url as a string.

WebClient client = new WebClient ();
string reply = client.DownloadString (address);

http://msdn.microsoft.com/en-us/library/fhd1f0sw.aspx

Sign up to request clarification or add additional context in comments.

4 Comments

I have tried it. But it return me the html code that doesnot contain Water level Data.
Where does the water level data come from?
string url ="180.92.171.80/ffs/data-flow-list-based" Here when I select state, basin, district and river name, it automatically update and show water level.
You need to put the parameters into the URL that will take you to the page, with the info you want. It may help to browse to the page in your web browser, then copy the URL into your code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.