public SinaStockMarketListener()
 {
     client = new HttpClient(this.Cookie);
 }
Exemplo n.º 2
0
        private void button12_Click(object sender, EventArgs e)
        {
            // FormXueQiu xq = new FormXueQiu();
            HttpClient client = new HttpClient();
            client.Get("http://www.xueqiu.com", Encoding.UTF8);
            String postString = "username=&areacode=86&telephone=13305278179&remember_me=1&password=1C63129AE9DB9C60C3E8AA94D3E00495";
            byte[] postData = Encoding.UTF8.GetBytes(postString);
            byte[] responseData = client.UploadData("http://xueqiu.com/user/login", "POST", postData);
            responseData = client.UploadData("http://xueqiu.com/user/login", "POST", postData);
            string signInfo = Encoding.UTF8.GetString(responseData);//解码
            LogHelper.Instance.WriteLog(null, signInfo, true);
            client.Timeout = 0xea00;
            string comet = "https://im6.xueqiu.com/im-comet/v2/notifications/5540144/comet.json?user_id=6423737446&_=1448455307764";
            String s = client.DownloadString(comet);

            LogHelper.Instance.WriteLog(null, s, true);
        }