Source code for identifying QQ verification codes (C #/NET1.1)
Source: Internet
Author: User
Source code for identifying QQ verification codes (C #/NET1.1)
Using System;
Namespace QQ
{
/// <Summary>
/// Summary of yzm.
/// </Summary>
Public class yzm
{
Public yzm (public System. Drawing. Bitmap pic)
{
This. bp = pic;
}
/// <Summary>
/// Store an int value into a 4-byte array (conversion starts from the high address, and the value of the highest address is included in the "and operation" with an unsigned integer ")
/// </Summary>
/// <Param name = "thevalue"> int value to be processed </param>
/// <Param name = "thebuff"> character array for storing information </param>
Public static void getbytesfromint (int thevalue, byte [] thebuff)
{
Long v1 = 0; long v2 = 0; long v3 = 0; long v4 = 0;
Uint b1 = (uint) 4278190080; uint b2 = (uint) 16711680; uint b3 = (uint) 65280; uint b4 = (uint) 255;
V1 = thevalue & b1;
V2 = thevalue & b2;
V3 = thevalue & b3;
V4 = thevalue & b4;
Thebuff [0] = (byte) (v1> 24 );
Thebuff [1] = (byte) (v2> 16 );
Thebuff [2] = (byte) (v3> 8 );
Thebuff [3] = (byte) v4;
}
/// <Summary>
/// Store a ushort value into a byte array of 2 bytes (conversion starts from the high address, and the value of the highest address is involved in the "and operation" with an unsigned integer ")
/// </Summary>
/// <Param name = "thevalue"> ushort value to be processed </param>
/// <Param name = "thebuff"> character array for storing information </param>
Public static void getbytesfromushort (ushort thevalue, byte [] thebuff)
{
Ushort v1 = 0; ushort v2 = 0;
Ushort b1 = (ushort) 65280; ushort b2 = (ushort) 255;
V1 = (ushort) (thevalue & b1 );
V2 = (ushort) (thevalue & b2 );
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service