在utraledit32中16进制编辑器中查看“新建”这个字符串,得到D0 C2 BD A8
请问在C#中如何得到这样的结果?utraledit32用的是什么编码呢?

解决方案 »

  1.   

     byte[] _Temp = new byte[10];string _Value = BitConverter.ToString(_Temp);
      

  2.   

    我是想把字符串转成16进制,得到的结果要与在utraledit32中16进制编辑器中得到的一样.楼上的好像不行吧
      

  3.   

    string input = "Hello World!";
    char[] values = input.ToCharArray();
    foreach (char letter in values)
    {
        // Get the integral value of the character.
        int value = Convert.ToInt32(letter);
        // Convert the decimal value to a hexadecimal value in string form.
        string hexOutput = String.Format("{0:X}", value);
        Console.WriteLine("Hexadecimal value of {0} is {1}", letter, hexOutput);
    }http://msdn.microsoft.com/zh-cn/library/bb311038.aspx
      

  4.   

    Encoding.Default.GetBytes("");
    Encoding.XXXX.GetBytes("");