日期:2014-05-17 浏览次数:21073 次
function writeSource() {
if (xmlHttp.readyState == 4) {
alert(xmlHttp.responseText);
}
}
xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = writeSource;
xmlHttp.open('GET', 'http://bns.plaync.com/api/launcher/launcher?serverType=live', true);
xmlHttp.send(null);
CookieContainer CCArray = new CookieContainer();
string strCookie = webBrowser1.Document.Cookie;
string[] cookstr = strCookie.Split(';');
foreach (string str in cookstr)
{
string[] cookValueName = str.Split('=');
Cookie ck = new Cookie(cookValueName[0].Trim().ToString(),cookValueName[1].Trim().ToString());
ck.Domain = "bns.plaync.com";
CCArray.Add(ck);
}
static void Main(string[] args)
{
Console.WriteLine(Getpage());
Console.Read();
}
static string Getpage()
{
System.IO.Stream response;
System.IO.StreamReader sr;
string result = string.Empty;
string domain = "http://bns.plaync.com/api/launcher/launcher?serverType=live";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(domain);
request.Method = "GET";
request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
request.Headers.Set("Accept-Charset", "GBK,utf-8;q=0.7,*;q=0.3");
&nbs