string vname=stLocation;
string delimStr = @"\";
char [] mySp = delimStr.ToCharArray();
string[] myweb = vname.Split(mySp);

string desktop=Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
StreamWriter sw=new StreamWriter(File.Open(desktop+"\\系统.url",FileMode.Create,FileAccess.Write));
sw.WriteLine("[InternetShortcut]");
MessageBox.Show(strWebPort);
sw.WriteLine(string.Format("URL=http://{0}:{1}/{2}/FramePages/FrmMain.htm",Environment.MachineName,strWebPort,myweb[myweb.Length-2]));
sw.WriteLine("Modified=00B21CE31E06C30199");
sw.WriteLine( "IconFile=" + stLocation + "bin/" + "shell32.dll");
sw.WriteLine("IconIndex=13");
sw.Flush();
sw.Close();在生产快捷方式的时候
sw.WriteLine( "IconFile=" + stLocation + "bin/" + "shell32.dll");
sw.WriteLine("IconIndex=13");
这是用DLL文件的图标。
这一步怎样才能把快捷方式的图标指项我自己的ICO图标文件。
或告诉我怎样生成一个象shell32.dll的DLL 可以把路径指向它 就能获取我自己的图标文件!1

解决方案 »

  1.   

    用安装向导,然后添加个图标到安装包中,选择ICON属性为你要的图标
      

  2.   

    fellowcheng(浮云一小朵)  
    怎样选择 我的快捷方式是生成的,
    ico文件要指定路径 ,
    就是不会在快捷方式文件怎样来指定这个文件路径
      

  3.   

    我的程序打包有许多其它的功能 比如建数据库,对文件添加ASPNET的权限等,目前只会用这个来安装就是不能修改图标了 其它的问题都解决了
      

  4.   

    dotnet自带的安装程序能不能完成这样的功能??
    谁知道用C#写一个DLL ,根据上面的方法,图标文件的路径指向它