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

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

IHttpHandler.IsReusable プロパティ

別の要求で IHttpHandler インスタンス使用できるかどうかを示す値を取得します

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

Dim instance As IHttpHandler
Dim value As Boolean

value = instance.IsReusable
bool IsReusable { get; }
property bool IsReusable {
    bool get ();
}
/** @property */
boolean get_IsReusable ()

プロパティ
IHttpHandler インスタンス再利用できる場合trueそれ以外場合false

解説解説
使用例使用例

handler.aspx という名前のページ求めクライアント要求への応答として、4 行のテキストHTTP 出力ストリーム書き込むコード例次に示します。handler.aspx に対すすべての要求は、アセンブリ HandlerTest.dll に格納されている名前空間 HandlerExampleMyHttpHandler クラスによって処理されます。

' Name this Visual Basic file HandlerTest.vb and compile it with the
' command line: vbc /target:library /r:System.Web.dll HandlerTest.vb.
' Copy HandlerTest.dll to your \bin directory.
Imports System.Web

Namespace HandlerExample
    
    Public Class MyHttpHandler
        Implements IHttpHandler
        
        ' Override the ProcessRequest method.
        Public Sub ProcessRequest(context As
 HttpContext) _
        Implements IHttpHandler.ProcessRequest
        
            context.Response.Write("<H1>This is an HttpHandler
 Test.</H1>")
            context.Response.Write("<p>Your Browser:</p>")
            context.Response.Write("Type: " &
 context.Request.Browser.Type & "<br>")
            context.Response.Write("Version: " &
 context.Request.Browser.Version)
        End Sub
        
        ' Override the IsReusable property.        
        Public ReadOnly Property
 IsReusable() As Boolean _
        Implements IHttpHandler.IsReusable
        
            Get
                Return True
            End Get
        End Property
    End Class
End Namespace

'______________________________________________________________
'
' To use this handler, include the following lines in a
' Web.config file (be sure to remove the comment markers).
'
'<configuration>
'   <system.web>
'      <httpHandlers>
'         <add verb="*" path="handler.aspx" type="HandlerExample.MyHttpHandler
,HandlerTest"/>
'      </httpHandlers>
'   </system.web>
'</configuration>

// Name this C# file HandlerTest.cs and compile it with the
// command line: csc /t:library /r:System.Web.dll HandlerTest.cs.
// Copy HandlerTest.dll to your \bin directory.

using System.Web;

namespace HandlerExample
{
   public class MyHttpHandler : IHttpHandler
   {
      // Override the ProcessRequest method.
      public void ProcessRequest(HttpContext
 context)
      {
         context.Response.Write("<H1>This is an HttpHandler Test.</H1>");
      
         context.Response.Write("<p>Your Browser:</p>");
         context.Response.Write("Type: " + context.Request.Browser.Type
 + "<br>");
         context.Response.Write("Version: " + context.Request.Browser.Version);
      }

      // Override the IsReusable property.
      public bool IsReusable
      {
         get { return true;
 }
      }
   }
}

/*
______________________________________________________________

To use this handler, include the following lines in
 a Web.config file.

<configuration>
   <system.web>
      <httpHandlers>
         <add verb="*" path="handler.aspx" type="HandlerExample.MyHttpHandler
,HandlerTest"/>
      </httpHandlers>
   </system.web>
</configuration>
*/

package HandlerExample ; 
// Name this J# file HandlerTest.jsl and compile it with the
// command line: vjc /t:Library /r:System.Web.dll HandlerTest.jsl.
// Copy HandlerTest.dll to your \bin directory.
import System.Web.*;

public class MyHttpHandler implements IHttpHandler
{
    // Override the ProcessRequest method.
    public void ProcessRequest(HttpContext
 context)
    {
        context.get_Response().
            Write("<H1>This is an HttpHandler Test.</H1>");
        context.get_Response().
            Write("<p>Your Browser:</p>");
        context.get_Response().Write(("Type: "
            + context.get_Request().get_Browser().get_Type() + "<br>"));
        context.get_Response().Write(("Version: "
            + context.get_Request().get_Browser().get_Version()));
    } //ProcessRequest

    // Override the IsReusable property.
    /** @property 
     */
    public boolean get_IsReusable()
    {
        return true;
    } //get_IsReusable
} //MyHttpHandler

/*
______________________________________________________________

To use this handler, include the following lines in
 a Web.config file.

<configuration>
   <system.web>
      <httpHandlers>
         <add verb="*" path="handler.aspx" 
            type="HandlerTest.HandlerExample.MyHttpHandler,HandlerTest"/>
      </httpHandlers>
   </system.web>
</configuration>
*/

// Name this JScript file handlertest.js and compile it with the
// command line: jsc /t:library /r:system.web.dll handlertest.js
// Copy HandlerTest.dll to your bin directory.
import System.Web

package HandlerExample{
    
    class MyHttpHandler implements IHttpHandler{
        
        // Override the ProcessRequest method.
        function IHttpHandler.ProcessRequest(context : HttpContext){
            context.Response.Write("<H1>This is an HttpHandler Test.</H1>")
            context.Response.Write("<p>Your Browser:</p>")
            context.Response.Write("Type: " + context.Request.Browser.Type
 + "<br>")
            context.Response.Write("Version: " + context.Request.Browser.Version)
        }
        
        // Override the IsReusable property.        
        function get IHttpHandler.IsReusable()
 : Boolean{
            return true
        }
    }
}

//______________________________________________________________
//
// To use the above handler, use the following lines in a
// Web.config file (remove the comment markers)
//
//<configuration>
//   <system.web>
//      <httpHandlers>
//         <add verb="*" path="handler.aspx" type="HandlerExample.MyHttpHandler
,HandlerTest"/>
//      </httpHandlers>
//   </system.web>
//</configuration>

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

「IHttpHandler.IsReusable プロパティ」の関連用語

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

   

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



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

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

©2024 GRAS Group, Inc.RSS