You can get the path where the assembly is running with
Dim fullPath = System.Reflection.Assembly.GetExecutingAssembly().Location
Dim folderName = Path.GetDirectoryName( fullPath )
Dim strFilePath = Path.Combine(folderName, "ClientAccessList.txt")
if you want to refer to the current user personal folder for this application then the way to go is through the Environment.SpecialFolder enumaration.
This enum is independent from the underlying OS (XP, Win7, x64, x32 etc)
In this case you could use:
Dim fullPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
Dim strFilePath = Path.Combine(fullPath, "your_app_reserved_folder", "ClientAccessList.txt")
In this example "your_app_reserved_folder"
should be a folder created during installation of your application where you put per user data files. (Usually this is the recommended way to go to store data files that should be kept separated by user)
If you want to check the existence of the folder before trying to use it just encapsulate the logic to get the file name in a method
Public Function GetUserAppClientAccessList() As String
Dim fullPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
Dim appFolder = Path.Combine(fullPath, "your_app_reserved_folder")
if Not Directory.Exists(appFolder) then
Directory.Create(appFolder)
End If
return = Path.Combine(appFolder, "ClientAccessList.txt")
End Function