2016-09-28 9 views

答えて

1

public static byte[] StringToByteArray(string hex) 
{ 
    return Enumerable.Range(0, hex.Length) 
        .Where(x => x % 2 == 0) 
        .Select(x => Convert.ToByte(hex.Substring(x, 2), 16)) 
        .ToArray(); 
} 


byte[] a = StringToByteArray("062A0633062A0020"); 
char[] c = System.Text.Encoding.BigEndianUnicode.GetChars(a); // تست 
関連する問題