using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
using System.Xml;

public partial class Demo : System.Web.UI.Page
{
    public string total = "";
    public string y_total = "";
    public string s_date = "";
    public string site = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        //获取参数(用户id)
      string userid = Request.QueryString["id"].ToString();
      //   string userid = "112";
        //设置重定向地址
        string url ="http://jsq.etwun.com/ip/d.asp?userid="+ userid +"";
        System.Net.WebClient wc = new System.Net.WebClient();
        //将数据返回保存到本地xml文件中
        wc.DownloadFile(url, Server.MapPath("resultdemo1.xml"));  
        //将本地xml文件中数据绑定到dataset
        System.Data.DataSet ds = new System.Data.DataSet();
        ds.ReadXml(Server.MapPath("resultdemo1.xml"), System.Data.XmlReadMode.Auto);
        
        //读取相应数据,绑定到前台,再次生成xml
        total=ds.Tables[0].Rows[0]["total"].ToString();
        y_total=ds.Tables[0].Rows[0]["y_total"].ToString() ;
        s_date=ds.Tables[0].Rows[0]["s_date"].ToString();
        site=ds.Tables[0].Rows[0]["site"].ToString();
    }
   
}
