我有两个网址。如果我打开第一个 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)
{
}