2019년 3월 6일 수요일
C# - AddAccessRule
private static void GrantAccess(string file)
{
bool exists = System.IO.Directory.Exists(file);
if (!exists)
{
DirectoryInfo di = System.IO.Directory.CreateDirectory(file);
Console.WriteLine("The Folder is created Sucessfully");
}
else
{
Console.WriteLine("The Folder already exists");
}
DirectoryInfo dInfo = new DirectoryInfo(file);
DirectorySecurity dSecurity = dInfo.GetAccessControl();
dSecurity.AddAccessRule(new FileSystemAccessRule(new SecurityIdentifier(WellKnownSidType.WorldSid, null), FileSystemRights.FullControl, InheritanceFlags.ObjectInherit | InheritanceFlags.ContainerInherit, PropagationFlags.NoPropagateInherit, AccessControlType.Allow));
dInfo.SetAccessControl(dSecurity);
}
피드 구독하기:
댓글 (Atom)
MSSQL - Cursor vs Temp Table
#테이블 변수사용의 예 use pubs go declare @tmptable table ( nid int identity(1,1) not null, title varchar (80) not null ) -- 테이블 변수 선언 inse...
-
11 SQL Client for Productive Database Administration & Development Working as a web developer or database administrator, often n...
-
[JSON Serialization] JSON Serialization The JSON Serialization feature converts objects to and from JSON format. This can be use...
댓글 없음:
댓글 쓰기