ProfileModule 클래스

정의

사용자 프로필과 프로필 이벤트의 작성을 관리합니다. 이 클래스는 상속될 수 없습니다.

public ref class ProfileModule sealed : System::Web::IHttpModule
public sealed class ProfileModule : System.Web.IHttpModule
type ProfileModule = class
    interface IHttpModule
Public NotInheritable Class ProfileModule
Implements IHttpModule
상속
ProfileModule
구현

예제

다음 예제에서는 익명 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

설명

사용자 프로필을 사용 하는 경우 ASP.NET 사용 합니다 ProfileModule 사용자 프로필을 만들고 저장 하는 Profile 속성이 현재 HttpContext합니다.

ProfileModule 애플리케이션에서 인증을 구성 하는 동안 처리할 수 있습니다 다음 이벤트를 노출 합니다.

  • MigrateAnonymous 익명 사용자가 로그인 할 때 인증된 프로필을 익명 프로필의 프로필 설정을 마이그레이션하려면 이벤트입니다.

  • Personalize 사용자 프로필을 만든 방법을 사용자 지정 하는 경우.

  • 합니다 ProfileAutoSaving 일 때 사용자 프로필 저장 되는 방법을 제어 하는 경우는 AutomaticSaveEnabled 속성이 true합니다.

사용자 프로필을 사용 하도록 설정 하는 방법에 대 한 내용은 profile 요소 (ASP.NET 설정 스키마)합니다.

생성자

ProfileModule()

ProfileModule 클래스의 새 인스턴스를 초기화합니다.

메서드

Dispose()

ProfileModule에서 사용하는 모든 리소스를 해제합니다.

Equals(Object)

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

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

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

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

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

(다음에서 상속됨 Object)
Init(HttpApplication)

ProfileModule 개체가 만들어질 때 초기화 코드를 호출합니다.

MemberwiseClone()

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

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

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

(다음에서 상속됨 Object)

이벤트

MigrateAnonymous

프로필의 익명 사용자가 로그인할 때 발생합니다.

Personalize

사용자 프로필이 만들어지기 전에 발생합니다.

ProfileAutoSaving

자동 프로필 저장을 사용하는 경우 페이지 실행이 끝날 때 발생합니다.

적용 대상

추가 정보