ProfileMigrateEventArgs 클래스

정의

MigrateAnonymous 클래스의 ProfileModule 이벤트에 데이터를 제공합니다.

public ref class ProfileMigrateEventArgs sealed : EventArgs
public sealed class ProfileMigrateEventArgs : EventArgs
type ProfileMigrateEventArgs = class
    inherit EventArgs
Public NotInheritable Class ProfileMigrateEventArgs
Inherits EventArgs
상속
ProfileMigrateEventArgs

예제

다음 코드 예제에서는 익명 인증을 사용 하도록 설정 하는 Web.config 파일을 표시 하며 MigrateAnonymous ASP.NET 애플리케이션의 Global.asax 파일에 포함 된 이벤트입니다.

다음 코드 예제에서는 익명 id를 사용 하도록 설정 하는 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>  

다음 코드 예제는 MigrateAnonymous ASP.NET 애플리케이션의 Global.asax 파일에 포함 된 이벤트입니다. MigrateAnonymous 이벤트 익명 프로필에서 현재 사용자의 프로필에 프로필 속성 값을 복사 합니다.

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(); 

  // Delete the user row that was created for the anonymous user.
  Membership.DeleteUser(args.AnonymousID, true);

}
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()

  ' Delete the user row that was created for the anonymous user.
  Membership.DeleteUser(args.AnonymousID, True)
End Sub

설명

ProfileMigrateEventArgs 개체는 이벤트 정보를 제공 합니다 MigrateAnonymous 의 이벤트는 ProfileModule 클래스. ProfileMigrateEventArgs 개체에 대 한 액세스를 제공 합니다 HttpContext 현재 요청 및 익명 프로필에 대 한 익명 사용자 식별자는 AnonymousID 속성입니다.

사용할 수는 MigrateAnonymous 프로필 속성을 복사 하는 이벤트 값 익명 프로필에서 인증된 된 프로필에 익명으로 사용 하 여 애플리케이션 사용자가 로그인 할 때입니다.

사용자 프로필을 사용 하는 애플리케이션 시작 되 면 ASP.NET 형식의 새 클래스를 만듭니다 ProfileCommon에서 상속 되는 ProfileBase 클래스입니다. 경우는 ProfileCommon 클래스 Web.config 파일에 지정 된 프로필 속성을 기반으로 생성 되는 GetProfile 검색할 수 있도록 메서드가 추가 됩니다를 ProfileCommon 개체 이름을 기반으로 사용자. 사용할 수는 GetProfile 메서드의 현재 프로필을 익명 프로필의 속성 값을 검색 합니다. 그런 다음 인증된 된 사용자에 대 한 현재 프로필에 익명 속성 값을 복사할 수 있습니다.

생성자

ProfileMigrateEventArgs(HttpContext, String)

ProfileMigrateEventArgs 클래스의 인스턴스를 만듭니다.

속성

AnonymousID

프로필 속성 값을 마이그레이션할 익명 프로필에 대한 익명 식별자를 가져옵니다.

Context

현재 요청에 대한 HttpContext를 가져옵니다.

메서드

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

적용 대상

추가 정보