基本信息
源码名称:WebQQ 接口 以及测试项目 附完整源码
源码大小:2.91M
文件格式:.zip
开发语言:C#
更新时间:2013-04-08
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300

本次赞助数额为: 2 元 
   源码介绍

webqq接口实例,含测试项目


using System;
using System.Collections.Generic;
using System.Text;
using System.Security.Cryptography;
using System.Text.RegularExpressions;
using System.Collections;
using System.ByteBuffer;

namespace QQ
{
    public class QQMd5
    {
        public static string EncyptMD5_3_16(string s)
        {
            MD5 mD = MD5.Create();
            byte[] bytes = Encoding.ASCII.GetBytes(s);
            byte[] buffer = mD.ComputeHash(bytes);
            byte[] buffer2 = mD.ComputeHash(buffer);
            byte[] array = mD.ComputeHash(buffer2);
            StringBuilder stringBuilder = new StringBuilder();
            byte[] array2 = array;
            for (int i = 0; i < array2.Length; i  )
            {
                byte b = array2[i];
                stringBuilder.Append(b.ToString("x").PadLeft(2, '0'));
            }
            return stringBuilder.ToString().ToUpper();
        }
        public static string smethod_0(string s)
        {
            MD5 mD = MD5.Create();
            byte[] bytes = Encoding.ASCII.GetBytes(s);
            byte[] array = mD.ComputeHash(bytes);
            StringBuilder stringBuilder = new StringBuilder();
            byte[] array2 = array;
            for (int i = 0; i < array2.Length; i  )
            {
                byte b = array2[i];
                stringBuilder.Append(b.ToString("x").PadLeft(2, '0'));
            }
            return stringBuilder.ToString().ToUpper();
        }
        public static byte[] EncyptMD5Bytes(string s)
        {
            MD5 mD = MD5.Create();
            byte[] bytes = Encoding.ASCII.GetBytes(s);
            return mD.ComputeHash(bytes);
        }
        public static string smethod_1(byte[] s)
        {
            MD5 mD = MD5.Create();
            byte[] array = mD.ComputeHash(s);
            StringBuilder stringBuilder = new StringBuilder();
            byte[] array2 = array;
            for (int i = 0; i < array2.Length; i  )
            {
                byte b = array2[i];
                stringBuilder.Append(b.ToString("x").PadLeft(2, '0'));
            }
            return stringBuilder.ToString().ToUpper();
        }
        public static string EncryptQQWebMd5(string s)
        {
            MD5 mD = MD5.Create();
            byte[] bytes = Encoding.ASCII.GetBytes(s);
            byte[] array = mD.ComputeHash(bytes);
            StringBuilder stringBuilder = new StringBuilder();
            byte[] array2 = array;
            for (int i = 0; i < array2.Length; i  )
            {
                byte b = array2[i];
                stringBuilder.Append("\\x");
                stringBuilder.Append(b.ToString("x2"));
            }
            return stringBuilder.ToString();
        }
        public static string EncryptOld(string password, string verifyCode)
        {
            return QQMd5.smethod_0(QQMd5.EncyptMD5_3_16(password)   verifyCode.ToUpper());
        }
        public static string Encrypt(string qq, string password, string verifyCode)
        {
            return QQMd5.Encrypt((long)Convert.ToInt32(qq), password, verifyCode);
        }
        public static string Encrypt(long qq, string password, string verifyCode)
        {
            ByteBuffer byteBuffer = new ByteBuffer();
            byteBuffer.PushByteArray(QQMd5.EncyptMD5Bytes(password));
            byteBuffer.PushInt(0);
            byteBuffer.PushInt((uint)qq);
            QQMd5.EncryptQQWebMd5(password);
            byte[] s = byteBuffer.ToByteArray();
            string str = QQMd5.smethod_1(s);
            return QQMd5.smethod_0(str   verifyCode.ToUpper());
        }



    }
}