I know I can do basic text searches to see if the text is there but I have no idea how to actually pull some select data out of a text file into a variable.
I can search with something like this function:
Private Function CheckFile(ByVal FileName As String, ByVal strSearch As String) As Boolean Dim s As String = My.Computer.FileSystem.ReadAllText(FileName) If InStr(s, strSearch) Then Return True Else Return False End If End Function
But lets say my text file contains the following:
<add name="MAIN" server="192.168.1.103\SQLSERVER" database="PCMain" trustedConnection="false" />
and I want to put MAIN, 192.168.1.103\SQLSERVER and PCMain into variable's how would I do that?
If you can help me can you also please help me understand the code?