Principal.Save 方法
定义
将对主体对象所做的更改保存到存储区中。Saves the changes that were made on the principal object to the store. 如果它是一个新主体对象,则此方法会将其插入到存储区中。If this is a new principal object, this method inserts it into the store.
重载
| Save() |
将对主体对象所做的更改保存到存储区中。Saves the changes that were made on the principal object to the store. 如果它是一个新主体对象,则此方法会将其插入到存储区中。If this is a new principal object, this method inserts it into the store. |
| Save(PrincipalContext) |
将对主体对象所做的更改保存到存储区中。Saves the changes that were made on the principal object to the store. 如果它是一个新主体对象,则此方法会将其插入到指定上下文中。If this is a new principal object, this method inserts it into the specified context. 如果已保持主体,则会将该主体从原来的上下文移动到指定的上下文中。If the principal has already been persisted, it is moved from the original context to the specified context. |
Save()
将对主体对象所做的更改保存到存储区中。Saves the changes that were made on the principal object to the store. 如果它是一个新主体对象,则此方法会将其插入到存储区中。If this is a new principal object, this method inserts it into the store.
public:
void Save();
public void Save ();
[System.Security.SecurityCritical]
public void Save ();
member this.Save : unit -> unit
[<System.Security.SecurityCritical>]
member this.Save : unit -> unit
Public Sub Save ()
- 属性
例外
主体尚未与 PrincipalContext 对象关联。The principal has not yet been associated with a PrincipalContext object.
无法将此类型的主体插入到存储区中。This type of principal cannot be inserted in the store.
将更改保存到存储区或更新存储区中的组成员资格时发生异常。An exception occurred when saving changes to the store, or updating the group membership in the store.
存储区中已经存在该主体。The principal already occurs in the store.
密码不满足复杂度要求。The password does not meet complexity requirements.
适用于
Save(PrincipalContext)
将对主体对象所做的更改保存到存储区中。Saves the changes that were made on the principal object to the store. 如果它是一个新主体对象,则此方法会将其插入到指定上下文中。If this is a new principal object, this method inserts it into the specified context. 如果已保持主体,则会将该主体从原来的上下文移动到指定的上下文中。If the principal has already been persisted, it is moved from the original context to the specified context.
public:
void Save(System::DirectoryServices::AccountManagement::PrincipalContext ^ context);
public void Save (System.DirectoryServices.AccountManagement.PrincipalContext context);
[System.Security.SecurityCritical]
public void Save (System.DirectoryServices.AccountManagement.PrincipalContext context);
member this.Save : System.DirectoryServices.AccountManagement.PrincipalContext -> unit
[<System.Security.SecurityCritical>]
member this.Save : System.DirectoryServices.AccountManagement.PrincipalContext -> unit
Public Sub Save (context As PrincipalContext)
参数
- context
- PrincipalContext
PrincipalContext,用于指定要对其执行操作的服务器或域。The PrincipalContext that specifies the server or domain against which operations are performed.
- 属性
例外
主体尚未与 PrincipalContext 对象关联。The principal has not yet been associated with a PrincipalContext object.
无法将此类型的主体插入到存储区中。This type of principal cannot be inserted in the store.
将更改保存到存储区或更新存储区中的组成员资格时发生异常。An exception occurred when saving changes to the store, or updating the group membership in the store.
存储区中已经存在该主体。The principal already occurs in the store.
密码不满足复杂度要求。The password does not meet complexity requirements.
注解
如果指定的主体上下文与现有上下文不同,则主体将移动到指定的上下文,并且主体对象将不再位于旧位置。If the specified principal context differs from the existing context, the principal is moved to the specified context, and the principal object no longer is located in the old location. 如果指定的上下文与现有上下文完全相同,则此方法会将对主体对象所做的更新保存到存储区。If the specified context is identical to the existing context, this method saves the updates that were made on the principal object to the store. 指定上下文的上下文类型必须与当前上下文类型的类型相同。The context type of the specified context must be the same type as the current context type. 不能使用计算机上下文类型调用此方法。This method may not be called by using the computer context type.