strconv in c#???

Posted on 2007-08-07
Last Modified: 2013-11-05
I am trying to migrate the following code...

    str = StrConv(bytes, vbUnicode)

to c#...

any ideas?
Question by:rodmjay
    LVL 22

    Accepted Solution

    I think this is what you need. It converts a byte array to a string.

    string s = ASCIIEncoding.ASCII.GetString(bytes);
    LVL 13

    Assisted Solution

    Hi rodmjay

    if you want to treat your byte array as unicode you can use the following code:
    string str = System.Text.Encoding.Unicode.GetString(bytes);

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
    Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now