How to give read/write permission to a folder for a group
<p>I have written the following code to give read permission to a group but I am getting anerror: </p>

<blockquote>
  <p>"The trust relationship between the primary domain and the trusted
  domain failed."</p>
</blockquote>

<p>If I am giving a username instead of group, it is working.</p>

<pre><code>DirectoryInfo myDirectoryInfo = new DirectoryInfo(path);
DirectorySecurity myDirectorySecurity = myDirectoryInfo.GetAccessControl();
string group = "groupName";
myDirectorySecurity.AddAccessRule(new FileSystemAccessRule(group,FileSystemRights.Read, AccessControlType.Deny));  
myDirectoryInfo.SetAccessControl(myDirectorySecurity);
</code></pre>
