I am making a libary file with functions for extra credit for computer programming and everything works fine but when i execute the program without the libary file in the same dictionary it crashes and im looking for a way so that it wont crash but can not find a way to check for the file no matter where its at
example if the two files are in C://Files
then it will run with out a problem but if just the executable is just in C://Files i want a message box to pop up saying LibaryFileName.dll is missing and i want it to check for the Dll file no matter what folder the two are in but will detect it if its in the same folder as the executable
From what I understand, you’re trying to determine if a file exists in the same directory as your executable.
Here’s an example of what you’re tying to achieve:
If you have the complete path, it will check at that path
If you only have a partial path, it will search the directories where the executable is.
For instance, the following code will check if
text.txtexists in the same directory as the executable.Also, you will need to use
Imports System.IO. You can changetext.txtto any file you want to verify if it exists.