【发布时间】:2011-09-21 01:10:40
【问题描述】:
我有两个 URl。如果我打开第一个 url,它将允许我们进行身份验证。第二个 URL 将 Web 内容作为 XML 数据打开。我需要读取该数据...但是当我执行第一个 URL 时,它的工作正常 Authentication 是 SUCCESS,但是我立即尝试打开第二个 URL,它说 Authentication failed 。如何保持从第一个 URL 到第二个 URL 的会话...
我的代码:
string url1 = "http://172.xx.xx.xx:xxxx/cms?login&username=santhu&password=welcom0e";
string url = "http://172.xx.xx.xx:xxxx//cms?status=ProcessStatus";
string result = null;
string result1 = null;
try
{
WebClient client = new WebClient();
result = client.DownloadString(url1);
TextBox1.Text = result.ToString();
result1 = client.DownloadString(url);
TextBox2.Text = result1.ToString();
}
catch (Exception ex)
{
}
【问题讨论】:
-
使用 Session[""] 变量来维护值还是 Cookie?
-
好的,我维护会话值,但是如何将该会话呈现到第二个 url..知道已经通过身份验证..
-
请尝试解决我被吊死在这里...
标签: c# asp.net-session