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. 5分钟搞定jQuery+zepto.js+面向对象插件

    今天分享一下快速使用jQuery+zepto.js的技巧,需要的记得收藏 1.jQuery的引入:本地下载jQuery(后面简称jq)的源文件,开发版本使用非min版,线上使用min版,zepto.j ...

  2. 【vue】vue的路由权限管理

    前言: 最近闲来无事浏览各种博客,看到了一个关于路由权限的管理,觉得很有用,针对那个博客,准备自己写一个demo. 实现: 路由大致分为用户路由<特定用户才能浏览>和基本路由<所有用 ...

  3. python学习笔记之——文件I/O

    1.print打印到屏幕 print "打印到屏幕" 2.读取读取键盘输入 (1)raw_input函数 raw_input([prompt]) 函数从标准输入读取一个行,并返回一 ...

  4. RollViewPager图片轮播效果开源框架的使用

    RollViewPager是一个自动轮播的Viewpager, 支持无限循环. 触摸时会暂停播放,直到结束触摸一个延迟周期以后继续播放. 看起来就像这样.指示器可以为点可以为数字还可以自定义,位置也可 ...

  5. window 命令行

    清屏 cls 启动服务 net start 服务名(nexus.mysql) 关闭服务 net stop 服务名(nexus.mysql) 删除服务 sc delete 服务名 如果服务名有空格,加引 ...

  6. node (1)

    一.介绍 Node.js是一个让JavaScript运行在服务器端的开发平台,它让JavaScript的触角伸到了服务器端. 但Node似乎有点不同: ● Node.js不是一种独立的语言,与PHP. ...

  7. 初识oracle重做日志文件

    转自 http://blog.csdn.net/indexman/article/details/7746948 以下易容翻译自oracle dba官方文档,不足之处还望指出. 管理重做日志文件 学习 ...

  8. [转载]Cool, Tomcat is able to handle more than 13,000 concurrent connections

    Last time I have promised you to take a look at more real life scenario regarding threads. In the la ...

  9. ubuntu下配置JDK7环境变量

    ubuntu下JDK配置本质上和win是一样的: 1.去官网下载JDK7,找jdk-7u21-linux-i586.tar.gz并下载:http://www.oracle.com/technetwor ...

  10. 转: SSH框架总结(框架分析+环境搭建+实例源码下载)

    原:http://blog.csdn.net/shan9liang/article/details/8803989 首先,SSH不是一个框架,而是多个框架(struts+spring+hibernat ...