How do you set up a file association with a click-once application?

前端 未结 1 1831
一个人的身影
一个人的身影 2021-02-04 12:36

I have a click-once application.

I have an associated file that I store the application\'s data in.

When a user clicks on one of these files I want it to open th

相关标签:
1条回答
  • 2021-02-04 13:06

    When using Click Once, arguments are not passed in on the command line, they are passed in through the Click Once deployment system:

    AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData
    

    For example, in your Program.cs file:

    foreach (string commandLineFile in AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData)
    {
        MessageBox.Show( string.Format("Command Line File: {0}", commandLineFile) );
    }
    

    Hope this helps.

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