Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/291.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 为网站添加网站快捷方式:http://www.google.com 在用户程序中?_C#_Winforms_Shortcut_Setup Deployment - Fatal编程技术网

C# 为网站添加网站快捷方式:http://www.google.com 在用户程序中?

C# 为网站添加网站快捷方式:http://www.google.com 在用户程序中?,c#,winforms,shortcut,setup-deployment,C#,Winforms,Shortcut,Setup Deployment,我想在Windows窗体C#中的用户程序(启动-->所有程序)中为网站添加网站快捷方式,同时安装软件安装程序,并像在用户程序中一样安装:- 演示(所有程序中的文件夹) -演示软件快捷方式 -网站链接 提前感谢您不需要指定创建它的方式或内容。以完全手工的方式 string fullURLYouWant = "http://www.google.com/"; using (StreamWriter writer = new StreamWriter(yourPath + "\\" + yourSho

我想在Windows窗体C#中的用户程序(启动-->所有程序)中为网站添加网站快捷方式,同时安装软件安装程序,并像在用户程序中一样安装:-

演示(所有程序中的文件夹)

-演示软件快捷方式

-网站链接


提前感谢

您不需要指定创建它的方式或内容。以完全手工的方式

string fullURLYouWant = "http://www.google.com/";
using (StreamWriter writer = new StreamWriter(yourPath + "\\" + yourShortCutFileName + ".url"))
{
    writer.WriteLine("[InternetShortcut]");
    writer.WriteLine("URL=" + fullURLYouWant);
    writer.WriteLine("IconIndex=0");
    writer.WriteLine("IconFile=" + iconFileForYourUrl);
    writer.Flush();
}

您使用的是哪种安装系统,还是自定义安装系统?来自“eis”的答案非常有效,但我需要说的是,“fullURLYouWant”URL需要“/”,如果不是URL链接不起作用,我花了一些时间找到此解决方案-/你好,Eis,问题解决了,我从这个链接中得到了一个参考:-谢谢:-)我看不到这个链接提供的web URL是什么样子的,但是可能也有一种方法可以通过接口来实现。如果您指定希望使用VisualStudio进行此操作,而不是以编程方式进行此操作,那就太好了。但当然,我并没有说那里有什么问题,恰恰相反。