分享
 
 
 

[转帖]如何隐藏我的电脑中的磁盘

王朝other·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

用过超级兔子的都知道,有一个隐藏磁盘

的功能,选择隐藏的磁盘,确定后,

重新启动,看到磁盘隐藏了

主要是通过操作注册表来实现这个功能的

打开注册表

打开HKEY_CURRENT_USER\Software

\Microsoft\Windows\CurrentVersion

\Policies\Explorer分支

在这个分支下,NoDrives键值可以进行设置。

磁盘驱动器一一对应的键值如下:

A驱:0x00000001,B驱:0x00000002,

C驱:0x00000004,D驱:0x00000008,

E驱:0x00000010,F驱:0x00000020.

即按磁盘驱动器的英文字母顺序(A~Z)从十六进制的二倍数递增.将你要隐藏的磁盘驱动器所对应的键值按十六进制相加赋值给”NoDrivers”,如果要隐藏A,C,D,则将0x0000000D赋值给”NoDrives”

代码如下:WinXP+VB+SP6

winxp下注销重新登陆即可看到

添加list控件,command控件

Option Explicit

Private Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long

Private Declare Function RegDeleteKey Lib "advapi32.dll" Alias "RegDeleteKeyA" (ByVal hKey As Long, ByVal lpSubKey As String) As Long

Private Declare Function RegDeleteValue Lib "advapi32.dll" Alias "RegDeleteValueA" (ByVal hKey As Long, ByVal lpValueName As String) As Long

Private Declare Function RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, lpData As Any, lpcbData As Long) As Long

Private Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long

Private Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long

Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long

Const HKEY_CLASSES_ROOT = &H80000000

Const HKEY_CURRENT_USER = &H80000001

Const HKEY_LOCAL_MACHINE = &H80000002

Private Sub Command3_Click()

Dim i As Integer

Dim KeyValue As Long

Dim hCurKey As Long

Dim lRegResult As Long

Dim KeyID As Long

Dim subKey As String

Dim regkey As String

Dim retvalue As Long

For i = 0 To List1.ListCount - 1

If List1.Selected(i) Then

MsgBox List1.List(i)

KeyValue = KeyValue + List1.ItemData(i)

End If

Next

'如果没有选择,删除NoDrivers键值,取消所有磁盘的隐藏

regkey = "Software\Microsoft\Windows\CurrentVersion\Policies\Explorer"

subKey = "NoDrives"

If KeyValue = 0 Then

lRegResult = RegOpenKey(HKEY_CURRENT_USER, regkey, hCurKey)

lRegResult = RegDeleteValue(hCurKey, subKey)

lRegResult = RegCloseKey(hCurKey)

Else

'根据选择的磁盘进行隐藏

retvalue = RegCreateKey(HKEY_CURRENT_USER, regkey, KeyID)

subKey = "NoDrives"

'KeyValue = a1

retvalue = RegSetValueEx(KeyID, subKey, 0&, 4, KeyValue, 4)

End If

End Sub

Private Sub Command4_Click()

Unload Me

End Sub

Private Sub Form_Load()

List1.AddItem "A:"

List1.ItemData(0) = 1

List1.AddItem "B:"

List1.ItemData(1) = 2

List1.AddItem "C:"

List1.ItemData(2) = 4

List1.AddItem "D:"

List1.ItemData(3) = 8

List1.AddItem "E:"

List1.ItemData(4) = 16

List1.AddItem "F:"

List1.ItemData(5) = 32

List1.AddItem "G:"

List1.ItemData(6) = 64

List1.AddItem "H:"

List1.ItemData(7) = 128

List1.AddItem "I:"

List1.ItemData(8) = 256

List1.AddItem "J:"

List1.ItemData(9) = 512

List1.AddItem "K:"

List1.ItemData(10) = 1024

List1.AddItem "L:"

List1.ItemData(11) = 2048

List1.AddItem "M:"

List1.ItemData(12) = 4096

List1.AddItem "N:"

List1.ItemData(13) = 8192

List1.AddItem "O:"

List1.ItemData(14) = 16384

List1.AddItem "P:"

List1.ItemData(15) = 32768

List1.AddItem "Q:"

List1.ItemData(16) = 65536

List1.AddItem "R:"

List1.ItemData(17) = 131072

List1.AddItem "S:"

List1.ItemData(18) = 262144

List1.AddItem "T:"

List1.ItemData(19) = 524288

List1.AddItem "U:"

List1.ItemData(20) = 1048576

List1.AddItem "V:"

List1.ItemData(21) = 2097152

List1.AddItem "W:"

List1.ItemData(22) = 4194304

List1.AddItem "X:"

List1.ItemData(23) = 8388608

List1.AddItem "Y:"

List1.ItemData(24) = 16777216

List1.AddItem "Z:"

List1.ItemData(25) = 33554432

End Sub

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有