1. 取得系统帐号列表
2. 取得某个文件夹的所有帐号的权限列表,就是一个文件夹有N个帐号可以访问,取每个帐号的权限列表本人对系统操作不是很熟悉,希望得到各位的指点
2. 取得某个文件夹的所有帐号的权限列表,就是一个文件夹有N个帐号可以访问,取每个帐号的权限列表本人对系统操作不是很熟悉,希望得到各位的指点
解决方案 »
- short i=0;i+=1;这不报错为什么?
- 同个框架内获得不同域的页面的控键
- 用c# 作一个类似vs2003集合开发环境里界面设计的东东.
- 简单问题,关于选择
- ==== 我要做网站的新闻系统,其中要把新闻内容放在数据里,其中新闻内容中用到加粗,下划线等操作,应该怎么做 =====
- 远程调试提示"当前不会命中断点 还没有为该文档加载任何符号"
- 各位高手大哥请进
- 100分问题关于用户自定路径的问题.
- 大家谈谈xmlnode与xmlelement 的区别
- 用VS打包安装程序,怎么不能把framework打入阿??
- 将HTML里的Table控件导出到Excel以后,表格线如何显示?
- DropDownList在GridView的模块编辑中
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Security.AccessControl;
using System.Security.Principal;namespace DirectoryInfoTest
{
class Program
{
static void Main(string[] args)
{ #region 变量定义
string strFolderPath = "";
DirectoryInfo dirInfo = null;
DirectorySecurity dirSec = null;
int i = 0;
#endregion try
{ dirInfo = new DirectoryInfo(@"D:\CodeSmith");
dirSec = dirInfo.GetAccessControl(); // 获取ACL里的ACEs
i = 0;
foreach (FileSystemAccessRule rule in dirSec.GetAccessRules(true, true, typeof(NTAccount)))
{
Console.WriteLine("[{0}] - Rule {1} {2} access to {3}",
i++,
rule.AccessControlType == AccessControlType.Allow ? "grants" : "denies",
rule.FileSystemRights,
rule.IdentityReference.ToString());
}
}
catch (Exception ex)
{
Console.Write("EXCEPTION: ");
Console.WriteLine(ex.Message);
}
Console.WriteLine("\n<>");
Console.Read();
}
}
}