小编use*_*819的帖子

在我的winform上添加一个按钮来运行Snipping Tool应用程序

我试图通过单击Winform项目上的按钮来运行SnippingTool应用程序应用程序.我试过单独使用下面这三个函数:

   private void button3_Click(object sender, EventArgs e)
        {
            Process SnippingTool = new Process();
            String FilePath = @"C:\WINDOWS\system32\SnippingTool.exe";
            SnippingTool.StartInfo.FileName = System.IO.Path.GetDirectoryName(FilePath);
            SnippingTool.StartInfo.Arguments = "SnippingTool.exe";
            SnippingTool.Start();
        }

    private void button3_Click(object sender, EventArgs e)
        {            System.Diagnostics.Process.Start("C:\\WINDOWS\\system32\\SnippingTool.exe");
}

    private void button3_Click(object sender, EventArgs e)
        {            System.Diagnostics.Process.Start("C:\WINDOWS\system32\SnippingTool.exe");
}
Run Code Online (Sandbox Code Playgroud)

但没有任何作用.我总是收到两条错误消息.

或者通过使用第一个函数,它将打开C:\ WINDOWS\system32文件夹,而不是启动应用程序.

能否请你帮忙?

c# button hyperlink winforms

0
推荐指数
1
解决办法
1636
查看次数

标签 统计

button ×1

c# ×1

hyperlink ×1

winforms ×1