WebService.Context プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > WebService.Context プロパティの意味・解説 

WebService.Context プロパティ

現在の要求対すASP.NET HttpContext を取得します。これには、HTTP サーバーWeb 要求処理するために使用するすべての HTTP 固有のコンテキストカプセル化されています。

名前空間: System.Web.Services
アセンブリ: System.Web.Services (system.web.services.dll 内)
構文構文

Dim instance As WebService
Dim value As HttpContext

value = instance.Context
public HttpContext Context { get; }
public:
property HttpContext^ Context {
    HttpContext^ get ();
}
/** @property */
public HttpContext get_Context ()

プロパティ
現在の要求対すASP.NET HttpContext

例外例外
例外種類条件

Exception

Contextnull 参照 (Visual Basic では Nothing) です。

解説解説

SoapRpcMethodAttribute 属性または SoapDocumentMethodAttribute 属性適用されており、OneWay プロパティtrue設定されている XML Web サービス メソッドでは、静的Current プロパティ使用して HttpContextアクセスしないでくださいHttpContextアクセスするには、XML Web サービスメソッド実装するクラスWebService から派生しContext プロパティアクセスます。

使用例使用例

Context プロパティ使用してサーバーでの要求時刻取得する例を次に示します

<%@ WebService Language="VB" Class="Util"
 %>
 
Imports System
Imports System.Web.Services

Public Class Util
    Inherits WebService
    
    <WebMethod(Description := "Returns the time as stored on
 the Server", _
        EnableSession := False)> _
    Public Function Time() As
 String
        
        Return Context.Timestamp.TimeOfDay.ToString()
    End Function
End Class
 
<%@ WebService Language="C#" Class="Util" %>
 
 using System;
 using System.Web.Services;
 
 public class Util: WebService {
   [ WebMethod(Description="Returns the time as stored on the Server",
   EnableSession=false)]
   public string Time() {
      return Context.Timestamp.TimeOfDay.ToString();
   }
 }
 
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からWebService.Context プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からWebService.Context プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からWebService.Context プロパティ を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

WebService.Context プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



WebService.Context プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS