RegisterId Method  
 

Register a new application identifier with the storage service.

Syntax

object.RegisterId ( AppId )

Parameters

AppId
A string which identifies the application requesting access. If the application ID contains illegal characters, the method will fail. See the remarks below on the recommended method for identifying your application.

Return Value

A value of True is returned if the application ID was registered successfully. Otherwise, a value of False is returned and the LastError property will return the specific cause of the failure.

Remarks

The RegisterId method registers an application ID with the server which uniquely identifies the application that is requesting access to the storage container. The ID must only consist of ASCII letters, numbers, the period and underscore character. Whitespace characters and non-ASCII Unicode characters are not permitted. The maximum length of an application ID string is 63 characters.

 It is recommended that you use a standard format for the application ID that consists of your company name, application name and optionally a version number. For example:

  • MyCompany.MyApplication
  • MyCompany.MyApplication.1

It is important to note that with these two example IDs, although they are similar, they reference two different applications. Objects stored using the first ID will not be accessible using the second ID. If you want to store objects that should be shared between all versions of the application, it is recommended that you use the first form, without the version number. If you want to store objects that should only be accessible to a specific version of your application, then it is recommended that you use the second form that includes the version number.

It is safe to call this method with an application ID that was previously registered. If the provided application ID has already been registered, this method will succeed.

If you no longer wish to use an application ID you have previously registered, you can call the UnregisterId method. Exercise caution when unregistering an application. This will cause all objects stored using that ID to be deleted by the storage server. Once an application ID has been unregistered, the operation is permanent. Calling UnregisterId and then RegisterId again using the same ID will force the system to create new access tokens for your application. You will not be able to regain access to the objects that were previously stored using that ID.

The application ID is intended to be an application defined human-readable string that uniquely identifies your application. If you want to obtain the internal storage ID associated with your application, get the value of the StorageId property. The storage ID is a fixed-length string of letters and numbers guaranteed to be unique across all applications that you register.

It is not required for your application to create a unique application ID. Each storage account has a default internal application ID named SocketTools.Storage.Default. This default ID is used if an application-defined ID is not provided to the Open method. It is intended to identify storage available to all applications that you create.

See Also

AppId Property, Open Method, UnregisterId Method, ValidateId Method