Hi There,
The following code here is abt choosing a file from a file chooser and capturing the contents of that file:
VB.NET:
[size=2]
dlgOpen.InitialDirectory = "C:\Desktop"
dlgOpen.Filter = " D (*.doc;*.htm;*.html *.txt; *.rtf; *.xls; *.xlw)| *.doc; *.htm; *.html; *.txt; *.rtf; *.xls; *.xlw"
[size=2]dlgOpen.RestoreDirectory = [/size][size=2][color=#0000ff]True[/color][/size]
[size=2][color=#0000ff]If[/color][/size][size=2] dlgOpen.ShowDialog() = DialogResult.OK [/size][size=2][color=#0000ff]Then [/color][/size]
[color=#0000ff] [size=2]Dim[/size][/color][size=2] display [/size][size=2][color=#0000ff]As[/color][/size][size=2][color=#0000ff]New[/color][/size][size=2] System.IO.StreamReader(dlgOpen.FileName[/size]
[size=2] txttext.Text = (display.ReadToEnd)[/size]
[size=2] display.Close()
My qn is if there is a way to read a line of the selected text file for instance and then put in arrays of string? do i need a stream reader for this?
thanks
[/size]