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);
}
}
查看全文
相关阅读:
Centos环境下部署游戏服务器-自动化
Centos环境下部署游戏服务器-SVN
Centos环境下部署游戏服务器-权限
Centos环境下部署游戏服务器-Eclipse
Centos环境下部署游戏服务器-编译
Centos环境下部署游戏服务器-软件安装
基本的Logstash 例子
安装Logstash
安装Logstash
mysqldump --master-data
原文地址:https://www.cnblogs.com/wf225/p/1176274.html
最新文章
SwipeListView 详解 实现微信,QQ等滑动删除效果
ScrollView反弹效果 仿小米私密短信效果
最近最久未使用页面淘汰算法———LRU算法(java实现)
我的账号难道被盗号了?
玩转web之ligerui(二)---前缀编码生成树(分级码)实现树型表格
Java并发专题 带返回结果的批量任务执行 CompletionService ExecutorService.invokeAll
Android推送 百度云推送 入门篇
Java 并发专题 : Timer的缺陷 用ScheduledExecutorService替代
Yarn scheduler Capacity调度器概念以及配置
Spark程序的几个优化点
热门文章
spark中遇到的数据倾斜问题
spark 工作目录及数据本地化配置
ElasticSearch 优化实战
ElasticSearch 优化总结
elasticsearch调优技巧
NiFi流处理引擎
借助终端软件,有效统一移动互联网和物联网
Centos环境下部署游戏服务器-常用命令
Centos环境下部署游戏服务器-iptables
Centos环境下部署游戏服务器-SSH
Copyright © 2011-2022 走看看