惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Hugging Face - Blog
Hugging Face - Blog
Microsoft Azure Blog
Microsoft Azure Blog
月光博客
月光博客
S
Securelist
J
Java Code Geeks
Recorded Future
Recorded Future
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
M
MIT News - Artificial intelligence
S
Secure Thoughts
Y
Y Combinator Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
D
Docker
Martin Fowler
Martin Fowler
The Last Watchdog
The Last Watchdog
WordPress大学
WordPress大学
The GitHub Blog
The GitHub Blog
Vercel News
Vercel News
O
OpenAI News
www.infosecurity-magazine.com
www.infosecurity-magazine.com
博客园_首页
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
PCI Perspectives
PCI Perspectives
N
News and Events Feed by Topic
H
Heimdal Security Blog
SecWiki News
SecWiki News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
博客园 - 【当耐特】
T
Troy Hunt's Blog
L
LINUX DO - 最新话题
Hacker News: Ask HN
Hacker News: Ask HN
Hacker News - Newest:
Hacker News - Newest: "LLM"
N
Netflix TechBlog - Medium
A
Arctic Wolf
The Hacker News
The Hacker News
I
Intezer
S
Schneier on Security
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Apple Machine Learning Research
Apple Machine Learning Research
L
Lohrmann on Cybersecurity
宝玉的分享
宝玉的分享
P
Privacy & Cybersecurity Law Blog
Stack Overflow Blog
Stack Overflow Blog
T
Tor Project blog
小众软件
小众软件
Simon Willison's Weblog
Simon Willison's Weblog
The Cloudflare Blog
Jina AI
Jina AI

博客园 - ruinet

WCF通用服务请求类 使用MVP模式实现B/S和C/S平台的功能通用 WCF中使用扩展行为来验证连接的用户 Microsoft.Practices.Unity依赖注入使用实例 简洁的Asp.net菜单控件 Windows Mobile无线打印的实现 使用HTML,CSS快速导出数据到Excel 软件技术网站精选 CakePHP架构入门 升级Sql Server 2000到Sql Server 2005中要注意的问题 asp.net web开发综合技能 编写第一个Silverlight程序 Saas学习 在Windows Mobile上控制输入法 - ruinet - 博客园 在仿真设备中使用主机网络 CSS,JavaSript,Html实用小代码 重启PocketPC移动设备 使用Ajax控件引发性能问题 智能移动项目打包发布经验交流
在Windows Mobile创建桌面快捷方式
ruinet · 2007-11-24 · via 博客园 - ruinet

2007-11-24 15:52  ruinet  阅读(11128)  评论()    收藏  举报

 

新建智能设备CAB项目,就可以直接创建特殊的目录下创建快捷方式,但是并没有象桌面安装包程序一样可以,在桌面上创建一个快捷方式。怎样用代码在Windows Mobile桌面上创建一个快捷方式呢?我开始也尝试用像创建Windows应用程序一样在桌面上创建一个快捷方式,但是在Windows Mobile上根本不行。经过研究和Windows快捷方式创建,发现快捷方式其实就是创建一个特定的lnk文件,在这个文件中写入一定的代码,在点击时就能自动运行。

Windows Mobile 中怎么样创建快捷方式的呢?复制一个Windows Mobile中的一个快捷方式,然后把它拖到记事本中你就会发现它的结构组成了。

如:37#"\Windows\桌面\PDA.exe.lnk"这是我拖拽一个快捷方式到记事本中出现的

看到里这个就很简单,比创建Windows 快捷方式简单多了。

Code参考:

///<summary>

    ///创建快捷方式

    ///</summary>

    ///<param name="ExePath">exe程序所在路径</param>

    ///<param name="where">快捷方式的路径</param>

    public static void CreateShortcut(string ExePath,string where)

    {
   
try

      {

        if (!System.IO.File.Exists(where))

        {

          System.IO.StreamWriter objWriter = System.IO.File.CreateText(where);

          objWriter.WriteLine(string.Format("37#""{0}""", ExePath));

          objWriter.Close();

        }

      }

      finally

      {

        where = null;

        ExePath = null;

      }
}

string where = @"\Windows\桌面\PDA.exe.lnk";

string ExePath=Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName;

CreateShortcut(ExePath,where);