/// <summary>
 /// Gets the header from a dbf file.
 /// </summary>
 /// <param name="dbfFile">The DBF file.</param>
 /// <returns></returns>
 public static DbaseFileHeader GetHeader(string dbfFile)
 {
     if (!File.Exists(dbfFile))
         throw new FileNotFoundException(dbfFile + " not found");
     DbaseFileHeader header = new DbaseFileHeader();
     header.ReadHeader(new BinaryReader(new FileStream(dbfFile, FileMode.Open, FileAccess.Read, FileShare.Read)));
     return header;
 }
Esempio n. 2
0
            /// <summary>
            ///
            /// </summary>
            protected void ReadHeader()
            {
                _header = new DbaseFileHeader();
                // read the header
                _header.ReadHeader(_dbfStream);

                // how many records remain
                _readPosition = _header.HeaderLength;
            }
Esempio n. 3
0
        /// <summary>
        /// Gets the header from a dbf file.
        /// </summary>
        /// <param name="dbfFile">The DBF file.</param>
        /// <returns></returns>
        public static DbaseFileHeader GetHeader(string dbfFile)
        {
            if (!File.Exists(dbfFile))
            {
                throw new FileNotFoundException(dbfFile + " not found");
            }
            DbaseFileHeader header = new DbaseFileHeader();

            header.ReadHeader(new BinaryReader(new FileStream(dbfFile, FileMode.Open, FileAccess.Read, FileShare.Read)));
            return(header);
        }
Esempio n. 4
0
        /// <summary>
        /// Gets the header information for the dbase file.
        /// </summary>
        /// <returns>DbaseFileHeader contain header and field information.</returns>
        public DbaseFileHeader GetHeader()
        {
            if (_header == null)
            {
                FileStream   stream    = new FileStream(_filename, FileMode.Open, FileAccess.Read);
                BinaryReader dbfStream = new BinaryReader(stream);

                _header = new DbaseFileHeader();
                // read the header
                _header.ReadHeader(dbfStream);

                dbfStream.Close();
                stream.Close();
            }
            return(_header);
        }
Esempio n. 5
0
        /// <summary>
        /// Gets the header information for the dbase file.
        /// </summary>
        /// <returns>DbaseFileHeader contain header and field information.</returns>
        public DbaseFileHeader GetHeader()
        {
            if (_header==null)
            {
                FileStream stream = new FileStream(_filename, FileMode.Open, FileAccess.Read);
                BinaryReader dbfStream = new BinaryReader(stream);

                _header = new DbaseFileHeader();
                // read the header
                _header.ReadHeader(dbfStream);

                dbfStream.Close();
                stream.Close();

            }
            return _header;
        }
Esempio n. 6
0
            /// <summary>
            /// 
            /// </summary>
			protected void ReadHeader()
			{
				_header = new DbaseFileHeader();
				// read the header
				_header.ReadHeader(_dbfStream);

				// how many records remain
				_readPosition = _header.HeaderLength;
			}