I need my application to searching a text file for a word and once found i want to be able to get what is after that word.
What i am looking for is:
U_SHELL_FOLDERS_CACHE="%USERPROFILE%\Local Settings\Temporary Internet Files"
For example:
my program will search for U_SHELL_FOLDERS_CACHE=
Now, once found i need to be able to find what is after this then display it in a textbox and to also be able to modify it.
Display and modify this line.
"%USERPROFILE%\Local Settings\Temporary Internet Files"
I can at the moment read a text file, find words and replace them then write back to the text file.
Dim Cache As String = "U_SHELL_FOLDERS_CACHE="
fileContents = My.Computer.FileSystem.ReadAllText("C:\SFE\Temp\HIVEDEF.inf")
fileContents = Replace(fileContents, Cache, USERINPUT)
My.Computer.FileSystem.WriteAllText("C:\SFE\temp\HIVEDEF.inf", fileContents, False)
USERINPUT would be a user input like. C:\My Files\Internet Cache
So when written back to the text file it would look like
U_SHELL_FOLDERS_CACHE="C:\My Files\Internet Cache"
Many Thanks for any help.
Worf
This post has been edited by Worf: 15 December 2008 - 06:59 PM

New Topic/Question
Reply




MultiQuote




|