ProfileMigrateEventHandler デリゲート
アセンブリ: System.Web (system.web.dll 内)

Public Delegate Sub ProfileMigrateEventHandler ( _ sender As Object, _ e As ProfileMigrateEventArgs _ )
/** @delegate */ public delegate void ProfileMigrateEventHandler ( Object sender, ProfileMigrateEventArgs e )

ProfileMigrateEventHandler デリゲートは、ProfileModule クラスの MigrateAnonymous イベントに対して定義されています。ASP.NET アプリケーションの Global.asax ファイルの ProfileModule クラスの MigrateAnonymous イベントには、このトピックの例に示されている方法によってアクセスできます。
MigrateAnonymous イベントを使用すると、ユーザーがアプリケーションを使用して匿名でログインしている場合、プロファイル プロパティ値を匿名プロファイルから認証済みプロファイルにコピーできます。
ユーザー プロファイルが有効にされたアプリケーションを起動すると、ASP.NET によって、ProfileBase クラスを継承する ProfileCommon 型の新しいクラスが作成されます。ProfileCommon クラスが生成されると、Web.config ファイルで指定されたプロファイル プロパティに従って GetProfile メソッドが追加されます。これにより、ユーザー名に基づいてProfileCommon オブジェクトを取得できるようになります。現在のプロファイルの GetProfile メソッドを使用して、匿名プロファイルのプロパティ値を取得できます。その後、匿名プロファイルのプロパティ値は、認証済みユーザーの現在のプロファイルにコピーされます。

匿名認証と 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に収録されているすべての辞書からProfileMigrateEventHandler デリゲートを検索する場合は、下記のリンクをクリックしてください。

- ProfileMigrateEventHandler デリゲートのページへのリンク