string newValue = base.Request["tel"];
string newValue2 = base.Request["pwd"];
string postUrl = "https://uac.10010.com/portal/Service/MallLogin";
string text = "callback=jQuery17204603273952720519_1482133308884&req_time=1482133346899&redirectURL=http%3A%2F%2Fwww.10010.com&userName=@tel&password=@pwd&pwdType=01&productType=01&redirectType=03&
rememberMe=1&_=1482133346900";
text = text.Replace("@tel", newValue).Replace("@pwd", newValue2);
CookieContainer cookie = WebClientHelper.GetCookie(text, postUrl);
string content = WebClientHelper.GetContent(cookie, "https://uac.10010.com/cust/infomgr/anonymousInfoAJAX");
base.Response.Write(content);

public static class WebClientHelper
{
public static CookieContainer GetCookie(string postString, string postUrl)
{
CookieContainer cookieContainer = new CookieContainer();
HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(postUrl);
httpWebRequest.CookieContainer = cookieContainer;
httpWebRequest.Method = "POST";
httpWebRequest.KeepAlive = true;
httpWebRequest.UserAgent = "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko";
httpWebRequest.Accept = "text/html, application/xhtml+xml, */*";
httpWebRequest.ContentType = "application/x-www-form-urlencoded";
byte[] bytes = Encoding.UTF8.GetBytes(postString);
httpWebRequest.ContentLength = (long)bytes.Length;
Stream requestStream = httpWebRequest.GetRequestStream();
requestStream.Write(bytes, , bytes.Length);
requestStream.Close();
HttpWebResponse arg_85_0 = (HttpWebResponse)httpWebRequest.GetResponse();
return cookieContainer;
}
public static string GetContent(CookieContainer cookie, string url)
{
HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(url);
httpWebRequest.CookieContainer = cookie;
httpWebRequest.Referer = url;
httpWebRequest.UserAgent = "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko";
httpWebRequest.Accept = "text/html, application/xhtml+xml, */*";
httpWebRequest.ContentType = "application/x-www-form-urlencoded";
httpWebRequest.Method = "GET";
HttpWebResponse httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse();
string result;
using (Stream responseStream = httpWebResponse.GetResponseStream())
{
using (StreamReader streamReader = new StreamReader(responseStream, Encoding.UTF8))
{
result = streamReader.ReadToEnd();
}
}
return result;
}
}

联通营业厅API 获取个人信息的更多相关文章

  1. 在C#中调用API获取网络信息和流量

    原文 在C#中调用API获取网络信息和流量 最近一项目中要求显示网络流量,而且必须使用C#. 事实上,调用 IpHlpApi.dll 的 GetIfTable API 可以轻易获得网络信息和网络流量. ...

  2. C# 通过豆瓣网络编程API获取图书信息

    这篇文章主要是关于如何通过豆瓣API获取信息的书籍,起初,我看到了原来的想法的内容是"C# 网络编程之网页简单下载实现"中通过HttpWebResponse类下载源代码,再通过正則 ...

  3. PHP通过ZABBIX API获取主机信息 VS 直接从数据库获取主机信息

    最近项目需要获取linux主机的一些信息,如CPU使用率,内存使用情况等.由于我们本身就装了zabbix系统,所以我只用知道如何获取信息即可,总结有两种方法可以获取. 一.通过ZABBIX API获取 ...

  4. 通过API获取统计信息时报Access denied错误处理记录

    通过API获取HDFS统计信息时报Access denied错误信息,错误信息如下: org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.s ...

  5. 使用小米天气API获取天气信息

    1. URL部分 以下url中"%s"代表的是城市Id,比如北京的cityId=101010100: //获取未来五天预报信息,红色部分信息不需要 WEATHER_DATA_URL ...

  6. hadoop2.0(chd4) 通过API获取job信息

    hadoop 版本儿:hadoop-2.0-cdh4.3.0 想做一个hive的命令的schedule,所以必须获取正在运行的job的数量. 到网上查了一通,一开始用了JobClient,怎么弄都是N ...

  7. 记-beego项目调用Jenkins API获取job信息

    type JenkinsController struct { beego.Controller } type Job struct { Name string `json:"name&qu ...

  8. 微信小程序把玩(三十八)获取设备信息 API

    原文:微信小程序把玩(三十八)获取设备信息 API 获取设备信息这里分为四种, 主要属性: 网络信息wx.getNetWorkType, 系统信息wx.getSystemInfo, 重力感应数据wx. ...

  9. [整]C#获取天气预报信息(baidu api)包括pm2.5

    /// <summary> /// 获取天气预报信息 /// </summary> /// <returns></returns> public Bai ...

随机推荐

  1. mac,macbook 连接蓝牙耳机播放音乐断断续续

    个人的情况是, mac本连的网线,用的无线鼠标, 屋里80多号人都在用笔记本,应该也有好多开着无线的东西 解决方法: mac 或macbook 连接蓝牙耳机播放音乐断断续续的原因, 在网上找了好多方法 ...

  2. Django基础九之中间件

    一 前戏 我们在前面的课程中已经学会了给视图函数加装饰器来判断是用户是否登录,把没有登录的用户请求跳转到登录页面.我们通过给几个特定视图函数加装饰器实现了这个需求.但是以后添加的视图函数可能也需要加上 ...

  3. Laravel 多域名共享session

    在网站开发中会涉及登陆的问题,在登陆的过程中为了方便用户体验,我们需要用户在主域名登陆,在其他域名下也要保持登陆状态: 在config/session.php中: 更新网站配置缓存即可

  4. JavaScript中==和===的区别(面试题目)

    ==用于一般比较,===用于严格比较;==在比较的时候可以转换数据类型,===严格比较,只要类型不匹配就返回flase. 举例说明: "1" == true; //true 类型不 ...

  5. stm32f103各个型号芯片之间程序移植(stm32的兼容问题)

    1.stm32f103系列的各个型号的芯片差别一般不大,都是一些flash大小不一样,一般是向下兼容(大容量芯片兼容中容量芯片)还有晶振大小不一样.                           ...

  6. JVM知识(三):内存模型和可见性

    这篇文章我们将根据JVM的内存模型探索java当中变量的可见性以及不同的java指令在并发时可能发生的指令重排序的情况.来聊聊java线程对一个变量的更新怎么通知另一个线程,及volatile的作用和 ...

  7. 使用ServiceBroker自动激活模拟"秒杀"场景

    1.简介 SQL Server Service Broker 是SQL server 里面比较独特的一个功能.它可帮助开发人员构建异步的松散耦合应用程序 ServiceBroker入门文章:http: ...

  8. Entity Framework工具POCO Code First Generator的使用

    在使用Entity Framework过程中,有时需要借助工具生成Code First的代码,而Entity Framework Reverse POCO Code First Generator是一 ...

  9. iframe内联框

    内联框中表格的下划线老是显示不出来,设置宽度百分比不起作用,调整了文本域的宽度也不行.只能动态调整iframe的高度.

  10. [UI] 精美UI界面欣赏[3]

    精美UI界面欣赏[3]