/// <summary> 读取文件格式、版本 </summary> public static void _LoadFileFormatAndVersion(Stream aStream, ref string aFileFormat, ref ushort aVersion, ref byte aLang) { byte[] vBuffer = new byte[System.Text.Encoding.Unicode.GetByteCount(HC_EXT)]; aStream.Read(vBuffer, 0, vBuffer.Length); aFileFormat = System.Text.Encoding.Unicode.GetString(vBuffer, 0, vBuffer.Length); vBuffer = new byte[System.Text.Encoding.Unicode.GetByteCount(HC_FileVersion)]; aStream.Read(vBuffer, 0, vBuffer.Length); string vFileVersion = System.Text.Encoding.Unicode.GetString(vBuffer, 0, vBuffer.Length); aVersion = HC.GetVersionAsInteger(vFileVersion); if (aVersion > 19) aLang = (byte)aStream.ReadByte(); }
/// <summary> 读取文件格式、版本 </summary> public static void _LoadFileFormatAndVersion(Stream AStream, ref string AFileFormat, ref ushort AVersion, ref byte ALan) { byte[] vBuffer = new byte[System.Text.Encoding.Unicode.GetByteCount(HC_EXT)]; AStream.Read(vBuffer, 0, vBuffer.Length); AFileFormat = System.Text.Encoding.Unicode.GetString(vBuffer, 0, vBuffer.Length); vBuffer = new byte[System.Text.Encoding.Unicode.GetByteCount(HC_FileVersion)]; AStream.Read(vBuffer, 0, vBuffer.Length); string vFileVersion = System.Text.Encoding.Unicode.GetString(vBuffer, 0, vBuffer.Length); AVersion = HC.GetVersionAsInteger(vFileVersion); if (AVersion > 19) { ALan = (byte)AStream.ReadByte(); } }