//List<long> _seekPoint = new List<long>(); public void LoadFile(String fileName, bool isInit, int columns = -1) { if (columns > 0) { _cols = columns; T_Columns.Text = _cols.ToString(); } _isInit = isInit; _fileName = fileName; this.Text = fileName.Substring(fileName.LastIndexOf('\\') + 1) + "[" + fileName.Substring(0, (fileName.LastIndexOf('\\')) + 1) + "]"; if (File.Exists(fileName) == false) { if (fileName.Length > 0) { MessageBox.Show(fileName + " 그런 파일이 없습니다."); } return; } _nowLine = 0; //_seekPoint.Clear(); if (isInit) { _totalLines = 0; } if (_fileStream != null) { try { _fileStream.Close(); } catch { } } _fileStream = File.OpenRead(fileName); if (_isInit) { V_Data.ClearData(); V_Data.ClearTitles(); List <String> titles = new List <string>(); _cols = Convert.ToInt32(T_Columns.Text); if (_cols <= 0) { _cols = 16; //default 16 } for (int i = 0; i < _cols; i++) { titles.Add(string.Format("{0:X2}", i)); } SetTitles(titles.ToArray()); } else { V_Data.ClearData(); } //_seekPoint.Add(_fileReader.BaseStream.Position); //제목을 제외한 제일 첫 줄. if (V_Data.ColumnCount > 0) { C_Title.SelectedIndex = 0; } _loadFileThread = new Thread(new ThreadStart(loadFile)); _loadFileThread.Start(); }
//List<long> _seekPoint = new List<long>(); public void LoadFile(String fileName, bool isInit) { _isInit = isInit; _fileName = fileName; this.Text = fileName.Substring(fileName.LastIndexOf('\\') + 1) + "[" + fileName.Substring(0, (fileName.LastIndexOf('\\')) + 1) + "]"; if (File.Exists(fileName) == false) { if (fileName.Length > 0) { MessageBox.Show(fileName + " 그런 파일이 없습니다."); } return; } _nowLine = 0; //_seekPoint.Clear(); if (isInit) { _totalLines = 0; } if (_fileReader != null) { try { _fileReader.Close(); } catch { } } _fileReader = File.OpenText(fileName); if (_isInit) { V_Data.ClearData(); V_Data.ClearTitles(); String line; line = _fileReader.ReadLine(); if (line == null) { _fileReader.Close(); this.ResumeLayout(); return; } addTitle(line); } else { V_Data.ClearData(); } //_seekPoint.Add(_fileReader.BaseStream.Position); //제목을 제외한 제일 첫 줄. if (V_Data.ColumnCount > 0) { C_Title.SelectedIndex = 0; } _loadFileThread = new Thread(new ThreadStart(loadFile)); _loadFileThread.Start(); }