联通营业厅API 获取个人信息
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 获取个人信息的更多相关文章
- 在C#中调用API获取网络信息和流量
原文 在C#中调用API获取网络信息和流量 最近一项目中要求显示网络流量,而且必须使用C#. 事实上,调用 IpHlpApi.dll 的 GetIfTable API 可以轻易获得网络信息和网络流量. ...
- C# 通过豆瓣网络编程API获取图书信息
这篇文章主要是关于如何通过豆瓣API获取信息的书籍,起初,我看到了原来的想法的内容是"C# 网络编程之网页简单下载实现"中通过HttpWebResponse类下载源代码,再通过正則 ...
- PHP通过ZABBIX API获取主机信息 VS 直接从数据库获取主机信息
最近项目需要获取linux主机的一些信息,如CPU使用率,内存使用情况等.由于我们本身就装了zabbix系统,所以我只用知道如何获取信息即可,总结有两种方法可以获取. 一.通过ZABBIX API获取 ...
- 通过API获取统计信息时报Access denied错误处理记录
通过API获取HDFS统计信息时报Access denied错误信息,错误信息如下: org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.s ...
- 使用小米天气API获取天气信息
1. URL部分 以下url中"%s"代表的是城市Id,比如北京的cityId=101010100: //获取未来五天预报信息,红色部分信息不需要 WEATHER_DATA_URL ...
- hadoop2.0(chd4) 通过API获取job信息
hadoop 版本儿:hadoop-2.0-cdh4.3.0 想做一个hive的命令的schedule,所以必须获取正在运行的job的数量. 到网上查了一通,一开始用了JobClient,怎么弄都是N ...
- 记-beego项目调用Jenkins API获取job信息
type JenkinsController struct { beego.Controller } type Job struct { Name string `json:"name&qu ...
- 微信小程序把玩(三十八)获取设备信息 API
原文:微信小程序把玩(三十八)获取设备信息 API 获取设备信息这里分为四种, 主要属性: 网络信息wx.getNetWorkType, 系统信息wx.getSystemInfo, 重力感应数据wx. ...
- [整]C#获取天气预报信息(baidu api)包括pm2.5
/// <summary> /// 获取天气预报信息 /// </summary> /// <returns></returns> public Bai ...
随机推荐
- Django(四):model
一.创建model django.db.models是django自带的创建数据库的ORM. 在models.py中以继承models.Model创建表后,需要在setttngs中确保添加了当前应用, ...
- Java一个汉字占几个字节(详解与原理)(转载)
1.先说重点: 不同的编码格式占字节数是不同的,UTF-8编码下一个中文所占字节也是不确定的,可能是2个.3个.4个字节: 2.以下是源码: 1 @Test 2 public void test1() ...
- Go 语言中的 Http 路由基础
最近在写一些 Go 语言的 Web 应用,因为 Go 语言中的 Web 应用和 Python 中的不太一样,具体的区别应该和语言的动态性是有所联系的,同时,也和语言的内置库支持有所联系,所以这就导致了 ...
- MVC 客户端(Memo = "<img src="http://">")中检测到有潜在的危险的 Request.Form 值 的解决方案
解释定义:ASP.NET为了阻止跨站脚本攻击,会对向服务器端输入的HTML代码进行防御措施,在使用.NET MVC中,可以对validateinput属性设置,但是,有时需要ASP.NET临时关闭这个 ...
- Mysql InnoDB的四个事务隔离级别和(分别逐级解决的问题)脏读,不可重复读,虚读
MySqlInnoDB的事务隔离级别有四个:(默认是可重复读repeatable read) 未提交读 read uncommit : 在另一个事务修改了数据,但尚未提交,在本事务中SELECT语句可 ...
- animation 秒简单笔记
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- Python的正则表达式与JSON
Python的正则表达式需要导入re模块 菜鸟教程:http://www.runoob.com/python/python-reg-expressions.html 官方文档:https://docs ...
- Gson基本操作,JsonObject,JsonArray,String,JavaBean,List互转
(转自)https://www.cnblogs.com/robbinluobo/p/7217387.html String.JsonObject.JavaBean 互相转换 User user = n ...
- 我的blog第一天
今天是2017年6月13号,一个很平凡的日子,但是对我来说意义非凡.这是我开通博客的第一天,这是我写的第一篇文章. 先自我介绍一下,本人邢卜,河北石家庄人,生于89年6月,说到这我马上就要过生日了!嘿 ...
- 转载:java基础之单例
转载:https://blog.csdn.net/goodlixueyong/article/details/51935526 https://www.cnblogs.com/cielosun/p/6 ...