Click or drag to resize

IWsCloudStorageSetCloudStorageAccountResetPassword Method

By the method SetCloudStorageAccountPassword you can reset a Cloud Storage Account password. The new password will be send for email

Namespace:  Aruba.Cloud.WsCloudStorage
Assembly:  WsCloudStorage (in WsCloudStorage.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
[OperationContractAttribute]
WsResult SetCloudStorageAccountResetPassword(
	int cloudStorageAccountID
)

Parameters

cloudStorageAccountID
Type: SystemInt32

Return Value

Type: WsResult
Examples
/// WsCloudStorage.SetCloudStorageAccountResetPassword Method (c# .NET)
public static string SetCloudStorageAccountResetPassword (WsCloudStorageClient client,
    int cloudStorageAccountId)
{
    //specify the account login details 
    client.ClientCredentials.UserName.UserName = "ARU-0000";
    client.ClientCredentials.UserName.Password = "0123456789";

    StringBuilder stringBuilder = new StringBuilder();

    try
    {
        // call method SetCloudStorageAccountResetPassword, 
        // obtaining a WsCloudStorage.WsResult item
        WsCloudStorage.WsResult result = 
            client.SetCloudStorageAccountResetPassword(cloudStorageAccountId);

        // if the call is successfull return code e message else  re-run the error
        if (result.Success)
        {
            // print the result code and message
            stringBuilder.Append("Code: ");
            stringBuilder.Append(result.ResultCode);
            stringBuilder.Append(" - Message: ");
            stringBuilder.Append(result.ResultMessage);
        }
        else
        {
            throw new ApplicationException(result.ExceptionInfo._fullString);
        }
    }
    catch (Exception ex)
    {
        // re-run the error
        throw new ApplicationException(ex.Message);
    }

    return stringBuilder.ToString(); 
}
See Also