从URL ASP.NET中获取数据 [英] fetch data from URL in ASP.NET

查看:251
本文介绍了从URL ASP.NET中获取数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来asp.net,

我想在asp.net的URL数据。 &放大器;需要的数据在存储到字符串。

如果想这是我的网址THN我想取字符串此URL数据,

<$p$p><$c$c>http://www.islamicfinder.org/prayer_service.php?country=bahrain&city=manama&state=02&zip$c$c=&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

解决方案

试试这个

 字符串URL = "http://www.islamicfinder.org/prayer_service.php?country=bahrain&city=manama&state=02&zip$c$c=&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 Web客户端=新的Web客户端();
            字符串数据= webClient.DownloadString(URL);
 

i am new to asp.net,

ı want to get data from url on asp.net. & need data to be in store into string.

if suppose this is my URL thn i want to fetch this URL Data in string,

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

解决方案

Try this

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);

这篇关于从URL ASP.NET中获取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆