STRING TO HEX how to add in a vector ob bytes?

前端 未结 4 1597
一整个雨季
一整个雨季 2020-12-22 15:50

I have the following code:

string s =   \"2563MNBJP89256666666685755854\";
            Byte[] bytes = encoding.GetBytes(s);
            string hex = \"\";
           


        
相关标签:
4条回答
  • 2020-12-22 16:03

    Isn't bytes already the list of bytes you want?

    0 讨论(0)
  • 2020-12-22 16:09

    For C# you could try

    System.Text.ASCIIEncoding  encoding=new System.Text.ASCIIEncoding();
    Byte[] bytes = encoding.GetBytes(strVar);//strVar is the string variable
    
    0 讨论(0)
  • 2020-12-22 16:12

    C#: System.Text.Encoding.ASCII.GetBytes("test")

    0 讨论(0)
  • 2020-12-22 16:17

    in C# you can use Encoding.GetBytes Method

    0 讨论(0)
提交回复
热议问题