Hi
I have a Problem when I try give value using the function
public string AttributeValuesSingleString
(string attributeName, string objectDn)
{
string strValue;
DirectoryEntry ent = new DirectoryEntry(objectDn);
strValue = ent.Properties[attributeName].Value.ToString();
ent.Close();
ent.Dispose();
return strValue;
}
}
The error occurs at line with code:
strValue = ent.Properties[attributeName].Value.ToString();
Below is the content error:
COMException was Unhandled by user code
Unspecified error
I was looking for problems like me, but I didn't found good solution.
I try using code in DirectoryEntry:
DirectoryEntry ent = new DirectoryEntry(objectDn,"Administrator","Pass",AuthenticationTypes.Secure);
and also tried disabling firewall and nothing has helped.