-2

我尝试使用此代码启用 Windows 帐户,但我在此行 ActiveDirectorySecurity userSecurity = user.ObjectSecurity;

4

1 回答 1

1

I would suspect that your error would be on the 5th line in the code

user.Properties["userAccountControl"].Value = val & ~0x2; //this will error

and if you were to debug it you would probably see the following error

Error Pointers and fixed size buffers may only be used in an unsafe context

于 2012-02-13T21:51:36.870 回答