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

推荐订阅源

IT之家
IT之家
Project Zero
Project Zero
博客园 - 聂微东
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
云风的 BLOG
云风的 BLOG
Microsoft Azure Blog
Microsoft Azure Blog
F
Fortinet All Blogs
Martin Fowler
Martin Fowler
Jina AI
Jina AI
C
Check Point Blog
博客园_首页
The GitHub Blog
The GitHub Blog
The Hacker News
The Hacker News
T
The Blog of Author Tim Ferriss
V
Vulnerabilities – Threatpost
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Cisco Blogs
人人都是产品经理
人人都是产品经理
V
Visual Studio Blog
A
Arctic Wolf
博客园 - 三生石上(FineUI控件)
P
Privacy International News Feed
Application and Cybersecurity Blog
Application and Cybersecurity Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Forbes - Security
Forbes - Security
阮一峰的网络日志
阮一峰的网络日志
Engineering at Meta
Engineering at Meta
T
Troy Hunt's Blog
Microsoft Security Blog
Microsoft Security Blog
Spread Privacy
Spread Privacy
Schneier on Security
Schneier on Security
K
Kaspersky official blog
宝玉的分享
宝玉的分享
Google DeepMind News
Google DeepMind News
V2EX - 技术
V2EX - 技术
Google DeepMind News
Google DeepMind News
AWS News Blog
AWS News Blog
Know Your Adversary
Know Your Adversary
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Y
Y Combinator Blog
大猫的无限游戏
大猫的无限游戏
S
Security Affairs
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - Franky
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
The Register - Security
The Register - Security
P
Proofpoint News Feed
小众软件
小众软件
S
Securelist
T
Tor Project blog

博客园 - 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);