从ASP.NET中的URL获取数据

Kru*_*nal 3 .net asp.net string url visual-studio-2010

我是asp.net的新手,

我想从asp.net上的url获取数据.并且需要将数据存储到字符串中.

如果这是我的URL,我想在字符串中获取此URL数据,

http://www.islamicfinder.org/prayer_service.php?country=bahrain&city=manama&state=02&zipcode=&latitude=26.2361&longitude=50.5831&timezone=3.00&HanfiShafi=1&pmethod=4&fajrTwilight1=&fajrTwilight2=&ishaTwilight=0&ishaInterval=0&dhuhrInterval=1&maghribInterval=1&dayLight=0&simpleFormat=xml
Run Code Online (Sandbox Code Playgroud)

sca*_*tag 6

试试这个

string url = "http://www.islamicfinder.org/prayer_service.php?country=bahrain&city=manama&state=02&zipcode=&latitude=26.2361&longitude=50.5831&timezone=3.00&HanfiShafi=1&pmethod=4&fajrTwilight1=&fajrTwilight2=&ishaTwilight=0&ishaInterval=0&dhuhrInterval=1&maghribInterval=1&dayLight=0&simpleFormat=xml";
            var webClient = new WebClient();
            string data = webClient.DownloadString(url);
Run Code Online (Sandbox Code Playgroud)