我创建了一个程序,该程序使用某些库生成通过打开的文件对话框选择的特定EXE的快捷方式。我可以使用它,但是我希望程序在目标路径中添加一个参数,使其看起来像这样:("E:\Cod4\iw3mp.exe" +Seta Map mp_crash)。如何+ Seta Map mp_Crash在"标记后添加()部分而不删除它或破坏.exe扩展名?
这是我编写的用于添加参数的代码块:
label1.Text = openFileDialog1.FileName;
shortcut.TargetPath = label1.Text + " Seta Map mp_crash";
shortcut.Save();
Run Code Online (Sandbox Code Playgroud)
这段代码会将seta部分添加到目标中,但会破坏扩展名,看起来像这样 "E:\Cod4\iw3mp.exe Seta Map mp_crash "
请帮忙。这是完整的代码:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using IWshRuntimeLibrary;
using System.IO;
namespace WindowsFormsApplication18
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent(
);
}
public void CreateShortcut()
{
object shDesktop = (object)"Desktop";
WshShell shell = …Run Code Online (Sandbox Code Playgroud)