Hello
I'm having difficultly to create public strings that i can use in all forms
I'm trying with Module to do it:
Imports Nini.Config
Imports System.IO
Public Module Settings
Public MyConfigFile As String = ".\Settings.ini"
Public MyVNCFile As String = ".\Create.vnc"
Public BackUPFolder As String = ".\BackUP"
Public VNCFolder As String = ".\VNC"
'Read Source File
Public source As New IniConfigSource(MyConfigFile)
'Read Strings From File
Public fileName As String = source.Configs("Update").Get("Url")
Public columns As String = source.Configs("Update").Get("Info")
End Module
and when i use in Form1 the strings i got debug mode but not display anything just show that it doesn't read the string correct:
Example:
Public Sub CheckFolders()
'Dim Path As String = ".\BackUP"
'Dim Path2 As String = ".\VNC"
If Not Directory.Exists(Settings.BackUPFolder) Then
Directory.CreateDirectory(Settings.BackUPFolder)
End If
If Not Directory.Exists(Settings.VNCFolder) Then
Directory.CreateDirectory(Settings.VNCFolder)
End If
End Sub
But it crash, any ideas how to make this strings correct?
What I have tried:
Tried with Module to create it, example is on top, but it crash it looks like it doesn't has any value setted up in this string i do not know why, can someone tell me how to make it correct or where i make wrong.?