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);
}
}
查看全文
相关阅读:
Docker服务启动报错:Job for docker.service failed because the control process exited with error code.
mysql忘记密码如何重置及修改密码
linux下的/opt目录作用
linux防火墙查看状态firewall、iptable
nmap基本使用方法
HTTP响应码大全
端口镜像
查看占用端口
restful规范 APIview 解析器组件 Postman
状态码301和302的区别
原文地址:https://www.cnblogs.com/wf225/p/1176274.html
最新文章
视频质量诊断----色度异常检测
视频质量诊断----亮度异常检测
视频质量诊断----概述
基于libuv的TCP设计(二)
基于libuv的TCP设计(一)
广州集体户口办结婚证实播(各种办证难)
记一次失败经验:“先入为主”引起的思维定势
Attention Please!TWO HUNDREDS OF machine learning turorial summary
create_txt.sh
《Look More Than Once:An Detector for Text of Arbitrary Shape》
热门文章
《Few-Shot Learning with Global Class Representations》
Few-Shot Learning with Global Class Representations
Cascade R-CNN
Objects as Points
LookingFastandSlow: Memory-GuidedMobileVideoObjectDetection
keras
pytorch
tensorflow
centos7右上角网络连接图标消失
漏洞扫描原理
Copyright © 2011-2022 走看看