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 );