重複の可能性:
Java の getBytes() と C# の同等物
Java の場合:
String s="abcde";
byte bar[] = s.getBytes();
C# の場合:
for (int i = 0; i < s.Length; i++)
{
bar[i] = Convert.ToByte(s.Substring(i, 1));
}
Java の例 getBytes を使用して C# コードを変換しました。しかし、上記の C# コードは機能しません。