禁用退出软件的任何可能性?

发布于 2024-12-10 13:16:10 字数 293 浏览 0 评论 0原文

我正在使用 C++ 实现大学考试软件,我希望防止任何人在运行后将其关闭。目的是为了防止用户复制软件、打印屏幕并保存等目的!

我最初正在考虑一种禁用 ctrl-alt-delalt+F4< 的方法/kbd>、alt+tab 和其他组合键,但显然遵循这种方法并不那么容易,尤其是在版本中Windows XP之后。

您认为解决我的问题的可行方法是什么?

I am implementing university exam software in C++, and I want to prevent any person from the ability to close it once it runs. The purpose is to prevent the user from copying the software, printing the screen and saving it, and other purposes!

I was initially thinking about a way of disabling ctrl-alt-del, alt+F4, alt+tab, and other key combinations, but apparently following this approach is not that easy especially in versions after windows xp.

What do you think a viable approach to solve my problem ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

临风闻羌笛 2024-12-17 13:16:10

当然,您应该采取所有正常步骤使您的应用程序拒绝自行关闭(也许除非提供密码),所以我们只讨论“我不想允许任何人强行关闭它”部分。

一种解决方案是让您的应用程序成为 Windows shell。

另一种解决方案是设置计算机,使当前登录的用户无权关闭您的应用程序。

最后的解决方案是这样做:

public static class Utility
{
    [DllImport("ntdll.dll", SetLastError = true)]
    private static extern void RtlSetProcessIsCritical(UInt32 v1, UInt32 v2, UInt32 v3);

    public static void BsodIfProcessEnds()
    {
        Process.EnterDebugMode();
        RtlSetProcessIsCritical(1, 0, 0);
    }

    public static void NoFireworksIfProcessEnds()
    {
        RtlSetProcessIsCritical(0, 0, 0);
    }
}

警告:BsodIfProcessEnds 完全按照它所说的那样进行。

You should of course take all the normal steps of making your application refuse to close by itself (perhaps unless a password is provided), so we 're only talking about the "I don't want to allow anyone to forcefully close it" part.

One solution would be to make your app be the Windows shell.

Another solution would be to set up the computer such that the currently logged in user has no permission to shut your application down.

And a final solution, which is a dirty, not officially supported hack you didn't hear from me, is to do this:

public static class Utility
{
    [DllImport("ntdll.dll", SetLastError = true)]
    private static extern void RtlSetProcessIsCritical(UInt32 v1, UInt32 v2, UInt32 v3);

    public static void BsodIfProcessEnds()
    {
        Process.EnterDebugMode();
        RtlSetProcessIsCritical(1, 0, 0);
    }

    public static void NoFireworksIfProcessEnds()
    {
        RtlSetProcessIsCritical(0, 0, 0);
    }
}

Warning: BsodIfProcessEnds does exactly what it says on the tin.

靖瑶 2024-12-17 13:16:10

仅向用户提供计算机上的受限用户帐户,并且不授予他们终止您的应用程序的权限。

对其他限制执行相同的操作,您甚至不需要编写应用程序。

如果您希望用户以管理员身份运行,那么您的要求是不可能的。

Give users only a restricted user account on the machine, and don't give them permissions to kill your application.

Do the same for your other restrictions, and you don't even need to write an app.

If you want users to run as administrators, what you're asking for is impossible.

伪装你 2024-12-17 13:16:10

您可以创建两个应用程序。
不断检查您的应用程序是否正在运行
如果它没有运行,则启动它,这可能是一项服务(对于简单用户来说很难发现)。

您也可以利用 NTFS 权限做一些有趣的事情。
例如,创建一个用户根本没有权限(甚至无法查看其内容)的上层目录,然后在该目录下创建一个用户具有读取权限的文件夹。
除非用户非常了解,否则找到您的应用程序会变得有点困难。

但他仍然可以启动任务管理器,但也许有一项政策反对这样做。
说到策略,你可以对其进行限制,只允许他运行你的应用程序,而不允许他运行任何其他应用程序(这样他就无法复制它,或者将电脑用于除你的应用程序之外的任何其他应用程序)。

You might create two apps.
One is constantly checking if your app is running
If it is not running then start it, this could be a service (harder to spot for simple users).

You might do some fun with NTFS permission too.
For example create an upper directory where the user has no permissions at all (not even viewing its content) then create under that a folder where the user has read permissions.
Unless the user knows a good geus it becomes a bit harder to find your app.

But still he could launch taskmanager but perhaps there is a policy against that.
Speaking of which with policies you can make it so restricted that he is only allowed to run your app and not any other app (so he wont be able to copy it, or use the PC for anything else then your app.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文