使用C#Windows窗体锁定C驱动器 [英] Lock the C drive using C# windows form

查看:75
本文介绍了使用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?


这篇关于使用C#Windows窗体锁定C驱动器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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