Beispiel #1
0
        public static string GetFileClassCode(string filePath)
        {
            filePath = Globals.GetphysicsPath(filePath);
            FileStream fileStream = new FileStream(filePath, FileMode.Open);

            byte[] buffer = new byte[fileStream.Length];
            fileStream.Read(buffer, 0, 2);
            fileStream.Close();
            fileStream.Dispose();
            MemoryStream memoryStream = new MemoryStream(buffer);
            BinaryReader binaryReader = new BinaryReader(memoryStream);
            string       text         = "";

            try
            {
                byte b = binaryReader.ReadByte();
                text  = b.ToString();
                b     = binaryReader.ReadByte();
                text += b.ToString();
            }
            catch
            {
            }
            binaryReader.Close();
            memoryStream.Close();
            return(text);
        }