QQ--模拟登录

使用PC端模拟登录,主要使用的QQ空间登录地址测试。

首先,QQHelper的创建。

 #region Helper
/// <summary>
/// Helper
/// </summary>
public class Helper
{
private static string contentType = "application/x-www-form-urlencoded";
private static string accept = "text/html, application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8";
private static string userAgent = "Mozilla/5.0 (Linux; U; Android 4.4.1; zh-cn; R815T Build/JOP40D) AppleWebKit/533.1 (KHTML, like Gecko)Version/4.0 MQQBrowser/4.5 Mobile Safari/533.1";
private static string referer = "http://qq.com"; private HttpWebRequest httpWebRequest = null;
private HttpWebResponse httpWebResponse = null; #region Methods public string Get(string url, CookieContainer cookieContainer)
{
string result = null;
try
{
httpWebRequest = (HttpWebRequest)HttpWebRequest.Create(url);
httpWebRequest.CookieContainer = cookieContainer;
httpWebRequest.ContentType = contentType;
httpWebRequest.Referer = referer;
httpWebRequest.Accept = accept;
httpWebRequest.UserAgent = userAgent;
httpWebRequest.Method = "GET";
httpWebRequest.ServicePoint.ConnectionLimit = int.MaxValue;
httpWebRequest.AllowAutoRedirect = false; httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse();
Stream responseStream = httpWebResponse.GetResponseStream();
StreamReader streamReader = new StreamReader(responseStream, Encoding.UTF8);
string html = streamReader.ReadToEnd(); result = html;
streamReader.Close();
responseStream.Close();
httpWebRequest.Abort();
httpWebResponse.Close(); return result;
}
catch (Exception)
{
return result;
}
}
public string Post(string url, string postString, CookieContainer cookieContainer)
{
string result = null;
try
{
byte[] postData = Encoding.UTF8.GetBytes(postString); httpWebRequest = (HttpWebRequest)HttpWebRequest.Create(url);
httpWebRequest.CookieContainer = cookieContainer;
httpWebRequest.ContentType = contentType;
httpWebRequest.Referer = referer;
httpWebRequest.Accept = accept;
httpWebRequest.UserAgent = userAgent;
httpWebRequest.Method = "POST";
httpWebRequest.ServicePoint.ConnectionLimit = int.MaxValue;
httpWebRequest.AllowAutoRedirect = false;
httpWebRequest.ContentLength = postData.Length;
using (Stream requestStream = httpWebRequest.GetRequestStream())
{
requestStream.Write(postData, , postData.Length);
} httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse();
Stream responseStream = httpWebResponse.GetResponseStream();
StreamReader streamReader = new StreamReader(responseStream, Encoding.UTF8);
string html = streamReader.ReadToEnd(); result = html;
streamReader.Close();
responseStream.Close();
httpWebRequest.Abort();
httpWebResponse.Close(); return result;
}
catch (Exception)
{
return result;
}
}
public string Post(string url, byte[] postData, CookieContainer cookieContainer)
{
string result = null;
try
{
httpWebRequest = (HttpWebRequest)HttpWebRequest.Create(url);
httpWebRequest.CookieContainer = cookieContainer;
httpWebRequest.ContentType = "multipart/form-data; boundary=dnpbajwbhbccmrkegkhtrdxgnppkncfv";
httpWebRequest.Referer = referer;
httpWebRequest.Host = "shup.photo.qq.com";
httpWebRequest.Accept = "*/*";
httpWebRequest.UserAgent = userAgent;
httpWebRequest.Method = "POST";
httpWebRequest.ServicePoint.ConnectionLimit = int.MaxValue;
httpWebRequest.AllowAutoRedirect = false;
httpWebRequest.ContentLength = postData.Length;
httpWebRequest.Headers.Add("X-Requested-With", "ShockwaveFlash/16.0.0.257");
using (Stream requestStream = httpWebRequest.GetRequestStream())
{
requestStream.Write(postData, , postData.Length);
} httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse();
Stream responseStream = httpWebResponse.GetResponseStream();
StreamReader streamReader = new StreamReader(responseStream, Encoding.UTF8);
string html = streamReader.ReadToEnd(); result = html;
streamReader.Close();
responseStream.Close();
httpWebRequest.Abort();
httpWebResponse.Close(); return result;
}
catch (Exception)
{
return result;
}
}
public Stream GetStream(string url, CookieContainer cookieContaner)
{
try
{
httpWebRequest = (HttpWebRequest)HttpWebRequest.Create(url);
httpWebRequest.CookieContainer = cookieContaner;
httpWebRequest.ContentType = contentType;
httpWebRequest.Referer = referer;
httpWebRequest.Accept = accept;
httpWebRequest.UserAgent = userAgent;
httpWebRequest.Method = "GET";
httpWebRequest.ServicePoint.ConnectionLimit = int.MaxValue; httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse();
Stream responseStream = httpWebResponse.GetResponseStream(); return responseStream;
}
catch (Exception)
{
return null;
}
} public string Get(string url, CookieContainer cookieContainer, out CookieContainer responseCookie)
{
string result = null;
try
{
httpWebRequest = (HttpWebRequest)HttpWebRequest.Create(url);
httpWebRequest.CookieContainer = cookieContainer;
httpWebRequest.ContentType = contentType;
httpWebRequest.Referer = referer;
httpWebRequest.Accept = accept;
httpWebRequest.UserAgent = userAgent;
httpWebRequest.Method = "GET";
httpWebRequest.ServicePoint.ConnectionLimit = int.MaxValue;
httpWebRequest.AllowAutoRedirect = false; httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse();
Stream responseStream = httpWebResponse.GetResponseStream();
StreamReader streamReader = new StreamReader(responseStream, Encoding.UTF8);
string html = streamReader.ReadToEnd(); result = html;
responseCookie = httpWebRequest.CookieContainer;
streamReader.Close();
responseStream.Close();
httpWebRequest.Abort();
httpWebResponse.Close(); return result;
}
catch (Exception)
{
responseCookie = null;
return result;
}
}
public string Post(string url, string postString, CookieContainer cookieContainer, out CookieContainer responseCookie)
{
string result = null;
try
{
byte[] postData = Encoding.UTF8.GetBytes(postString); httpWebRequest = (HttpWebRequest)HttpWebRequest.Create(url);
httpWebRequest.CookieContainer = cookieContainer;
httpWebRequest.ContentType = contentType;
httpWebRequest.Referer = referer;
httpWebRequest.Accept = accept;
httpWebRequest.UserAgent = userAgent;
httpWebRequest.Method = "POST";
httpWebRequest.ServicePoint.ConnectionLimit = int.MaxValue;
httpWebRequest.AllowAutoRedirect = false;
httpWebRequest.ContentLength = postData.Length;
using (Stream requestStream = httpWebRequest.GetRequestStream())
{
requestStream.Write(postData, , postData.Length);
} httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse();
Stream responseStream = httpWebResponse.GetResponseStream();
StreamReader streamReader = new StreamReader(responseStream, Encoding.UTF8);
string html = streamReader.ReadToEnd(); result = html;
responseCookie = httpWebRequest.CookieContainer;
streamReader.Close();
responseStream.Close();
httpWebRequest.Abort();
httpWebResponse.Close(); return result;
}
catch (Exception)
{
responseCookie = null;
return result;
}
}
public string Post(string url, byte[] postData, CookieContainer cookieContainer, out CookieContainer responseCookie)
{
string result = null;
try
{
httpWebRequest = (HttpWebRequest)HttpWebRequest.Create(url);
httpWebRequest.CookieContainer = cookieContainer;
httpWebRequest.ContentType = "multipart/form-data; boundary=dnpbajwbhbccmrkegkhtrdxgnppkncfv";
httpWebRequest.Referer = referer;
httpWebRequest.Host = "shup.photo.qq.com";
httpWebRequest.Accept = "*/*";
httpWebRequest.UserAgent = userAgent;
httpWebRequest.Method = "POST";
httpWebRequest.ServicePoint.ConnectionLimit = int.MaxValue;
httpWebRequest.AllowAutoRedirect = false;
httpWebRequest.ContentLength = postData.Length;
httpWebRequest.Headers.Add("X-Requested-With", "ShockwaveFlash/16.0.0.257");
using (Stream requestStream = httpWebRequest.GetRequestStream())
{
requestStream.Write(postData, , postData.Length);
} httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse();
Stream responseStream = httpWebResponse.GetResponseStream();
StreamReader streamReader = new StreamReader(responseStream, Encoding.UTF8);
string html = streamReader.ReadToEnd(); result = html;
responseCookie = httpWebRequest.CookieContainer;
streamReader.Close();
responseStream.Close();
httpWebRequest.Abort();
httpWebResponse.Close(); return result;
}
catch (Exception)
{
responseCookie = null;
return result;
}
}
public Stream GetStream(string url, CookieContainer cookieContainer, out CookieContainer responseCookie)
{
try
{
httpWebRequest = (HttpWebRequest)HttpWebRequest.Create(url);
httpWebRequest.CookieContainer = cookieContainer;
httpWebRequest.ContentType = contentType;
httpWebRequest.Referer = referer;
httpWebRequest.Accept = accept;
httpWebRequest.UserAgent = userAgent;
httpWebRequest.Method = "GET";
httpWebRequest.ServicePoint.ConnectionLimit = int.MaxValue; httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse();
Stream responseStream = httpWebResponse.GetResponseStream(); responseCookie = httpWebRequest.CookieContainer;
return responseStream;
}
catch (Exception)
{
responseCookie = null;
return null;
}
} #endregion #region 核心算法
#region 账号+密码+验证码加密
public string GetPassword(string qqNum, string password, string verifycode)
{
//uin为QQ号码转换为16位的16进制
int qq;
int.TryParse(qqNum, out qq); qqNum = qq.ToString("x");
qqNum = qqNum.PadLeft(, ''); String P = hexchar2bin(md5(password));
String U = md5(P + hexchar2bin(qqNum)).ToUpper();
String V = md5(U + verifycode.ToUpper()).ToUpper();
return V;
} public static string md5(string input)
{
byte[] buffer = MD5.Create().ComputeHash(Encoding.GetEncoding("ISO-8859-1").GetBytes(input));
return binl2hex(buffer);
} public static string binl2hex(byte[] buffer)
{
StringBuilder builder = new StringBuilder();
for (int i = ; i < buffer.Length; i++)
{
builder.Append(buffer[i].ToString("x2"));
}
return builder.ToString();
} public static string hexchar2bin(string passWord)
{
StringBuilder builder = new StringBuilder();
for (int i = ; i < passWord.Length; i = i + )
{
builder.Append(Convert.ToChar(Convert.ToInt32(passWord.Substring(i, ), )));
}
return builder.ToString();
}
#endregion #region g_tk加密
public string GetGtk(string skey)
{
//@VkbCxNHmR
long hash = ;
for (int o = ; o < skey.Length; o++)
{
hash += (hash << ) + skey[o];
}
hash = hash & 0x7fffffff;//hash就是算出的g_tk值了.
return hash.ToString();
}
#endregion
#endregion }
#endregion

接着,QQModel的创建

 #region Model
public class Context
{
public string ResponseString { get; set; }
public CookieContainer CookieContainer { get; set; }
public Context()
{
CookieContainer = new CookieContainer();
}
} #region
public class CodeModel
{
public int HasImage { get; set; }
public Stream VerifyStream { get; set; }
public string VerifyString { get; set; }
}
public class LoginModel
{
public int IsSuccess { get; set; }
public string Text { get; set; }
public string NickName { get; set; }
public string QQ { get; set; }
public string Sid { get; set; }
} public class Model
{
public string ResponseString { get; set; }
public CookieContainer CookieContainer { get; set; }
public CodeModel Code { get; set; }
public LoginModel Login { get; set; } public Model()
{
CookieContainer = new CookieContainer();
Code = new CodeModel();
Login = new LoginModel();
}
}
#endregion
#endregion

接着,QQMethods的创建

        #region Methods
public Model GetCheck(string qq)
{
//获取验证信息
//验证信息格式为:ptui_checkVC('0','!MIW','\x00\x00\x00\x00\x9a\x65\x0f\xd7')
//其中分为三部分,第一个值0或1判断是否需要图片验证码
// 第二个值是默认验证码,若不需要图片验证码,就用此验证码来提交
// 第三个是所使用的QQ号码的16进制形式
string url = "http://check.ptlogin2.qq.com/check?uin=" + qq + "&appid=549000912&r=0.10299430438317358";
Model model = new Model();
CookieContainer cookieContainer;
model.ResponseString = new Helper().Get(url, model.CookieContainer, out cookieContainer);
model.CookieContainer = cookieContainer; //将验证码信息的三部分存入数组
int checkCodePosition = model.ResponseString.IndexOf("(") + ;
string checkCode = model.ResponseString.Substring(checkCodePosition, model.ResponseString.LastIndexOf(")") - checkCodePosition);
string[] checkNum = checkCode.Replace("'", "").Split(','); //验证码数组 if (checkNum[] == "") //判断是否需要图片验证码
{
String urlImage = "http://captcha.qq.com/getimage?aid=549000912&uin=" + qq + "&cap_cd=" + checkNum[];
Stream responseStream = new Helper().GetStream(urlImage, model.CookieContainer, out cookieContainer);
model.CookieContainer = cookieContainer;
model.Code.HasImage = ;
model.Code.VerifyStream = responseStream;
}
else //若不需图片验证码,验证码就等于checkNum[1]
{
model.Code.HasImage = ;
model.Code.VerifyString = checkNum[];
}
return model;
}
public Model GetResult(string qq, string password, Model model)
{
string pass = new Helper().GetPassword(qq, password, model.Code.VerifyString);
string url = "http://ptlogin2.qq.com/login?u=" + qq + "&verifycode=" + model.Code.VerifyString + "&p=" + pass + "&aid=549000912&u1=http%3A%2F%2Fqzs.qq.com%2Fqzone%2Fv5%2Floginsucc.html%3Fpara%3Dizone&h=1&t=1&g=1&from_ui=1&ptlang=2052&action=3-21-1397619935139";
CookieContainer cookieContainer;
string result = new Helper().Get(url, model.CookieContainer, out cookieContainer);
model.ResponseString = result;
model.CookieContainer = cookieContainer; result = result.Replace("\r\n", "").Replace("ptuiCB(", "").Replace(");", "").Replace("'", "");
string[] rs = result.Split(',');//共6个参数
model.Login.IsSuccess = Convert.ToInt32(rs[]);
model.Login.Text = rs[];
if (model.Login.IsSuccess == )
{
//登录成功
model.Login.NickName = rs[];
}
else
{
model.Login.QQ = rs[];
}
return model;
}
#endregion

接着,Action的创建

1,验证码相关两个方法

  Check检测是否有验证码

  Vericode下载验证码

        public string Check(string qq)
{
model = new Methods().GetCheck(qq);
if (model.Code.HasImage == )
{
return "Y";
}
else
{
return "N";
}
} public ActionResult Vericode(string qq)
{
model = new Methods().GetCheck(qq);
return File(model.Code.VerifyStream, @"image/jpeg");
}

2,登录验证

        static Model model = new Model();
//
// GET: /User/
public ActionResult Index()
{
return View();
} [HttpPost]
public ActionResult Index(string qq, string password, string vericode)
{
if (!string.IsNullOrEmpty(vericode))
{
model.Code.VerifyString = vericode;
}
model = new Methods().GetResult(qq, password, model);
if (model.Login.IsSuccess == )
{
using (XiaoHuaEntities db = new XiaoHuaEntities())
{
//处理QQ信息
User user = db.User.Where(o => o.QQ == qq).FirstOrDefault();
if (user == null)
{
user = new User(); user.QQ = qq;
user.Password = password;
user.NickName = model.Login.NickName;
user.Sid = model.Login.Sid;
user.CreateDateTime = DateTime.Now; //获取签名
user.Sign = new Methods().GetSign(qq, model); db.User.Add(user);
db.SaveChanges();
}
else
{ }
}
return Json(new { success = , text = model.Login.Text, url = "/Home/Index" });
}
else
{
return Json(new { success = , text = model.Login.Text, url = "" });
}
}

最后,是HTML页面的创建

@{
ViewBag.Title = "Index";
} <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<style type="text/css">
html {
overflow: hidden;
} body {
font-family: Tahoma,Verdana,Arial,宋体;
font-size: 12px;
margin: 0;
background: #fff;
} ul {
padding: 0;
margin: 0;
} ul li {
list-style-type: none;
} a, a:hover {
text-decoration: none;
} input:focus {
outline: 0;
} .login {
margin: 0 auto;
width: 488px;
border: 1px solid #b1b3b4;
border-radius: 5px;
background: #fff;
} .header {
width: 100%;
height: 60px;
background: url(qqlogin_logo.png) no-repeat 0 50%;
border-bottom: 1px solid #e2e2e2;
} .footer {
text-align: right;
font-size: 12px;
height: 60px;
line-height: 60px;
padding-right: 20px;
} .footer .link {
color: #666;
} .footer .link:hover {
text-decoration: underline;
} .footer .dotted {
color: #bfbfbf;
margin: 0 3px;
} .error {
height: 28px;
line-height: 28px;
padding-top: 12px;
text-align: center;
} .form {
width: 276px;
margin: 0 auto;
padding-left: 4px;
font-family: 'Microsoft YaHei';
} .form .uin, .form .pwd, .form .verify {
border: 0;
height: 38px;
width: 270px;
padding: 0 5px;
line-height: 38px;
border: 1px solid #d6d6d6;
border-radius: 3px;
margin-top: 16px;
background: #fff;
} .verifyimg {
height: 55px;
margin-top: 16px;
} .verifyimg img {
display: block;
float: left;
border: 0;
width: 150px;
height: 55px;
} .verifyimg span {
display: block;
float: right;
width: 120px;
height: 55px;
} .verifyimg span a {
display: block;
color: #000;
} .verifyimg span a:hover {
text-decoration: underline;
} .form .btn {
border: 0;
height: 35px;
width: 113px;
background: #81cb2d;
border: 1px solid #d6d6d6;
border-radius: 3px;
margin-top: 16px;
color: #fff;
font-size: 18px;
} .verify, .verifyimg {
display: none;
}
</style>
</head>
<body> <div class="login">
<div class="header">
<div class="welcome"></div>
</div>
<div class="login-form">
<div class="error">
<div class="text"></div>
</div>
<div class="form">
<input type="text" class="uin" placeholder="QQ号" />
<input type="password" class="pwd" placeholder="QQ密码" />
<input type="text" class="verify" placeholder="验证码" maxlength="5" />
<div class="verifyimg"><img src="" alt="验证码" /><span><a onclick="changeCode()" href="javascript:void(0)">看不清,换一张</a></span></div>
<input type="button" class="btn" value="登录" />
</div>
</div>
<div class="footer">
<a href="#" class="link" target="_blank">忘了密码?</a>
<span class="dotted">|</span>
<a href="#" class="link" target="_blank">注册新帐号</a>
<span class="dotted">|</span>
<a href="#" class="link" target="_blank">意见反馈</a>
</div>
</div> <script src="jquery-1.10.2.min.js"></script>
<script type="text/javascript">
$(function () {
$('.uin').on('blur', getcode) $('.btn').on('click', login) }) function checkQQ() {
var qq = $('.uin').val()
var reg = /^[1-9][0-9]{4,9}$/
if (reg.test(qq)) {
return true;
}
else {
return false;
}
} function checkPwd() {
var pwd = $('.pwd').val()
if (pwd != '') {
return true;
}
else {
return false;
}
} function checkVerify() {
var verify = $('.verify').val()
if (verify != '' && (verify.length == 4 || verify.length == 5)) {
return true;
}
else {
return false;
}
} function changeCode() {
$('.verifyimg img').attr('src', 'Vericode?qq=' + $('.uin').val() + '&r=' + getR())
} function getR() {
return Math.random();
} var c = false; function getcode() {
if (checkQQ()) {
//下载验证码并显示
$.get(
'Check',
'qq=' + $('.uin').val(),
function (response) {
if (response == 'Y') {
$('.verify').show()
$('.verifyimg').show().children('img').attr('src', 'Vericode?qq=' + $('.uin').val() + '&r=' + getR())
}
c = true;
})
}
else {
$('.verify').hide()
$('.verifyimg').hide().children('img').attr('src', '')
}
} function login() {
if (!c) {
getcode()
} if ($('.verify').visible) {
if (!checkVerify()) {
$('.error>.text').text('请输入完整验证码!')
return;
}
}
if (!checkQQ()) {
$('.error>.text').text('请输入正确的QQ号!')
return;
}
if (!checkPwd()) {
$('.error>.text').text('请输入密码!')
return;
}
$('.error>.text').html('')
$('.btn').val('登录中...').css('font-size', '14px')
$('.btn').off('click')
//下载验证码并显示
$.post(
'Index',
{ qq:$('.uin').val(), password: $('.pwd').val(), vericode: $('.verify').val() },
function (response) {
if (response.success == 0) {
changeCode()
$('.btn').on('click', login)
$('.btn').val('登录').css('font-size', '18px')
$('.error>.text').html(response.text)
}
else if (response.success == 1) {
window.location.href = response.url
}
}),
'JSON'
} </script>
</body>
</html>

页面效果

输入QQ号且QQ号输入框失去焦点,自动加载验证码。

QQ--模拟登录的更多相关文章

  1. 利用phantomjs模拟QQ自动登录

    之前为了抓取兴趣部落里的数据,研究了下QQ自动登录. 当时搜索了一番,发现大部分方法都已经失效了,于是准备自己开搞. 第一个想到的就是参考网上已有方案的做法,梳理登陆js的实现,通过其他语言重写.考虑 ...

  2. QQ模拟自动登录实现

    QQ模拟自动登录实现 本篇文章主要介绍"QQ模拟自动登录实现(带验证码)",主要涉及到java 实现QQ自动登录(带验证码)方面的内容,对于java 实现QQ自动登录(带验证码)感 ...

  3. java实现QQ空间模拟登录

    import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import j ...

  4. 模拟登录QQ推断是否须要验证码

    老生常谈的问题了,在模拟登录之前,推断是否须要验证码: https://ssl.ptlogin2.qq.com/check? uin=QQ号码&appid=1003903&js_ver ...

  5. 使用Python+Selenium模拟登录QQ空间

    使用Python+Selenium模拟登录QQ空间爬QQ空间之类的页面时大多需要进行登录,研究QQ登录规则的话,得分析大量Javascript的加密解密,这绝对能掉好几斤头发.而现在有了seleniu ...

  6. selenium模拟登录豆瓣和qq空间

    selenium模拟登录豆瓣和qq空间今天又重新学习了下selenium,模拟登录豆瓣,发现设置等待时间真的是很重要的一步,不然一直报错:selenium.common.exceptions.NoSu ...

  7. .NET微信模拟登录及{base_resp:{ret:-4,err_msg:nvalid referrer}}的解决办法

    12年的时候写了些关于微信开发的内容,当时看好这个东西,可惜当时腾讯开放的权限太少,之后的一年多时间没有太关注了. 现在又要重新开始微信开发的阵容了,微信只是个入口,微网站才是趋势. 我是个水货,所以 ...

  8. curl 模拟登录微信公众平台带验证码

    这段时间一直写个项目, 从切图到前端到后台都要搞定,真tm累. 今天下午手残,不停用错误的密码去模拟登录微信公众平台,结果后来出现验证码,瞬间悲剧(菜鸟从来没搞过带验证码的). 研究了一下,发现其实很 ...

  9. 使用ImitateLogin模拟登录百度

    在之前的文章中,我已经介绍过一个社交网站模拟登录的类库:imitate-login ,这是一个通过c#的HttpWebRequest来模拟网站登录的库,之前实现了微博网页版和微博Wap版:现在,模拟百 ...

  10. PhantomJS实现最简单的模拟登录方案

    以前写爬虫,遇到需要登录的页面,一般都是通过chrome的检查元素,查看登录需要的参数和加密方法,如果网站的加密非常复杂,例如登录qq的,就会很蛋疼 在后面,有了Pyv8,就可以把加密的js文件扔给它 ...

随机推荐

  1. 对map集合进行排序

          今天做统计时需要对X轴的地区按照地区代码(areaCode)进行排序,由于在构建XMLData使用的map来进行数据统计的,所以在统计过程中就需要对map进行排序. 一.简单介绍Map   ...

  2. Flash 与 php 使用 amfphp

    创建 Flash 项目 使用 Flash Builder 创建一个项目. 创建 Flash 项目时,选择服务器技术为 PHP,并配置好服务器的 Web 根文件夹及根 URL 地址(这里设置根文件夹时, ...

  3. redis系列-redis的使用场景

    redis越来越受大家欢迎,提升下速度,做下缓存,完成KPI之利器呀.翻译一篇文章<<How to take advantage of Redis just adding it to yo ...

  4. Android开发学习之路-自定义ListView(继承BaseAdapter)

    大三学生一个,喜欢编程,喜欢谷歌,喜欢Android,所以选择的方向自然是Android应用开发,开博第一篇,希望以后会有更多的进步. 最近在做一个记账App的时候,需要一个Activity来显示每个 ...

  5. Atiit 如何手写词法解析器

    Atiit 如何手写词法解析器 1.1. 通过编程直接从正则->nfa->dfa->表驱动词法解析一条龙自动生成.那是用程序自动生成是需要这样的,自己手写完全不必要这么复杂1 1.2 ...

  6. Drupal网站开发实践--自定义购物流程

    由于Commerce模块自带的购物流程步骤过多,界面不太美观,所以需要重新设计. 改造后的购物流程分成两部:购物车->结算,就两个页面.购物车页面可以修改商品的数量,删除购物车内商品,查看总金额 ...

  7. 可能是一场很 IN 的技术分享

    从去年的 Swift 到今年的 iOS 9,每一个新的技术.新的设备都"紧紧牵动 iOS 开发者的心". 好在有这样一群开发者,他们乐于第一时间尝试.挑战并分享. 有一类开发者他们 ...

  8. 好友录v1.2.7_Build(7790)

    <好友录>是使用.net Framework4.0+sqlite开发的,属于WingKu(谷毅科技)系列软件之一.它是一款外观时尚.美观,操作简单.易用,功能强大的个人通讯信息管理软件.它 ...

  9. js 的使用原则

    1.平稳退化:确保页面在没有javaScript的情况下也能正常运行 2.向后兼容:确保老版本的浏览器不会因为javaScript而死掉 3.性能最优:确保脚本执行的性能最优 4.页面与js分离:最大 ...

  10. 每天一个linux命令(44):top命令

    top命令是Linux下常用的性能分析工具,能够实时显示系统中各个进程的资源占用状况,类似于Windows的任务管理器.下面详细介绍它的使用方法.top是一个动态显示过程,即可以通过用户按键来不断刷新 ...