Cavan
New member
Hi folks. Newbie user here! Hope Im in the right place - apologies if not.
Im having problems with the file handling syntax:
Im using:
File_Name = "\iPAQ File Store\locs.txt"
Dim sr As System.IO.StreamWriter = File.CreateText(File_Name)
sr.WriteLine(LB_LOCATION.Items(t))
to write data to a file. I can read the created file with no problem using Notepad.
However, using:
Dim sr As System.IO.StreamReader = New System.IO.StreamReader("\iPAQ File Store\locs.txt")
sline = sr.ReadLine
LB_LOCATION.Items.Add(sline)
to read the file in VB .net results in peculiar control characters being read in.
Any ideas what I am doing wrong? Is there another syntax I should use?
Many thanks
Cavan
Im having problems with the file handling syntax:
Im using:
File_Name = "\iPAQ File Store\locs.txt"
Dim sr As System.IO.StreamWriter = File.CreateText(File_Name)
sr.WriteLine(LB_LOCATION.Items(t))
to write data to a file. I can read the created file with no problem using Notepad.
However, using:
Dim sr As System.IO.StreamReader = New System.IO.StreamReader("\iPAQ File Store\locs.txt")
sline = sr.ReadLine
LB_LOCATION.Items.Add(sline)
to read the file in VB .net results in peculiar control characters being read in.
Any ideas what I am doing wrong? Is there another syntax I should use?
Many thanks
Cavan