LoginSignup
1
1

More than 1 year has passed since last update.

VB.NETのClickOnceで引数を取りたい

Last updated at Posted at 2022-03-18

ClickOnceで引数を取る方法

VB.NET
        If (ApplicationDeployment.IsNetworkDeployed) Then
            'ClickOnce application

            '起動側の記述例 hoge.exe.appref-ms "引数1,引数2,引数3"
            'ActivationData(0)に"引数1,引数2,引数3"が入ってきます。

            Dim url As String = AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData(0)

            '引数の数をカウントする
            argsCnt = CountChar(url, ",")

            '引数があれば配列に格納する
            If argsCnt > 0 Then
                arg = url.Split(",")
            End If

        Else
            'normal application
            'Dim args() As String = Environment.GetCommandLineArgs()
        End If
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1