Working Directory
-
I've developed a plugin for an application, and the plugin goes in the /program files/app_name/plugins directory. My plugin contains a form and when I execute it, I need it to put the data it creates / downloads into the directory of the application, not the directory of the plugin. How do I get the application directory of the current executable? I've tried Assembly.GetCallingAssembly and Assembly.GetExecutingAssembly, but they provide me with the path to where my plugin is. I have the flexibility to further the design a little, but my only other option as I'm seeing it is putting giving the plugin the working path. I'm using .NETCF 2.0
-
I've developed a plugin for an application, and the plugin goes in the /program files/app_name/plugins directory. My plugin contains a form and when I execute it, I need it to put the data it creates / downloads into the directory of the application, not the directory of the plugin. How do I get the application directory of the current executable? I've tried Assembly.GetCallingAssembly and Assembly.GetExecutingAssembly, but they provide me with the path to where my plugin is. I have the flexibility to further the design a little, but my only other option as I'm seeing it is putting giving the plugin the working path. I'm using .NETCF 2.0
If I get it right: plugin folder: /program files/app_name/plugins download folder: /program files/app_name/downloads you can use Win API -
GetModuleFileName(NULL, ...)
If the plugin is a separate process it will return: /program files/app_name/plugins/plugin_name If not it will return: /program files/app_name/app_name.exe I hope from here you can adjust to /downlads P.S. In MS world you need '\', not '/' :laugh: