一、在win6以上系统里获得管理员权限
<?xml version="1.0" enCoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIDentity version="1.0.0.0"
processorArchitecture="X86"
name="IsUseradmin"
type="win32"/>
<description>Description of your application</description>
<!-- IDentify the application security requirements. -->
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="requireadministrator"
uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
二、实现xp风格窗体
<?xml version="1.0" enCoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIDentity
version="1.0.0.0"
processorArchitecture="X86"
name="Companyname.Productname.YourApp"
type="win32"
/>
<description>Your application description here.</description>
<dependency>
<dependentAssembly>
<assemblyIDentity
type="win32"
name="Microsoft.windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
三、同时支持xp风格和获得管理员权限
<?xml version="1.0" enCoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIDentity
version="1.0.0.0"
processorArchitecture="X86"
name="Companyname.Productname.YourApp"
type="win32"
/>
<description>Your application description here.</description>
<dependency>
<dependentAssembly>
<assemblyIDentity
type="win32"
name="Microsoft.windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="requireadministrator"
uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
1、保存为"主程序名.exe.manifest",
2、另建一"aaa.rc"文件(TXT格式),内容为:"1 24 主程序名.exe.manifest"
3、运行""C:\Program files\Microsoft Visual Studio\VB98\Wizards\rc.exe" /r aaa.rc",生成"aaa.res"
4、将"aaa.res"导入到工程里。
5、编译,OK
总结以上是内存溢出为你收集整理的VB使用manifest以支持xp风格和获得管理员权限全部内容,希望文章能够帮你解决VB使用manifest以支持xp风格和获得管理员权限所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)