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. ssm项目快速搭建(配置)

    核心jar包 <properties>    <project.build.sourceEncoding>UTF-8</project.build.sourceEncod ...

  2. 设计模式--单例模式(学习Learning hard大神笔记实践)

    根据大神博客园中的文章,自己亲手敲了一遍,对每个解说点都自己动手进行实践,收获颇丰,谢谢Learning hard大神,原文地址http://www.cnblogs.com/zhili/p/Desig ...

  3. linux 上传下载 以及SCP命令

    1. scp 用法 scp就是用来在服务器和本地之间传文件的linux命令还有其他的方法,比如装ftp服务器 copy 本地的档案到远程的机器上 scp /Desktop/test.conf 用户名@ ...

  4. Code Signal_练习题_Minesweeper

    In the popular Minesweeper game you have a board with some mines and those cells that don't contain ...

  5. xcrun: error: invalid active developer path (/Applications/Xcode.app/Contents/Developer)解决办法

    背景 mac下卸载了xcode,使用git等命令时就提示错误.invalid active path(Applications/Xcode.app/Contents/Developer),这种情况可以 ...

  6. RecyclerView中notifyDataSetChanged刷新总结

    除了adapter.notifyDataSetChanged()这个方法之外,新的Adapter还提供了其他的方法,如下: public final void notifyDataSetChanged ...

  7. Pig group用法举例

        group语句可以把具有相同键值的数据聚合在一起,与SQL中的group操作有着本质的区别,在SQL中group by字句创建的组必须直接注入一个或多个聚合函数.在Pig Latin中grou ...

  8. spring多线程初探

    6月14号  晴  最高温度37   今天很热的一天啊,开发的任务现在正在测试阶段,手头没有什么工作任务,忙里偷闲,丰富一下我的blog. 前两天有个需求:调用第三方接口,这个接口的响应时间有点长,需 ...

  9. Spring常用注解简单汇总

    使用注解之前要开启自动扫描功能,其中base-package为需要扫描的包(含子包). <context:component-scan base-package="cn.test&qu ...

  10. docker如何创建支持SSH服务的镜像

    一般情况下,Linux系统管理员通过SSH服务来管理操作系统,但Docker的很多镜像是不带SSH服务的,那么我们怎样才能管理操作系统呢?在第一部分中我们介绍了一些进入容器的办法,比如用attach. ...