Hello,
Is there any way I can get the form's executable path?
I tried to use the following code, but it does not work.
[System.Windows.Forms.Application.StartupPath]
There may an assembly that I need to load, but I don't know how.
Thanks.
Get the form's executable path
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: Get the form's executable path
There is a code snippet called getscriptdirectory which inserts a function that will give you the path of the script or packaged exe.
You can also find this function in the Global.ps1 of a Form project.
Correction to your code. It should be:
David
You can also find this function in the Global.ps1 of a Form project.
Correction to your code. It should be:
PowerShell Code
Double-click the code block to select all.[System.Windows.Forms.Application]::StartupPathNote: This should also work in form exe.
David
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Get the form's executable path
Davidc,
Thank you for the information. I also found this out myself after I had posted this message.
I just had to use the static method to get the StartupPath of the form's executable file path.
Thanks again.
Thank you for the information. I also found this out myself after I had posted this message.
I just had to use the static method to get the StartupPath of the form's executable file path.
Thanks again.