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. General Programming
  3. C#
  4. how can get a file path when user double click on it such as word files?

how can get a file path when user double click on it such as word files?

Scheduled Pinned Locked Moved C#
helpquestion
3 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.
  • B Offline
    B Offline
    B A
    wrote on last edited by
    #1

    hi. i create an application that user can save a file with .mnm extension. now i want to when user double click on this file, my application run and show the file content. such as a .txt file , that user double click on it, "note pad" run and show the content. my problem is that user click on a file can not get file's path. how can get file path ? tanks

    P 1 Reply Last reply
    0
    • B B A

      hi. i create an application that user can save a file with .mnm extension. now i want to when user double click on this file, my application run and show the file content. such as a .txt file , that user double click on it, "note pad" run and show the content. my problem is that user click on a file can not get file's path. how can get file path ? tanks

      P Offline
      P Offline
      pmarfleet
      wrote on last edited by
      #2

      If you have set up an association with a particular file type for your application, Windows will pass the file name to it as a command line argument when a file is selected. In the static void main(string[] args) method for your application, the file name can be referenced using args[0]. If you need to set up the file association programmatically, there is an article here on CodeProject[^] that explains how to do it.

      Paul Marfleet

      B 1 Reply Last reply
      0
      • P pmarfleet

        If you have set up an association with a particular file type for your application, Windows will pass the file name to it as a command line argument when a file is selected. In the static void main(string[] args) method for your application, the file name can be referenced using args[0]. If you need to set up the file association programmatically, there is an article here on CodeProject[^] that explains how to do it.

        Paul Marfleet

        B Offline
        B Offline
        B A
        wrote on last edited by
        #3

        tanks a lot , pmarfleet

        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