我跟随代码,以使一个字符串到CFString字符串:CFString为字符串?
internal static byte[] StringToCFString(string value)
{
byte[] b;
b = new byte[value.Length + 10];
b[4] = 0x8c;
b[5] = 07;
b[6] = 01;
b[8] = (byte)value.Length;
Encoding.ASCII.GetBytes(value, 0, value.Length, b, 9);
return b;
}
public static byte[] StringToCString(string value)
{
byte[] bytes = new byte[value.Length + 1];
Encoding.ASCII.GetBytes(value, 0, value.Length, bytes, 0);
return bytes;
}
我怎样才能得到一个CFString字符串到字符串回来? (C#.NET 2.0)
此代码的某些解释可能有用 – 2012-10-16 22:06:04