zoukankan
html css js c++ java
asp.net 桌面快捷方式
给asp.net项目安装程序添加快捷方式
//
添加以下引用:COM 下 Windows Script Host Object Model,然后
//
using System.Runtime.InteropServices;
//
using IWshRuntimeLibrary;
private
void
AddShortcut()
{
string
[] vPath
=
this
.targetdir.Split(
'
\\
'
);
string
url
=
"
http://
"
+
this
.iis
+
"
/
"
+
vPath[vPath.Length
-
2
];
try
{
string
mysite
=
url;
//
创建收藏夹快捷方式
string
fav
=
System.Environment.GetFolderPath(System.Environment.SpecialFolder.Favorites)
+
"
\\MX系统.url
"
;
IWshShell_Class wshShell
=
new
IWshShell_ClassClass();
//
创建 Windows Script Host Shell 类
IWshURLShortcut favShortcut
=
wshShell.CreateShortcut(fav)
as
IWshURLShortcut;
//
定义快捷方式文件
favShortcut.TargetPath
=
mysite;
favShortcut.Save();
//
保存快捷方式
//
创建桌面快捷方式
string
desktop
=
System.Environment.GetFolderPath(System.Environment.SpecialFolder.Desktop)
+
"
\\MX系统.url
"
;
IWshURLShortcut desktopShortcut
=
wshShell.CreateShortcut(desktop)
as
IWshURLShortcut;
desktopShortcut.TargetPath
=
mysite;
desktopShortcut.Save();
//
保存快捷方式
}
catch
(Exception exc)
{
throw
new
Exception(
"
创建快捷方式错误!
"
+
exc.Message);
}
}
查看全文
相关阅读:
转(get和post)
由在updatepanel中注册脚本所引发的问题
AJAX请求时status返回状态明细表 readyState的五种状态
谈谈Ajax中Get和Post
跟我一起从零开始学WCF系列课程笔记(1):WCF概述
跟我一起从零开始学WCF系列课程笔记(2):设计和实现服务协定
ASP.NET AJAX中UpdatePanel的工作原理
关于页面中回车键默认触发某个控件按钮事件的问题(DefaultButton)
显示GIF格式图片遇到的问题
关于GUID
原文地址:https://www.cnblogs.com/wf225/p/1176274.html
最新文章
好书啊!
4.3 试题库的设计和实现(借鉴String类实现减少数据冗余)
4.8 改卷的设计和实现(客观题自动打分)
Domain Objects Caching Pattern for .NET
4.4 试卷的设计和实现(xml+xlst生成html试卷)
4.1信息管理的设计和实现(利用泛型减少重复代码)
NHibernate实现自定义类型IUserType
如何在网上查找免费电子书
4.5 出题策略的设计和实现(随机出题)
第3章 系统的总体设计(抽象工厂+反射解耦业务层和数据访问层)
热门文章
第一章绪论
DIV+CSS学习笔记
javascript学习笔记
(转)记录集rs.open 参数说明RS.OPEN SQL,CONN,A,B
(转)关于split
自省
(转)《The Elements of Programming Style》
(转)JS代码在IE和Firefox间的区别
(转)IE和火狐的css兼容性问题归总
(转)分页存储过程
Copyright © 2011-2022 走看看