How to make C #, VB. NET to implement complex binary operations

Source: Internet
Author: User
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

Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.