DirectoryEntry de = new DirectoryEntry("IIS://机器名或IP/W3SVC/1/ROOT");string path = "GC://CN='机器名',DC=xxx,DC=com,DC=cn";
string strUserName = UserName + "@xxx.com.cn";
DirectoryEntry dir = new DirectoryEntry(path, strUserName, UserPassword);以上new DirectoryEntry 时,不管哪种方式系统都不会抛出异常,但跟踪对象属性时,发现几乎所有的属性都会报:
“XX.Guid”引发了“System.Runtime.InteropServices.COMException”类型的异常。如:
“de.Guid”引发了“System.Runtime.InteropServices.COMException”类型的异常
“de.Name”引发了“System.Runtime.InteropServices.COMException”类型的异常
“de.NativeGuid”引发了“System.Runtime.InteropServices.COMException”类型的异常
“de.NativeObject”引发了“System.Runtime.InteropServices.COMException”类型的异常
“de.ObjectSecurity”引发了“System.Runtime.InteropServices.COMException”类型的异常
“de.Options”引发了“System.Runtime.InteropServices.COMException”类型的异常
“de.Parent”引发了“System.Runtime.InteropServices.COMException”类型的异常
“de.SchemaClassName”引发了“System.Runtime.InteropServices.COMException”类型的异常
“de.SchemaEntry”引发了“System.Runtime.InteropServices.COMException”大家帮我看看是怎么回事儿.先谢过了。