nbsp; version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*" />
</dependentAssembly>
</dependency>
</assembly>
你要适当的替换上面的”version”和”name”属性的值,使他和你项目里面的一样,分别对应AssemblyVersion和AssemblyTitle属性。那个”descryiption”元素也要同你的AssemblyDescription属性符合。
接下去,打开命令提示窗口修改你的项目输出路径,应该把”bin\Debug”作为项目路径根目录。假设你已经加了sn.exe强名称工具的路径到你的系统环境变量,那么在命令行中输入如下:
sn.exe –k ..\..\KeyFile.snk
上面的步骤会生成一个KeyFile.snk公钥文件,为了使你的程序集成为强类型程序集这个公钥是必须的。这个在许多情况下是必须需的。
最后一步添加Mnifest信息
你现在要在项目文件输出的所在目录。在我的例子中是一个简单的WindowsApplication1.exe文件,接下去会讲到他。
现在,退回到Visul Studio.NET,点击文件菜单—>打开,浏览到你的应用程序比如WindowsApplication1.exe,点击打开他我们会看到一个资源文件管理树。
1.右键在根节点上点击选择“添加资源”。
2.点击“导入”按钮,在你的项目路径中找到WindowsApplication.exe.mnifest并打开他。
3.在自定义资源类型对话框中我们输入RT_MANIFEST然后点击确定。
4.保存所有文件让我们回到先前的资源来浏览树。我们现在可以看到一个RT_MANIFEST的节点。
5.点击选中他下面那个新加的资源文件,通常的名字是101。在属性窗口里修改他的ID值为1,再一次保存你的应用程序。
6.关闭你打开的资源浏览窗口回到命令行提示符下,输入下面的命令:
sn –R WindowsApplication1.exe ..\..\KeyFile.snk
执行后会输出一些版本信息,最后显示:
Assembly ‘WindowsApplication1.exe’ successfully re-signed
运行你的.NET应用程序你就会看到Windows XP样式了。
概要
你不需要做很多工作就可以把Windows XP 可视化样式加入到你的应用程序和控件。使用这些新的样式将会带给你的窗体新的视觉,而这些经常在商业程序上用到。许多公司都花精力去开发这方面的东西,而现在你可以不用做很多工作就可以做到。
请记住把那些带有FlatStyle属性的控件设置为FlatStyle.System,同时在编译你的程序后加入manifest资源就象上面的样板文件。当这些都做好了以后剩下的就是完成对程序集的签名。如果你想要测试你的应用程序或者你有权限对他进行签名,你可以通过下面的命令关闭对程序集的验证:
sn.exe –Vr WindowsApplication1.exe
立即行动,为你的应用程序加上Xp样式,使你的产品更有特点。这样做不会花很多时间但是效果是显而易见的。
About Heath Stewart
Heath Stewart is a happily married software engineer originally from Nebraska and a graduate of Iowa State University in Ames, Iowa. With nothing much to do in either state, Heath started programming early in life when gopher ruled and the Internet wasn''''t commercialized, and enjoys continuous research and development in new languages and frameworks. Fluent in many different programming languages, he has developed many large software solutions for companies in different areas, such as Internet filtering, intrusion detection systems, production management systems, Web sites for various purposes, and data analysis tools. He also enjoys photography.
Currently, Heath is the Director of Technology at Proplanner, a Web-based Production Planning System that primarily uses .NET where he designed a multi-tiered environment and supports multiple front-ends (such as a legacy Java interface on PDM) and back-ends (such as Web Services, RDBMS''''s, file-based IO, and PDM).
Heath is now an editor for CodeProject and is happy to help the development community as a Microsoft MVP (C#).
上一页 [1] [2] [系统软件]windows下Apache+php+mysql的安装与配置图解 [操作系统]在Windows中玩转Linux操作系统 [操作系统]死马还当活马医:6种方法挽救Windows系统 [聊天工具]四大更新 Windows Live Msn 8.1评测 [聊天工具]Windows Live Messenger最新0683版亮相_联络工具_… [聊天工具]Windows Live Mail招人爱的N个理由_联络工具_Wind… [聊天工具]Windows Live Mail Desktop多图欣赏_联络工具_Win… [聊天工具]OE老了 微软开发新邮件客户端取而代之_联络工具 [聊天工具]Windows Live Messenger中文版试用报告(一)__天极… [聊天工具]Windows Live Messenger 8 Beta1高清图赏__天极Ye…
|