How to get command line from a ClickOnce application?

后端 未结 1 1280
花落未央
花落未央 2020-12-11 16:29

Before publishing I went to Project -> Properties -> Options -> File Associations and added the extension \".hsp\". Set an icon and a ProgID (\"MyCompany.Document.1\" for te

相关标签:
1条回答
  • 2020-12-11 16:43

    When you publish an app with ClickOnce and then launch it by double-clicking an associated file, the path to that file actually gets stored here:

    AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData[0]
    

    See MSDN's documentation for it here:

    http://msdn.microsoft.com/en-us/library/system.runtime.hosting.activationarguments.aspx

    Plus a tutorial on adding file associations to "Published" projects:

    http://blogs.msdn.com/b/mwade/archive/2008/01/30/how-to-add-file-associations-to-a-clickonce-application.aspx

    0 讨论(0)
提交回复
热议问题