Determine if exist in unknown folder
If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
6 posts
Page 1 of 1
Hello again boogy;
Got some problem and I dunno how to do it.
I want to check if a file from unknown folder exist idoit;
for example: I want to check a save_settings.dll in a user created folder "User"
Account/User/save_settings.dll
Account is the root folder
User will be the folder (unknown folder cause this may change depend on user input)
save_settings.dll the file to be check if exist.
location may vary depends on user input:
other example
Account/MyDog/save_settings.dll
Account/CoolApps/save_settings.dll
I hope you gets my problem blusho;
Got some problem and I dunno how to do it.
I want to check if a file from unknown folder exist idoit;
for example: I want to check a save_settings.dll in a user created folder "User"
Account/User/save_settings.dll
Account is the root folder
User will be the folder (unknown folder cause this may change depend on user input)
save_settings.dll the file to be check if exist.
location may vary depends on user input:
other example
Account/MyDog/save_settings.dll
Account/CoolApps/save_settings.dll
I hope you gets my problem blusho;
Code: Select all
user_created_folder is a String that represents the user created.If My.Computer.FileSystem.FileExists("Account\" + user_created_folder + "\save_settings.dll") Then
MessageBox.Show("The file exists!")
Else
MessageBox.show("The file does not exist!")
End If
No. My Project is separated to its main application.
To make it easy to understand. The one project will create user profile. The other project will check for file existence
To make it easy to understand. The one project will create user profile. The other project will check for file existence
You could use this code to list the user folders and check for the file:
Code: Select all
Dim users As String() = IO.Directory.GetDirectories("Account")
For Each user In users
Dim path As String = user & "\save_settings.dll"
If IO.File.Exists(path) Then
MsgBox("found " & path)
End If
Next
Hello mandai. Gonna try yours. Seems like this one is what I'm looking for boogy;
6 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023