使用C#Windows窗体锁定C驱动器

使用C#Windows窗体锁定C驱动器

问题描述:

如何保护使用C#Windows窗体访问或锁定C驱动器?

How to protect to access or Lock the C drive using C# windows form?

hi,
我不知道这是对还是不对.以任何方式阅读此答案:〜
http://www.codeproject.com/Messages/2872030/How-i-Lock-my-Harddisk-drive-in-csharp-net.aspx [
hi ,
I dont''t know this is right or not.. any way read this answer :~
http://www.codeproject.com/Messages/2872030/How-i-Lock-my-Harddisk-drive-in-csharp-net.aspx[^]


简单,将其锁定桌面.

Simple, lock the desktop.

[DllImport("user32")]
public static extern void LockWorkStation();



在Button.Click事件中调用LockWorkStation()



In Button.Click event call LockWorkStation()


它称为用户权限",您可以在OS中进行设置.除非有问题的应用程序是以管理员身份运行",否则您无法从应用程序中更改这些内容.您应在此处谨慎行事,因为使用此权限完全可以写入他自己的用户特定文件夹.

您要如何完成Windows内置功能无法为您完成的工作?
It''s called "user privileges", and you set it in the OS. You can''t change those from an application unless the application in question is "run as administrator". You should tread carefully here because the use is well within his rights to write to his own user-specific folders.

What are you trying to accomplish that Windows bult-in functionality can''t do for you?