// Create two different encodings.
Encoding ascii = Encoding.ASCII;
Encoding unicode = Encoding.Unicode;
// Convert the string into a byte array.
byte[] unicodeBytes = unicode.GetBytes(FileName_Main);
// Perform the conversion from one encoding to the other.
byte[] asciiBytes = Encoding.Convert(unicode, ascii, unicodeBytes);
int result = Convert.ToInt16(Math.Ceiling(asciiBytes.Length / 4.0));
for (int i = 0; i < result; i++)
{
int Reg = i;
Int32 idata = BitConverter.ToInt32(asciiBytes, i * 4);
}
測試環境:VS2015 C#.NET
沒有留言:
張貼留言