Share via


AuthManager.SetProperty Method (PIA)

Use this method to place a custom property name/value pair into the current ticket for the user.

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop
…
Public Sub SetProperty(enumTicketTypeAs TicketTypeEnum,
  propName As String,
  propVal As String)

[C#]

using Microsoft.CommerceServer.Interop;
…
void SetProperty(TicketTypeEnumenumTicketType,
  stringpropName,
  stringpropVal);

Parameters

[Visual Basic .NET]

  • enumTicketType
    A TicketTypeEnum that indicates the type of ticket.
  • propName
    A String that contains the name of the property.
  • propVal
    A String that contains the value corresponding to the named property.

[C#]

  • enumTicketType
    A Microsoft.CommerceServer.Interop.TicketTypeEnum that indicates the type of ticket.
  • propName
    A string that contains the name of the property.
  • propVal
    A string that contains the value corresponding to the named property.

Exceptions

This method may throw one of many mapped exceptions or an exception of type COMException. See Standard COM Errors for additional details.

[Visual Basic .NET]

The following table shows the custom COM errors that this method can return.

Value Description
&HC1004C23 Invalid character (';' or '=') present in the property name/value pair.
&HC1004C27 Invalid custom property name or value.
&HC1004C24 This method should only be called within an ASP page.
&HC1004C10 The Initialize method must be called with the installed site name before calling this method.
&HC1004C40 The ticket has reached a maximum size of 4 kilobytes.

[C#]

The following table shows the custom COM errors that a COMException can wrap.

Value Description
0xC1004C23 Invalid character (';' or '=') present in the property name/value pair.
0xC1004C27 Invalid custom property name or value.
0xC1004C24 This method should only be called within an ASP page.
0xC1004C10 The Initialize method must be called with the installed site name before calling this method.
0xC1004C40 The ticket has reached a maximum size of 4 kilobytes.

Remarks

Use the GetProperty method to retrieve the custom property values from the current ticket. See the Remarks section in the GetProperty topic for a discussion of using enumerator values in code.

The following table defines the possible values for the Microsoft.CommerceServer.Interop.TicketTypeEnum.

Name Value Description
ProfileTicketType 1 A Profile ticket used for an anonymous user.
AuthTicketType 2 An Auth ticket used for a registered user.

Ee810394.note(en-US,CS.20).gif Note

  • A property with the name "Ticket" is used by the AuthManager object for storing Commerce Server 2002 related information. When creating a custom property, do not set the property name to "Ticket".

[Visual Basic .NET]

Example

' oAuthManager is a Commerce AuthManager object

oAuthManager.SetProperty (AuthTicketType, "Password", "MyPassword123")

Requirements

Namespace: Microsoft.CommerceServer.Interop

Platforms: Windows 2000, Windows Server 2003

Assembly: mscsauthlib (in mscsauthlib.dll)

See Also

AuthManager Class

AuthManager.GetProperty

Copyright © 2005 Microsoft Corporation.
All rights reserved.