Answered read text file from string

jkatshor

Member
Joined
Mar 20, 2009
Messages
11
Programming Experience
Beginner
Hi everyone,

my code is;
VB.NET:
[B]Dim programpath As String[/B]
[B]Dim inspectionfile As String[/B]
[B]programpath = My.Computer.FileSystem.ReadAllText("C:\InspPath.txt")[/B]
    'the contents of insppath.txt is [B]c:\working\files [/B]   
[B]inspectionfile = programpath + "\inspection.txt"[/B]
   'the string inspectionfile reads [B]c:\working\files\inspection.txt[/B]
I need to read the text file saved in the string inspectionfile, How do I do this?

Thanks in advance...
ANSWER********************************
I posted a way to achieve the above yesterday but it had a glitch, here is a another solution that works better ( for me anyway)
VB.NET:
Dim programpath, inspfiletext As String
programpath = My.Computer.FileSystem.ReadAllText("c:\working\files\InspPath.txt")
My.Computer.FileSystem.CurrentDirectory = programpath
inspfiletext = My.Computer.FileSystem.ReadAllText("inspection")
 
Last edited:
Back
Top