如何在内核级别隐藏文件和文件夹? [英] How to Hide files and folders at kernel level?

查看:124
本文介绍了如何在内核级别隐藏文件和文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道如何使用不同的文件在系统级别隐藏文件和不同的文件夹
属性,但我不知道如何在内核级别隐藏主题(如Lock folder XP),因此另一个应用程序或我们的系统命令窗口(cmd)未经允许就无法访问它. "h2_lin">解决方案

这将隐藏ListView中的选定文件夹


私有子HideFolders(ByVal发送者为System.Object,ByVal e为System.EventArgs)处理HideToolStripMenuItem.Click
对于i作为整数= 0到ListView1.CheckedItems.Count-1
如果IO.File.GetAttributes(ComboBox1.SelectedItem +:\" + ListView1.CheckedItems(i).Text)和IO.FileAttributes.System + IO.FileAttributes.Hidden然后
MessageBox.Show(ListView1.CheckedItems(i).Text +已被隐藏单击显示文件夹以再次显示它",隐藏文件夹错误",MessageBoxButtons.OK,MessageBoxIcon.Error)
其他
IO.File.SetAttributes(ComboBox1.SelectedItem +:\" + ListView1.CheckedItems(i).Text,IO.FileAttributes.System + IO.FileAttributes.Hidden)
MessageBox.Show(ListView1.CheckedItems(i).Text +文件夹已被隐藏",文件已被隐藏",MessageBoxButtons.OK,MessageBoxIcon.Information)
如果结束
下一个
结束子


您可以参考此链接
< a href ="http://www.dotnetspider.com/resources/20889-Hiding-Unhiding-Folders.aspx"></a> [< a href =" target ="_ blank"> </a>]


A Rootkit [ http://emmet-gray.com/Articles/SetPermissions.htm [ http://www.dotnet247.com/247reference/msgs/28/144136.aspx [ ^ ],
http://www.nirajkachhadia.com/vbnet-programming.html [ http://msdn.microsoft.com/en-us/library/04f9s685%28v = VS.100%29.aspx [ ^ ].

—SA


I know how to hide files and different folders at System level using different file
attributes but I don''t know how to hide theme at kernel level like Lock folder XP, so another application or our system command window(cmd) can not access it without permission.Is there any way to do this?

解决方案

This will Hide the Selected Folders from the ListView


Private Sub HideFolders(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HideToolStripMenuItem.Click
For i As Integer = 0 To ListView1.CheckedItems.Count - 1
If IO.File.GetAttributes(ComboBox1.SelectedItem + ":\" + ListView1.CheckedItems(i).Text) And IO.FileAttributes.System + IO.FileAttributes.Hidden Then
MessageBox.Show(ListView1.CheckedItems(i).Text + " is Already Hidden Click on Show Folders to Display It Again", "Hide Folders Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
Else
IO.File.SetAttributes(ComboBox1.SelectedItem + ":\" + ListView1.CheckedItems(i).Text, IO.FileAttributes.System + IO.FileAttributes.Hidden)
MessageBox.Show(ListView1.CheckedItems(i).Text + " Folder has been Hidden", "File Hidden", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
Next
End Sub


You may refers this link
<a href="http://www.dotnetspider.com/resources/20889-Hiding-Unhiding-Folders.aspx"></a>[<a href="" target="_blank"></a>]


A Rootkit[^] can hide files at the kernel level, which means that nobody will be able to find them.

The usual way is is to handle this as SAKryukov suggests :)

Best regards
Espen Harlinn


Don''t mix up hiding and permission. One of possible permissions is hiding a file from some users, but you can just prohibit opening the file, or make it read-only, etc. The number of different options is pretty big, see file Properties => Security => Advanced to get and idea. Permissions are based on the user identity.

For programmatic manipulations of permissions, see, for example, these articles:
http://emmet-gray.com/Articles/SetPermissions.htm[^],
http://www.dotnet247.com/247reference/msgs/28/144136.aspx[^],
http://www.nirajkachhadia.com/vbnet-programming.html[^].

See this MSDN help page with code sample:
http://msdn.microsoft.com/en-us/library/04f9s685%28v=VS.100%29.aspx[^].

—SA


这篇关于如何在内核级别隐藏文件和文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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