c# 如何通过代码删除删除程序创建的快捷方式?

d盘有一个a.exe 的程序 代码是这么写的

 WshShell shell = new WshShell();

           //快捷键方式创建的位置、名称
            IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut( Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) +  "\\" + "上传更新程序.lnk");
            shortcut.TargetPath = @Application.StartupPath+"\\auto.AutoTranUpdate.exe"; //目标文件
            shortcut.WorkingDirectory = System.Environment.CurrentDirectory;
            shortcut.WindowStyle = 1; //目标应用程序的窗口状态分为普通、最大化、最小化【1,3,7】
            shortcut.Description = "自动更新程序"; 
            shortcut.IconLocation = Application.StartupPath + "\\App.ico";  //快捷方式图标

            shortcut.Arguments = "";
           shortcut.Hotkey = "CTRL+ALT+F11"; // 快捷键
            shortcut.Save(); //必须调用保存快捷才成创建成功

运行之后桌面就产生了一个快捷方式 我如果想通过代码删除这个快捷方式 该如何做呢?

快捷方式就是一个后缀为link的文件,用File.Delete就可以了。

另外,如果你是要做安装/卸载程序,直接用installshield或者inno setup等工具做就可以了。无需自己写程序。