EXE未在Windows 8中运行 [英] EXE not running in Windows 8

查看:104
本文介绍了EXE未在Windows 8中运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在VB.NET中开发了一个名为scan的软件。它的EXE在Windows XP和Windows 7中成功运行,但是当我在Windows 8上测试时,它给了我以下错误: -



System.UnauthorizedAccessException:在Microsoft的Microsoft.Win32.RegistryKey.Win32Error(Int32错误代码,字符串str)中拒绝访问注册表项''HKEY_LOCAL_MACHINE \ SOFTWARE \

PartapScan'' .Win32.RegistryKey.CreateSubKey(字符串子键,RegisterKeyPermissionCheck permissionCheck,

RegistrySecurity registrySecurity)在Scanning.ServerSetting.Set_server_in_reg()



请帮助....

I have developed a software named scanning in VB.NET. Its EXE was running successfully in
Windows XP and in windows 7 but when I test it over windows 8 it gave me the following error :-

System.UnauthorizedAccessException: Access to the registry key ''HKEY_LOCAL_MACHINE\SOFTWARE\
PartapScan'' is denied at Microsoft.Win32.RegistryKey.Win32Error(Int32 error code,string str) at Microsoft.Win32.RegistryKey.CreateSubKey(string subkey,RegisterKeyPermissionCheck permissionCheck,
RegistrySecurity registrySecurity) at Scanning.ServerSetting.Set_server_in_reg()

Please help....

推荐答案

对我来说似乎是一个权限问题,尝试使用管理员权限运行您的应用程序,看看是否仍然发生这种情况。如果它不再发生,那么你知道你的应用程序需要管理员权限才能运行(至少应用程序的这一部分)。
Seems like a permission problem to me, try to run your app in with Administrator privileges and see if this still happens. If it doesn''t happens anymore, then you know your app needs the Administrator privilege to run (at least this part of the app).


你的程序需要管理权限但事实如此它在Windows 7中运行没有任何问题仍困扰着我。



好​​吧,为了使你的程序以管理员身份运行,你可以右键单击EXE并选择以管理员身份运行



或者您可以通过更改应用程序清单的文件 app.manifest <中所需的权限,直接从您的编程IDE执行此操作/ em>



Your program to needs administrative privileges but the fact that it ran in Windows 7 without any problems still bothers me.

Well, to make your program run as administrator, you could just right click on the EXE and select "Run as administrator"

Or you could do that directly from your Programming IDE by changing the required privilege in your application manifest''s file app.manifest

<trustinfo xmlns="urn:schemas-microsoft-com:asm.v2">
    <security>
      <requestedprivileges xmlns="urn:schemas-microsoft-com:asm.v3">
        <!-- UAC Manifest Options
            If you want to change the Windows User Account Control level replace the 
            requestedExecutionLevel node with one of the following.

        <requestedExecutionLevel  level="asInvoker" uiAccess="false" />
        <requestedExecutionLevel  level="requireAdministrator" uiAccess="false" />
        <requestedExecutionLevel  level="highestAvailable" uiAccess="false" />

            Specifying requestedExecutionLevel node will disable file and registry virtualization.
            If you want to utilize File and Registry Virtualization for backward 
            compatibility then delete the requestedExecutionLevel node.
        -->
        <requestedexecutionlevel>level="requireAdministrator" uiAccess="false" />
      </requestedexecutionlevel></requestedprivileges>
    </security> 
</trustinfo>





您可以通过项目属性从Visual Studio获取此信息 - >应用程序选项卡 - >查看Windows设置。



You can get this from Visual Studio via the Project properties -> Application Tab -> View Windows Settings.


这篇关于EXE未在Windows 8中运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆