Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Mobile Development
  3. Mobile
  4. Working Directory

Working Directory

Scheduled Pinned Locked Moved Mobile
questioncsharpdesign
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hammerstein05
    wrote on last edited by
    #1

    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

    A 1 Reply Last reply
    0
    • H hammerstein05

      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

      A Offline
      A Offline
      akirilov
      wrote on last edited by
      #2

      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:

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups