![]() String adminUserName = Environment.UserName // getting your adminUserNameĭirectorySecurity ds = Directory.GetAccessControl(folderPath) įileSystemAccessRule fsa = new FileSystemAccessRule(adminUserName, FileSystemRights.FullControl, AccessControlType.Deny)ĭirectory.SetAccessControl(folderPath, ds) Private void btnLock_Click(object sender, EventArgs e) ![]() TextBox1.Text = folderBrowserDialog1.SelectedPath If (folderBrowserDialog1.ShowDialog() = DialogResult.OK) Private void btnBrowse_Click(object sender, EventArgs e) The Following code will help to lock and unlock the folder.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |