WebService.Application プロパティ
アセンブリ: System.Web.Services (system.web.services.dll 内)

Public ReadOnly Property Application As HttpApplicationState
public HttpApplicationState Application { get; }
HttpApplicationState オブジェクト。

XML Web サービスは、アプリケーション状態とセッション状態を両方とも使用できます。アプリケーション状態は、WebMethodAttribute の EnableSession プロパティを使用して、メソッドに対してセッション状態をオフにしているかどうかに関係なく、XML Web サービスにアクセスするすべてのセッションにわたって維持されます。

ブラウザが XML Web サービス メソッドを呼び出すたびにインクリメントするヒット カウンタの例を次に示します。
<%@ WebService Language="VB" Class="Util"%> Imports System.Web.Services Public Class Util Inherits WebService <WebMethod(Description := "Application Hit Counter", _ EnableSession := False)> _ Public Function HitCounter() As Integer If Application("HitCounter") Is Nothing Then Application("HitCounter") = 1 Else Application("HitCounter") = CInt(Application("HitCounter")) + 1 End If Return CInt(Application("HitCounter")) End Function End Class
<%@ WebService Language="C#" Class="Util"%> using System.Web.Services; public class Util: WebService { [ WebMethod(Description="Application Hit Counter",EnableSession=false)] public int HitCounter() { if (Application["HitCounter"] == null) { Application["HitCounter"] = 1; } else { Application["HitCounter"] = ((int) Application["HitCounter"]) + 1; } return ((int) Application["HitCounter"]); } }

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に収録されているすべての辞書からWebService.Application プロパティを検索する場合は、下記のリンクをクリックしてください。

- WebService.Application プロパティのページへのリンク