ASP 응용 프로그램 개체
어떤 목적을 수행하기 위해 함께 작동하는 ASP 파일 그룹을 응용 프로그램이라고 합니다. Application 개체는 이러한 파일을 함께 묶는 데 사용됩니다.
응용 프로그램 개체
웹상의 응용 프로그램은 어떤 목적을 수행하기 위해 함께 작동하는 여러 ASP 파일로 구성될 수 있습니다. Application 개체는 이러한 파일을 함께 묶는 데 사용됩니다.
Application 개체는 Session 개체와 마찬가지로 모든 페이지의 변수를 저장하고 액세스하는 데 사용됩니다. 차이점은 모든 사용자가 하나의 응용 프로그램 개체를 공유한다는 것입니다(세션에는 각 사용자에 대해 하나의 세션 개체가 있음).
Application 개체는 데이터베이스 연결 정보와 같은 응용 프로그램의 많은 페이지에서 사용할 정보를 보유합니다. 정보는 모든 페이지에서 액세스할 수 있습니다. 정보 변경도 한 곳에서 가능하며 변경 사항은 자동으로 모든 페이지에 반영됩니다.
Application 개체의 컬렉션, 메서드 및 이벤트는 아래에 설명되어 있습니다.
컬렉션
Collection | Description |
---|---|
Contents | Contains all the items appended to the application through a script command |
StaticObjects | Contains all the objects appended to the application with the HTML <object> tag |
행동 양식
Method | Description |
---|---|
Contents.Remove | Deletes an item from the Contents collection |
Contents.RemoveAll() | Deletes all items from the Contents collection |
Lock | Prevents other users from modifying the variables in the Application object |
Unlock | Enables other users to modify the variables in the Application object (after it has been locked using the Lock method) |
이벤트
Event | Description |
---|---|
Application_OnEnd | Occurs when all user sessions are over, and the application ends |
Application_OnStart | Occurs before the first new session is created (when the Application object is first referenced) |