Beispiel #1
0
        private static FileHeaderConfig GetJpgConfig()
        {
            FileHeaderConfig _config;
            List <byte[]>    _prefixBytes;

            _prefixBytes = new List <byte[]>();
            _prefixBytes.Add(new byte[] { 255, 216, 255, 224 });

            _config             = new FileHeaderConfig();
            _config.Name        = "jpg";
            _config.Extensions  = new string[] { "jpg" };
            _config.PrefixBytes = _prefixBytes;

            return(_config);
        }
Beispiel #2
0
        private static FileHeaderConfig GetGifConfig()
        {
            FileHeaderConfig _config;
            List <byte[]>    _prefixBytes;

            _prefixBytes = new List <byte[]>();
            _prefixBytes.Add(new byte[] { 71, 73, 70, 56 });

            _config             = new FileHeaderConfig();
            _config.Name        = "gif";
            _config.Extensions  = new string[] { "gif" };
            _config.PrefixBytes = _prefixBytes;

            return(_config);
        }
Beispiel #3
0
        private static FileHeaderConfig GetPngConfig()
        {
            FileHeaderConfig _config;
            List <byte[]>    _prefixBytes;

            _prefixBytes = new List <byte[]>();
            _prefixBytes.Add(new byte[] { 137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82 });

            _config             = new FileHeaderConfig();
            _config.Name        = "png";
            _config.Extensions  = new string[] { "png" };
            _config.PrefixBytes = _prefixBytes;

            return(_config);
        }
Beispiel #4
0
        private static FileHeaderConfig GetPdfConfig()
        {
            FileHeaderConfig _config;
            List <byte[]>    _prefixBytes;

            _prefixBytes = new List <byte[]>();
            _prefixBytes.Add(new byte[] { 37, 80, 68, 70 });

            _config             = new FileHeaderConfig();
            _config.Name        = "pdf";
            _config.Extensions  = new string[] { "pdf" };
            _config.PrefixBytes = _prefixBytes;

            return(_config);
        }
Beispiel #5
0
        private static FileHeaderConfig GetXlsxConfig()
        {
            FileHeaderConfig _config;
            List <byte[]>    _prefixBytes;

            _prefixBytes = new List <byte[]>();
            _prefixBytes.Add(new byte[] { 80, 75, 3, 4, 20 });

            _config             = new FileHeaderConfig();
            _config.Name        = "xlsx";
            _config.Extensions  = new string[] { "xlsx" };
            _config.PrefixBytes = _prefixBytes;

            return(_config);
        }
Beispiel #6
0
        private static FileHeaderConfig GetXlsConfig()
        {
            FileHeaderConfig _config;
            List <byte[]>    _prefixBytes;

            _prefixBytes = new List <byte[]>();
            _prefixBytes.Add(new byte[] { 208, 207, 17, 224, 161, 177, 26, 225 });

            _config             = new FileHeaderConfig();
            _config.Name        = "xls";
            _config.Extensions  = new string[] { "xls" };
            _config.PrefixBytes = _prefixBytes;

            return(_config);
        }
Beispiel #7
0
        private static FileHeaderConfig GetDocConfig()
        {
            FileHeaderConfig _config;
            List <byte[]>    _prefixBytes;

            _prefixBytes = new List <byte[]>();
            _prefixBytes.Add(new byte[] { 208, 207, 17, 224, 161, 177, 26, 225, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 0, 3, 0, 254, 255, 9, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 });

            _config             = new FileHeaderConfig();
            _config.Name        = "doc";
            _config.Extensions  = new string[] { "doc" };
            _config.PrefixBytes = _prefixBytes;

            return(_config);
        }