ProfileMigrateEventArgs.AnonymousID プロパティ
アセンブリ: System.Web (system.web.dll 内)

プロファイルのプロパティ値を移行する先の匿名プロファイルの、匿名 ID。

AnonymousID プロパティには、匿名ユーザーに対する一意の ID が含まれます。あるユーザーがアプリケーションを使用して匿名でログインしている場合、MigrateAnonymous イベントを処理することで、プロファイルのプロパティ値を、そのユーザーの匿名プロファイルからユーザー固有の認証済みプロファイルにコピーできます。
ユーザー プロファイルが有効にされたアプリケーションを起動すると、ASP.NET によって、ProfileBase クラスを継承する ProfileCommon 型の新しいクラスが作成され、Web.config file で指定されたプロファイル プロパティが含められます。ProfileCommon クラスが生成されると、GetProfile メソッドが追加され、ユーザー名に基づいて ProfileCommon オブジェクトを取得できるようになります。現在のプロファイルの GetProfile メソッドを使用して、匿名プロファイルのプロパティ値を取得できます。その後、匿名プロファイルのプロパティ値は、認証済みユーザーの現在のプロファイルにコピーされます。匿名プロパティ値のコピー例については、2 番目のコード例を参照してください。

匿名認証と ASP.NET アプリケーションの Global.asax ファイルに含まれる MigrateAnonymous イベントを有効にする Web.config ファイルを次のコード例に示します。
匿名識別および匿名ユーザーをサポートするプロファイル プロパティを有効にする Web.config ファイルを次のコード例に示します。
<configuration> <system.web> <authentication mode="Forms" > <forms loginUrl="login.aspx" name=".ASPXFORMSAUTH" /> </authentication> <AnonymousIdentification enabled="true" /> <profile enabled="true" defaultProvider="AspNetSqlProvider"> <properties> <add name="ZipCode" allowAnonymous="true" /> <add name="CityAndState" allowAnonymous="true" /> <add name="StockSymbols" type="System.Collections.ArrayList" allowAnonymous="true" /> </properties> </profile> </system.web> </configuration>
ASP.NET アプリケーションの Global.asax ファイルに含まれる MigrateAnonymous イベントを次のコード例に示します。MigrateAnonymous イベントは、匿名プロファイルから現在のユーザーのプロファイルへと、プロファイルのプロパティ値をコピーします。
Public Sub Profile_OnMigrateAnonymous(sender As Object, args As ProfileMigrateEventArgs) Dim anonymousProfile As ProfileCommon = Profile.GetProfile(args.AnonymousID) Profile.ZipCode = anonymousProfile.ZipCode Profile.CityAndState = anonymousProfile.CityAndState Profile.StockSymbols = anonymousProfile.StockSymbols '''''''' ' Delete the anonymous profile. If the anonymous ID is not ' needed in the rest of the site, remove the anonymous cookie. ProfileManager.DeleteProfile(args.AnonymousID) AnonymousIdentificationModule.ClearAnonymousIdentifier() End Sub
public void Profile_OnMigrateAnonymous(object sender, ProfileMigrateEventArgs args) { ProfileCommon anonymousProfile = Profile.GetProfile(args.AnonymousID); Profile.ZipCode = anonymousProfile.ZipCode; Profile.CityAndState = anonymousProfile.CityAndState; Profile.StockSymbols = anonymousProfile.StockSymbols; //////// // Delete the anonymous profile. If the anonymous ID is not // needed in the rest of the site, remove the anonymous cookie. ProfileManager.DeleteProfile(args.AnonymousID); AnonymousIdentificationModule.ClearAnonymousIdentifier(); }

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からProfileMigrateEventArgs.AnonymousID プロパティを検索する場合は、下記のリンクをクリックしてください。

- ProfileMigrateEventArgs.AnonymousID プロパティのページへのリンク