问题描述
我有一个使用一些加密原语的程序,当用户使用临时配置文件登录时,这些原语不起作用.据我所知,没有解决方法.
I have a program which uses some cryptographic primitives, which do not work when the user has been logged in with a temporary profile. So far as I know, there is no workaround.
因此,如果有临时配置文件,我需要我的程序采取备用操作.我希望能够检测到这一点,而无需尝试加密操作并捕获异常.
So I need my program to take alternate actions if there is a temporary profile. I want to be able to detect this without resorting to trying the cryptographic operation and catching the exception.
有没有办法确定当前用户的配置文件会话是临时的(或强制的),而不检测错误情况?
Is there a way to determine that the current user's profile session is temporary (or mandatory), without detecting an error condition ?
推荐答案
调用 GetProfileType() 函数:
检索为当前用户加载的配置文件类型.
PT_MANDATORY
- 用户拥有强制用户配置文件.
PT_MANDATORY
- The user has a Mandatory User Profiles.
PT_TEMPORARY
- 用户有一个临时用户资料;它将在注销时被删除.
PT_TEMPORARY
- The user has a Temporary User Profiles; it will be deleted at logoff.
这篇关于以编程方式检测用户已使用临时配置文件登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!