كائن تطبيق ASP
تسمى مجموعة ملفات ASP التي تعمل معًا لأداء بعض الأغراض تطبيقًا. يتم استخدام كائن التطبيق لربط هذه الملفات معًا.
كائن التطبيق
قد يتكون التطبيق الموجود على الويب من عدة ملفات ASP تعمل معًا لأداء بعض الأغراض. يتم استخدام كائن التطبيق لربط هذه الملفات معًا.
يتم استخدام كائن التطبيق لتخزين المتغيرات والوصول إليها من أي صفحة ، تمامًا مثل كائن Session. الفرق هو أن جميع المستخدمين يشاركون كائن تطبيق واحد (مع الجلسات ، يوجد كائن جلسة واحد لكل مستخدم).
يحتفظ كائن التطبيق بالمعلومات التي سيتم استخدامها بواسطة العديد من الصفحات في التطبيق (مثل معلومات اتصال قاعدة البيانات). يمكن الوصول إلى المعلومات من أي صفحة. يمكن أيضًا تغيير المعلومات في مكان واحد ، وستنعكس التغييرات تلقائيًا على جميع الصفحات.
يتم وصف مجموعات كائن التطبيق وطرقه وأحداثه أدناه:
المجموعات
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) |