用C#怎么将一程序的图标发往桌面的快捷方式? 放到用户桌面就行了C:\Documents and Settings\All Users\桌面 (win2K,2003) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在.net自带的部署中,有一个桌面选项,就可以把快捷方便拖进来。 用FileShortcut类~FileShortcut fs=new FileShortcut(applicationPath);fs.SaveAs(anotherApplicationPath); 下面textBox1可以输入远程服务器的,如果在本机可以不要//引用COM组件Windows Script Host Object Model; if(textBox1.Text.Length>0) { //设置一个快捷方式 IWshRuntimeLibrary.WshShell shell = new IWshRuntimeLibrary.WshShellClass(); IWshRuntimeLibrary.IWshShortcut shortcut = (IWshRuntimeLibrary.IWshShortcut)shell.CreateShortcut(@"C:\Documents and Settings\All Users\桌面\Hoten数据导入程序.lnk"); shortcut.TargetPath = @"\\" + textBox1.Text + @"\eport\help\Import2Oracle.exe"; //shortcut.Arguments = "c:\\a.txt"; shortcut.Description = "Hoten数据导入程序"; shortcut.Hotkey = "CTRL+SHIFT+N"; shortcut.IconLocation = @"c:\hoten\bin\Sunflower.ico"; shortcut.Save(); Application.Exit(); //得到快捷方式属性 //shortcut = (IWshRuntimeLibrary.IWshShortcut)shell.CreateShortcut(@"C:\Documents and Settings\All Users\桌面\Hoten数据导入程序.lnk"); //MessageBox.Show(shortcut.Description); } 怎么实现窗体的左右摆动 下面的代码能实现向右摆动 求一个正则表达式 变量的小问题...... WinForm如何关闭指定窗口 [求助]c# 手动删除数据 实现DataRow.Item pda上手写笔长期点住一点,会出现一个菜单.请问长期按住一点是什么事件? 来看一下我写这个类吧! 无法释放BufferedGraphicsContext asp.net留言问题 在picturebox里gif图片显示不完全 .net中如何动态导出dll文件,再现等待。。。。。。。。。。。? 数据读取器SqlDataReader的困惑????
FileShortcut fs=new FileShortcut(applicationPath);
fs.SaveAs(anotherApplicationPath);
if(textBox1.Text.Length>0)
{ //设置一个快捷方式
IWshRuntimeLibrary.WshShell shell = new IWshRuntimeLibrary.WshShellClass();
IWshRuntimeLibrary.IWshShortcut shortcut = (IWshRuntimeLibrary.IWshShortcut)shell.CreateShortcut(@"C:\Documents and Settings\All Users\桌面\Hoten数据导入程序.lnk");
shortcut.TargetPath = @"\\" + textBox1.Text + @"\eport\help\Import2Oracle.exe";
//shortcut.Arguments = "c:\\a.txt";
shortcut.Description = "Hoten数据导入程序";
shortcut.Hotkey = "CTRL+SHIFT+N";
shortcut.IconLocation = @"c:\hoten\bin\Sunflower.ico";
shortcut.Save();
Application.Exit(); //得到快捷方式属性
//shortcut = (IWshRuntimeLibrary.IWshShortcut)shell.CreateShortcut(@"C:\Documents and Settings\All Users\桌面\Hoten数据导入程序.lnk");
//MessageBox.Show(shortcut.Description);
}