AnonymousIdentificationEventArgs.AnonymousID 屬性

定義

取得或設定使用者的匿名識別項。

public:
 property System::String ^ AnonymousID { System::String ^ get(); void set(System::String ^ value); };
public string AnonymousID { get; set; }
member this.AnonymousID : string with get, set
Public Property AnonymousID As String

屬性值

使用者的匿名識別項。

範例

下列程式碼範例會使用 AnonymousIdentification_Creating 事件,將匿名識別碼設定為自訂值。

public void AnonymousIdentification_Creating(object sender, 
                                             AnonymousIdentificationEventArgs args)
{
  args.AnonymousID = Samples.AspNet.Security.MyIdClass.GetAnonymousId();
  Samples.AspNet.Security.MyIdClass.LogAnonymousId(args.AnonymousID);
}
Public Sub AnonymousIdentification_Creating(sender As Object,  _
                                            args As AnonymousIdentificationEventArgs)
  args.AnonymousID = Samples.AspNet.Security.MyIdClass.GetAnonymousId()
  Samples.AspNet.Security.MyIdClass.LogAnonymousId(args.AnonymousId)
End Sub

備註

您可以使用 AnonymousID 屬性,在 AnonymousIdentification_Creating 事件期間將匿名識別碼設定為自訂值。 如果您在AnonymousIdentification_Creating事件期間未指定 屬性的值 AnonymousIDGuid 則會使用 。

只有在匿名識別為 Enabled 時,才會引發AnonymousIdentification_Creating事件。

適用於