资源简介
调用方法:
Shortcut sc = new Shortcut();
sc.Path = "目标文件地址";
sc.Arguments = "启动参数";
sc.WorkingDirectory = "启动文件的文件夹";
sc.Description = "描述";
sc.Save("这个快捷方式保存在哪");
代码片段和文件信息
using System;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace WindowsShortcut
{
static internal class NativeClasses
{
[Flags]
internal enum SLR_MODE : uint
{
SLR_INVOKE_MSI = 0x80
SLR_NOlinkINFO = 0x40
SLR_NO_UI = 0x1
SLR_NOUPDATE = 0x8
SLR_NOSEARCH = 0x10
SLR_NOTRACK = 0x20
SLR_UPDATE = 0x4
SLR_NO_UI_WITH_MSG_PUMP = 0x101
}
[Flags]
internal enum STGM_ACCESS : uint
{
STGM_READ = 0x00000000
STGM_WRITE = 0x00000001
STGM_READWRITE = 0x00000002
STGM_SHARE_DENY_NONE = 0x00000040
STGM_SHARE_DENY_READ = 0x00000030
STGM_SHARE_DENY_WRITE = 0x00000020
STGM_SHARE_EXCLUSIVE = 0x00000010
STGM_PRIORITY = 0x00040000
STGM_CREATE = 0x00001000
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 9872 2012-02-11 15:06 Shortcut.cs
----------- --------- ---------- ----- ----
9872 1
评论
共有 条评论