I have a function that reads a text file that contains information about the sql database it connects to. It has to be invoked across multiple forms. How could I make it to where it is invoked once and then stores into variables that the program can continue to use no matter which class it's under?
Here's the code:
'Begin reading config file to receive database info Dim fileReader As System.IO.StreamReader fileReader = My.Computer.FileSystem.OpenTextFileReader("config.txt") Dim configvars(0 To 3) As String Dim count As Integer = 0 Do Until count = 4 configvars(count) = fileReader.ReadLine() count = count + 1 Loop