Vb. NET and C # belong to the high-level language, the support of the bits operation is not very good, such as no shift operation, such as the use of the time is indeed very inconvenient, so in the leisure I have a new encapsulation for C #, VB. Net of the bit Operation class Library, through this class library can realize data shift, cycle shift, convert to binary, convert binary to data etc.
The corresponding class library can be found in my resource page, and descriptions of class members can be viewed through the Object Browser
Copy Code code as follows:
Imports BitOperatorLibrary.ShiftOperation.CircularShiftOperation
Imports BitOperatorLibrary.ShiftOperation.NormalShiftOperation
Imports Bitoperatorlibrary.bitconvert
Module Module1
Sub Main ()
Console.WriteLine ("Hexadecimal number 0x2f2e left one after the result is 0x{0}. ", Hex (_rol_16_ (&h2f2e)))
Console.WriteLine ("Hexadecimal number 0x2f2e loop left one after the result is 0x{0}. ", Hex (_crol_16_ (&h2f2e)))
Console.WriteLine ("Hexadecimal number 0x2f2e right one after the result is 0x{0}." ", Hex (_ror_16_ (&h2f2e)))
The result of the Console.WriteLine ("Hexadecimal number 0x2f2e loop to the right one" is 0x{0}. ", Hex (_cror_16_ (&h2f2e)))
Console.WriteLine ("Hexadecimal number 0xfe1a2d binary string is {0}.") ", Getbinarystring (&hfe1a2d))
Console.WriteLine (The result of the 8th bit of the hexadecimal number 0xfe1a2d is set to 1 is 0x{0}. ", Hex (Setbitstate (&hfe1a2d, 7, True))
Console.readkey ()
End Sub
End Module