我正在使用以下代码创建Internet快捷方式。但是我设置的快捷方式的图标没有在桌面上显示。但是,如果我手动重命名其他名称的快捷方式工作正常(图标正在加载为快捷方式图像)。桌面上不显示互联网快捷方式窗口7的图标
private String CreateDeskTopShortcut(String ApplicationStartupUrl, String IconFilePath)
{
string deskDir = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
String UrlPath = deskDir + "\\" + "Test" + ".url";
using (StreamWriter writer = new StreamWriter(UrlPath))
{
writer.WriteLine("[InternetShortcut]");
writer.WriteLine("URL=" + ApplicationStartupUrl);
writer.WriteLine("IconFile=" + IconFilePath);
writer.WriteLine("IconIndex=0");
writer.Flush();
}
return UrlPath;
}
调用相同
CreateDeskTopShortcut("https://ipAddress/website/Login.aspx","E:\Setup_Local\Server.ico");
@BenRobinson - 不是真的。我刚刚在LINQPad中运行他的代码,并成功生成了一个快捷方式。 – pixelbadger
但其服务器的目的。其作为互联网捷径的工作。我面临的唯一问题是图标不加载相同。这是创建Internet快捷方式的可接受方式。 – amesh