从外部URL参数读取 [英] Read from external URL parameters
问题描述
如果我有此网站链接:
http://www.islamicfinder.org/prayer_service.php?country=bahrain&city=manama&state=02&zipcode=&latitude=26.2361&经度= 50.5831&时区= 3.00& HanfiShafi = 1& pmethod = 4& fajrTwilight1 =& fajrTwilight2 =& ishaTwilight = 0& ishaInterval = 0& dhuhrInterval = 1& maghribInterval = 1& dayLight = 0& simpleFormat = xml
如何将值从该页面读入我的aspx页面?
例如,我只需要前两个时间.
请帮忙吗?
Hi,
If I have this Website link:
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
How can I read values from that page into my aspx page?
For example I want only the first two timings.
Any help please?
推荐答案
您可以尝试一下
You can try this
private string GetHtmlFromUrl(string url)
{
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);
using (Stream stream = request.GetResponse().GetResponseStream())
{
using (StreamReader reader = new StreamReader(stream))
{
string response = reader.ReadToEnd();
return response;
}
}
}
如果有帮助,请投票并接受答案.
Please vote and Accept Answer if it Helped.
string value = Request.QueryString["parameterName"];
定义远程".如果您同时控制两个站点:
0)您可以让远程"站点将查询字符串发送到另一个网页,该网页可以执行您可能需要的任何处理
1)Yu可以将查询字符串保存到与另一个可以定期请求接收数据的网站共享的数据库中.
如果您无法控制远程站点,那么您很不走运.
Define "remote". If you have control over both sites:
0) You can have the "remote" site send the query string to another web page that can perform whatever processing you might require
1) Yu can save the query string to a database shared with another web site that can periodically request rceent data.
If you don''t have control over the remote site, you''re pretty much out of luck.
这篇关于从外部URL参数读取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!