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.Net;
using System.IO;
using System.Text;

public partial class etwuser_visite_all : System.Web.UI.Page
{
    public string cn = string.Empty;
    public string chatid = string.Empty;
    public string id = string.Empty;
    protected void Page_Load(object sender, EventArgs e)
    {
        cn=Request.QueryString["cn"].ToString();
        id = Request.QueryString["userid"].ToString();
        
        if(cn=="1")
        {
            chatid = Getpagehtml("http://jsq.etwun.com:8080/cn/get_all_ip.php?id=" + id);
        }
        else
        {
            chatid = Getpagehtml("http://jsq.etwun.com:8080/get_all_ip.php?id=" + id); 
        }
        chatid = " <script>" + chatid + "</script>";
        
    }

    public string Getpagehtml(string Url)
    {
        string sException = null;
        string sRslt = null;
      
      
            WebResponse oWebRps = null;
            WebRequest oWebRqst = WebRequest.Create(Url);
            oWebRqst.Timeout = 50000;
            try
            {
                oWebRps = oWebRqst.GetResponse();
            }
            catch (WebException e)
            {
                sException = e.Message.ToString();
                Response.Write(sException);
            }
            catch (Exception e)
            {
                sException = e.ToString();
                Response.Write(sException);
            }
            finally
            {
                if (oWebRps != null)
                {
                    StreamReader oStreamRd = new StreamReader(oWebRps.GetResponseStream(),Encoding.GetEncoding("utf-8"));
                    sRslt = oStreamRd.ReadToEnd();
                    oStreamRd.Close();
                    oWebRps.Close();
                  
                }
            }
      
        return sRslt;

    }
}
