'发快捷方式到桌面
Dim appName = My.Application.Info.CompanyName & My.Application.Info.ProductName
Dim desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
Dim fileDesktop As FileInfo = New FileInfo(desktopPath + "\\" & appName & ".lnk")
If Not fileDesktop.Exists Then
Dim shell = New WshShell()
Dim shortcut = CType(shell.CreateShortcut(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) + "\\" & appName & ".lnk"), IWshShortcut)
shortcut.WorkingDirectory = System.Environment.CurrentDirectory
shortcut.WindowStyle = 1
shortcut.Description = appName
shortcut.IconLocation = Application.ExecutablePath
shortcut.TargetPath = Application.StartupPath + "\\" + My.Application.Info.AssemblyName & ".exe"
shortcut.Save()
End If
WshShell()与 IWshShortcut划波浪线了,是什么原因呢?百度的代码,不知道怎么写,请老师帮助写一下,谢 谢 ?
[此贴子已经被作者于2024/1/29 21:27:30编辑过]