FarPoint.Win.SpreadJ アセンブリ > FarPoint.Win.Spread 名前空間 > SheetView クラス > LoadTextFile メソッド : LoadTextFile(Stream,TextFileFlags,IncludeHeaders,String,String,String) メソッド |
'Declaration Public Overloads Sub LoadTextFile( _ ByVal stream As Stream, _ ByVal textFileFlags As TextFileFlags, _ ByVal includeHeaders As IncludeHeaders, _ ByVal rowDelimiter As String, _ ByVal columnDelimiter As String, _ ByVal cellDelimiter As String _ )
'使用法 Dim instance As SheetView Dim stream As Stream Dim textFileFlags As TextFileFlags Dim includeHeaders As IncludeHeaders Dim rowDelimiter As String Dim columnDelimiter As String Dim cellDelimiter As String instance.LoadTextFile(stream, textFileFlags, includeHeaders, rowDelimiter, columnDelimiter, cellDelimiter)
public void LoadTextFile( Stream stream, TextFileFlags textFileFlags, IncludeHeaders includeHeaders, string rowDelimiter, string columnDelimiter, string cellDelimiter )
例外 | 説明 |
---|---|
System.ArgumentException | セル区切り文字列を行または列の区切り文字列に含めることはできません。 |
OpenFileDialog ofd = new OpenFileDialog(); System.IO.Stream s; ofd.Filter = "text files (*.txt)|*.txt"; ofd.FilterIndex = 2; ofd.RestoreDirectory = true; if (ofd.ShowDialog() == DialogResult.OK) { s = ofd.OpenFile(); fpSpread1.ActiveSheet.LoadTextFile(s, FarPoint.Win.Spread.TextFileFlags.Unformatted, FarPoint.Win.Spread.Model.IncludeHeaders.None, "\n", ",", ""); s.Close(); }
Dim s As System.IO.Stream Dim ofd As New OpenFileDialog() ofd.Filter = "text files (*.txt)|*.txt" ofd.FilterIndex = 2 ofd.RestoreDirectory = True If ofd.ShowDialog() = DialogResult.OK Then s = ofd.OpenFile FpSpread1.ActiveSheet.LoadTextFile(s, FarPoint.Win.Spread.TextFileFlags.Unformatted, FarPoint.Win.Spread.Model.IncludeHeaders.None, Chr(10), ",", "") s.Close() End If