VirtualPathProviderとは? わかりやすく解説

VirtualPathProvider クラス

メモ : このクラスは、.NET Framework version 2.0新しく追加されたものです。

Web アプリケーションによって仮想ファイル システムリソース取得できるようにする一連のメソッド用意されています。

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

Public MustInherit Class
 VirtualPathProvider
    Inherits MarshalByRefObject
Dim instance As VirtualPathProvider
public abstract class VirtualPathProvider :
 MarshalByRefObject
public ref class VirtualPathProvider abstract
 : public MarshalByRefObject
public abstract class VirtualPathProvider extends
 MarshalByRefObject
public abstract class VirtualPathProvider extends
 MarshalByRefObject
解説解説

VirtualPathProvider クラスには、Web アプリケーション仮想ファイル システム実装するための一連のメソッド用意されています。仮想ファイル システムでは、サーバーオペレーティング システム提供されるファイル システムとは別のデータ ストアファイルおよびディレクトリ管理されます。たとえば、仮想ファイル システム使用してSQL Server データベースの内容格納できます

要求に応じて処理される任意のファイル仮想ファイル システム格納できます。これには、次のものが含まれます。

アプリケーション レベルアセンブリ生成する ASP.NET アプリケーション フォルダファイルは、仮想ファイル システム格納できません。これには、次のものが含まれます。

メモメモ

Web サイト配置のためにプリコンパイルされている場合VirtualPathProvider インスタンスによって提供される内容コンパイルされません。プリコンパイル済みサイトでは VirtualPathProvider インスタンス使用されません。

T:System.Web.Hosting.VirtualPathProvider の登録

VirtualPathProvider カスタム インスタンスは、Web アプリケーションによるページ解析コンパイル前に、HostingEnvironment.RegisterVirtualPathProvider メソッド使用して ASP.NET コンパイル システム登録する必要があります

通常VirtualPathProvider インスタンスは、App_Code ディレクトリ定義されている AppInitialize メソッド登録されるか、または Global.asax ファイル定義されている Application_Start イベント時に登録されます。AppInitialize メソッドVirtualPathProvider インスタンス登録する例については、「例」を参照してください

他のイベント時に VirtualPathProvider インスタンスを登録できますが、以前コンパイル済みページソース新しVirtualPathProvider インスタンスによって提供されても、VirtualPathProvider インスタンス登録される前にコンパイルおよびキャッシュされたページ無効になりません。

継承時の注意 VirtualPathProvider から継承する場合は、次のメンバオーバーライドする必要があります

  • FileExists

  • GetFile

VirtualPathProvider カスタム クラス仮想ファイル システムディレクトリサポートする場合は、次のメンバオーバーライドする必要があります
  • DirectoryExists

  • GetDirectory

メモメモ

App_Themes 仮想 ディレクトリ作成することにより、仮想ファイル システムWeb サイトテーマ格納する場合は、VirtualPathProvider カスタム クラスディレクトリサポートする必要があります

VirtualPathProvider カスタム クラスは、VirtualFile クラスおよび VirtualDirectory クラスから派生したクラス連携して動作します仮想ファイル システムファイル情報およびディレクトリ情報提供するには、これらの型の派生クラス実装する必要がありますカスタム VirtualFile実装例については、VirtualFile クラス概要トピックで「例」を参照してくださいカスタム VirtualDirectory実装例については、VirtualDirectory クラス概要トピックで「例」を参照してください
使用例使用例

DataSet オブジェクト格納されている情報使用して仮想ファイル システム作成する VirtualPathProvider クラス実装例次のコード例示します。このコード例は、VirtualFile クラスおよび VirtualDirectory クラスコード例連携してDataSet オブジェクト読み込まれデータ ストアから仮想リソース返します

この例は、4 つ部分構成されます。最初に VirtualPathProvider クラス実装例示します次にDataSet オブジェクト設定するために使用される XML データ ファイル示します。さらに、VirtualPathProvider クラスコンパイル システム登録するために使用される AppInitialize メソッド定義されている AppStart オブジェクト示します最後に仮想ファイルへのリンクを提供する ASP.NET ページ示します

このサンプル コードアプリケーション使用するには、次の手順実行します

  1. Web サーバーサンプル アプリケーション作成します

  2. VirtualPathProvider カスタム オブジェクト (下記参照) のソース コードを、アプリケーションApp_Code ディレクトリ内にあるファイルコピーします

  3. VirtualDirectory カスタム オブジェクトソース コードを、アプリケーションApp_Code ディレクトリ内にあるファイルコピーします。このソース コードについては、VirtualDirectory クラス概要トピックで「例」を参照してください

  4. VirtualFile カスタム オブジェクトソース コードを、アプリケーションApp_Code ディレクトリ内にあるファイルコピーします。このソース コードについては、VirtualFile クラス概要トピックで「例」を参照してください

  5. AppStart オブジェクトソース コード (下記参照) を、アプリケーションApp_Code ディレクトリ内にあるファイルコピーします

  6. XML データ (下記参照) をアプリケーションApp_Data ディレクトリ内にある XMLData.xml という名前のファイルコピーします

  7. default.aspx ファイル (下記参照) をサンプル アプリケーションルート ディレクトリコピーしますWeb ブラウザ使用して default.aspx ファイル開きページ上のリンクをクリックして仮想ファイル内容表示します

最初の例は、VirtualPathProvider カスタム クラスです。DirectoryExists メソッドおよび FileExists メソッドオーバーライドして、要求されディレクトリ仮想ファイル システム内に存在するかどうか示しますGetDirectory メソッドおよび GetFile メソッドオーバーライドして、仮想ファイル システム情報格納している VirtualDirectory インスタンスおよび VirtualFile インスタンス返します

このクラスは、VirtualDirectory クラスおよび VirtualFile クラス使用される GetVirtualData メソッド提供します。これにより、仮想ファイル システムデータ格納している DataSet オブジェクトアクセスできるようになります本番実装では、このメソッドは、通常データ ストア対話するビジネス オブジェクト実装されます

Imports Microsoft.VisualBasic

Imports System
Imports System.Data
Imports System.Security.Permissions
Imports System.Web
Imports System.Web.Caching
Imports System.Web.Hosting


Namespace Samples.AspNet.VB
  <AspNetHostingPermission(SecurityAction.Demand, Level:=AspNetHostingPermissionLevel.Medium),
 _
   AspNetHostingPermission(SecurityAction.InheritanceDemand, level:=AspNetHostingPermissionLevel.High)>
 _
  Public Class SamplePathProvider
    Inherits VirtualPathProvider

    Private dataFile As String

    Public Sub New()
      MyBase.New()
    End Sub

    Protected Overrides Sub
 Initialize()
      ' Set the datafile path relative to the application's path.
      dataFile = HostingEnvironment.ApplicationPhysicalPath & _
        "App_Data\XMLData.xml"
    End Sub

    ' <summary>
    '   Data set provider for the SampleVirtualFile and
    '   SampleVirtualDirectory classes. In a production application
    '   this method would be on a provider class that accesses
    '   the virtual resource data source.
    ' </summary>
    ' <returns>
    '   The System.Data.DataSet containing the virtual resources
    '   provided by the SamplePathProvider.
    ' </returns>
    Public Function GetVirtualData() As
 DataSet
      ' Get the data from the cache.
      Dim ds As DataSet
      ds = CType(HostingEnvironment.Cache.Get("VPPData"),
 DataSet)

      If ds Is Nothing Then
        ' Data set not in cache. Read XML file.
        ds = New DataSet
        ds.ReadXml(dataFile)

        ' Make DataSet dependent on XML file.
        Dim cd As CacheDependency
        cd = New CacheDependency(dataFile)

        ' Put DataSet into cache for maximum of 20 minutes.
        HostingEnvironment.Cache.Add("VPPData", ds,
 cd, _
         Cache.NoAbsoluteExpiration, _
         New TimeSpan(0, 20, 0), _
         CacheItemPriority.Default, Nothing)

        ' Set data timestamp.
        Dim dataTimeStamp As DateTime
        dataTimeStamp = DateTime.Now
        ' Cache it so we can get the timestamp in later calls.
        HostingEnvironment.Cache.Add("dataTimeStamp",
 dataTimeStamp, Nothing, _
          Cache.NoAbsoluteExpiration, _
          New TimeSpan(0, 20, 0), _
          CacheItemPriority.Default, Nothing)
      End If
      Return ds
    End Function

    Private Function IsPathVirtual(ByVal
 virtualPath As String) As
 Boolean
      Dim checkPath As String
      checkPath = VirtualPathUtility.ToAppRelative(virtualPath)
      Return checkPath.StartsWith("~/vrdir",
 StringComparison.InvariantCultureIgnoreCase)
    End Function

    Public Overrides Function
 FileExists(ByVal virtualPath As String)
 As Boolean
      If (IsPathVirtual(virtualPath)) Then
        Dim file As SampleVirtualFile
        file = CType(GetFile(virtualPath), SampleVirtualFile)
        Return file.Exists
      Else
        Return Previous.FileExists(virtualPath)
      End If
    End Function

    Public Overrides Function
 DirectoryExists(ByVal virtualDir As String)
 As Boolean
      If (IsPathVirtual(virtualDir)) Then
        Dim dir As SampleVirtualDirectory
        dir = CType(GetDirectory(virtualDir), SampleVirtualDirectory)
        Return dir.exists
      Else
        Return Previous.DirectoryExists(virtualDir)
      End If
    End Function

    Public Overrides Function
 GetFile(ByVal virtualPath As String)
 As VirtualFile
      If (IsPathVirtual(virtualPath)) Then
        Return New SampleVirtualFile(virtualPath,
 Me)
      Else
        Return Previous.GetFile(virtualPath)
      End If
    End Function

    Public Overrides Function
 GetDirectory(ByVal virtualDir As String)
 As VirtualDirectory
      If (IsPathVirtual(virtualDir)) Then
        Return New SampleVirtualDirectory(virtualDir,
 Me)
      Else
        Return Previous.GetDirectory(virtualDir)
      End If
    End Function

    Public Overrides Function
 GetCacheDependency(ByVal virtualPath As String,
 ByVal virtualPathDependencies As IEnumerable, ByVal utcStart As Date)
 As CacheDependency
      If (IsPathVirtual(virtualPath)) Then

        Dim fullPathDependencies As System.Collections.Specialized.StringCollection
        fullPathDependencies = Nothing

        ' Get the full path to all dependencies.
        For Each virtualDependency As
 String In virtualPathDependencies
          If fullPathDependencies Is Nothing
 Then
            fullPathDependencies = New System.Collections.Specialized.StringCollection
          End If

          fullPathDependencies.Add(virtualDependency)
        Next

        If fullPathDependencies Is Nothing
 Then
          Return Nothing
        End If

        Dim fullPathDependenciesArray As String()
        fullPathDependencies.CopyTo(fullPathDependenciesArray, 0)

        Return New CacheDependency(fullPathDependenciesArray,
 utcStart)
      Else
        Return Previous.GetCacheDependency(virtualPath, virtualPathDependencies,
 utcStart)
      End If
    End Function
  End Class
End Namespace
using System;
using System.Data;
using System.Security.Permissions;
using System.Web;
using System.Web.Caching;
using System.Web.Hosting;

namespace Samples.AspNet.CS
{
  [AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Medium)]
  [AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.High)]
  public class SamplePathProvider : VirtualPathProvider
  {
    private string dataFile;

    public SamplePathProvider()
      : base()
    {
    }

    protected override void Initialize()
    {
      // Set the datafile path relative to the application's path.
      dataFile = HostingEnvironment.ApplicationPhysicalPath + "App_Data\\XMLData.xml";
    }

    /// <summary>
    ///   Data set provider for the SampleVirtualDirectory and
    ///   SampleVirtualFile classes. In a production application
    ///   this method would be on a provider class that accesses
    ///   the virtual resource data source.
    /// </summary>
    /// <returns>
    ///   The System.Data.DataSet containing the virtual resources 
    ///   provided by the SamplePathProvider.
    /// </returns>
    public DataSet GetVirtualData()
    {
      // Get the data from the cache.
      DataSet ds = (DataSet)HostingEnvironment.Cache.Get("VPPData");
      if (ds == null)
      {
        // Data not in cache. Read XML file.
        ds = new DataSet();
        ds.ReadXml(dataFile);

        // Make DataSet dependent on XML file.
        CacheDependency cd = new CacheDependency(dataFile);

        // Put DataSet into cache for maximum of 20 minutes.
        HostingEnvironment.Cache.Add("VPPData", ds, cd,
          Cache.NoAbsoluteExpiration,
          new TimeSpan(0, 20, 0),
          CacheItemPriority.Default, null);

        // Set data timestamp.
        DateTime dataTimeStamp = DateTime.Now;
        // Cache it so we can get the timestamp in later calls.
        HostingEnvironment.Cache.Insert("dataTimeStamp", dataTimeStamp,
 null,
          Cache.NoAbsoluteExpiration,
          new TimeSpan(0, 20, 0),
          CacheItemPriority.Default, null);
      }
      return ds;
    }

    /// <summary>
    ///   Determines whether a specified virtual path is within
    ///   the virtual file system.
    /// </summary>
    /// <param name="virtualPath">An absolute virtual
 path.</param>
    /// <returns>
    ///   true if the virtual path is within the 
    ///   virtual file sytem; otherwise, false.
    /// </returns>
    private bool IsPathVirtual(string
 virtualPath)
    {
      String checkPath = VirtualPathUtility.ToAppRelative(virtualPath);
      return checkPath.StartsWith("~/vrdir", StringComparison.InvariantCultureIgnoreCase);
    }

    public override bool FileExists(string
 virtualPath)
    {
      if (IsPathVirtual(virtualPath))
      {
        SampleVirtualFile file = (SampleVirtualFile)GetFile(virtualPath);
        return file.Exists;
      }
      else
        return Previous.FileExists(virtualPath);
    }

    public override bool DirectoryExists(string
 virtualDir)
    {
      if (IsPathVirtual(virtualDir))
      {
        SampleVirtualDirectory dir = (SampleVirtualDirectory)GetDirectory(virtualDir);
        return dir.Exists;
      }
      else
        return Previous.DirectoryExists(virtualDir);
    }

    public override VirtualFile GetFile(string
 virtualPath)
    {
      if (IsPathVirtual(virtualPath))
        return new SampleVirtualFile(virtualPath,
 this);
      else
        return Previous.GetFile(virtualPath);
    }

    public override VirtualDirectory GetDirectory(string
 virtualDir)
    {
      if (IsPathVirtual(virtualDir))
        return new SampleVirtualDirectory(virtualDir,
 this);
      else
        return Previous.GetDirectory(virtualDir);
    }

    public override CacheDependency GetCacheDependency(
      string virtualPath, 
      System.Collections.IEnumerable virtualPathDependencies, 
      DateTime utcStart)
    {
      if (IsPathVirtual(virtualPath))
      {
        System.Collections.Specialized.StringCollection fullPathDependencies = null;

        // Get the full path to all dependencies.
        foreach (string virtualDependency in
 virtualPathDependencies)
        {
          if (fullPathDependencies == null)
            fullPathDependencies = new System.Collections.Specialized.StringCollection();

          fullPathDependencies.Add(virtualDependency);
        }
        if (fullPathDependencies == null)
          return null;

        // Copy the list of full-path dependencies into an array.
        string[] fullPathDependenciesArray = new
 string[fullPathDependencies.Count];
        fullPathDependencies.CopyTo(fullPathDependenciesArray, 0);
        // Copy the virtual path into an array.
        string[] virtualPathArray = new string[1];
        virtualPathArray[0] = virtualPath;

        return new CacheDependency(virtualPathArray,
 fullPathDependenciesArray, utcStart);
      }
      else
        return Previous.GetCacheDependency(virtualPath, virtualPathDependencies,
 utcStart);
    }
  }
  

2 番目の例は、VirtualPathProvider カスタム オブジェクトによって返されDataSet オブジェクト設定するために使用される XML データ ファイル示してます。この XML データVirtualPathProviderVirtualDirectory、および VirtualFile の各オブジェクト使用して外部データからデータ取得する例を示すものであり、本番品質データ ストア表しているものではありません。

<?xml version="1.0" encoding="utf-8" ?>
  <resource type="dir" 
    path="/vrDir" 
    parentPath="" 
    content="">
    <resource type="file" 
      path="/vrDir/Level1FileA.vrf"
      parentPath="/vrDir" 
      content="This is the content of file Level1FileA.">
    </resource>
    <resource type="file" 
      path="/vrDir/Level1FileB.vrf"
      parentPath="/vrDir" 
      content="This is the content of file Level1FileB.">
    </resource>
    <resource type="dir" 
      path="/vrDir/Level2DirA" 
      parentPath="/vrDir" 
      content="">
    <resource type="file" 
      path="/vrDir/Level2DirA/Level2FileA.vrf" 
      parentPath="/vrDir/Level2DirA" 
      content="This is the content of file Level2FileA.">
    </resource>
    <resource type="file" 
      path="/vrDir/Level2DirA/Level2FileB.vrf"
      parentPath="/vrDir/Level2DirA" 
      content="This is the content of file Level2FileB.">
    </resource>
  </resource>
  <resource type="dir" 
    path="/vrDir/Level2DirB" 
    parentPath="/vrDir" 
    content="">
    <resource type="file" 
      path="/vrDir/Level2DirB/Level2FileA.vrf" 
      parentPath="/vrDir/Level2DirB" 
      content="This is the content of file Level2FileA.">
    </resource>
    <resource type="file" 
      path="/vrDir/Level2DirB/Level2FileB.vrf"
      parentPath="/vrDir/Level2DirB" 
      content="This is the content of file Level2FileB.">
    </resource>
  </resource>
</resource>

3 番目の例では、AppInitialize メソッド格納されている AppStart オブジェクト示します。このメソッドは、ASP.NET アプリケーション初期化時に呼び出され必要なカスタム初期化処理実行します。この例では、VirtualPathProvider カスタム オブジェクトASP.NET ビルド システム登録します

Imports Microsoft.VisualBasic

Imports System.Web.Hosting

Namespace Samples.AspNet.VB

  Public Class AppStart

    Public Shared Sub AppInitialize()
      Dim sampleProvider As SamplePathProvider
 = New SamplePathProvider()
      HostingEnvironment.RegisterVirtualPathProvider(sampleProvider)
    End Sub

  End Class
End Namespace
using System.Web.Hosting;

namespace Samples.AspNet.CS
{
  /// <summary>
  ///   Contains the application initialization method
  ///   for the sample application.
  /// </summary>
  public static class AppStart
  {
    public static void AppInitialize()
    {
      SamplePathProvider sampleProvider = new SamplePathProvider();
      HostingEnvironment.RegisterVirtualPathProvider(sampleProvider);
    } 
  }
}

最後の例では、仮想ファイル システム格納されている仮想ファイルへのリンクを含む ASP.NET ページ示します

<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML
 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html  >
<head runat="server">
  <meta http-equiv="Content-Type" content="text/html;
 charset=utf-8" />
  <title>Virtual Path Provider Example</title>
</head>
<body>
  <form id="form1" runat="server">
    <asp:HyperLink ID="hyperLink1" runat="server"
 NavigateUrl="vrDir/Level1FileA.vrf" Text="Level
 1, File A" /><br />
    <asp:HyperLink ID="hyperLink2" runat="server"
 NavigateUrl="vrDir/Level1FileB.vrf" Text="Level
 1, File B" /><br />
    <asp:HyperLink ID="hyperLink3" runat="server"
 NavigateUrl="vrDir/Level2DirA/Level2FileA.vrf" Text="Level
 2a, File A" /><br />
    <asp:HyperLink ID="hyperLink4" runat="server"
 NavigateUrl="vrDir/Level2DirA/Level2FileB.vrf" Text="Level
 2a, File B" /><br />
    <asp:HyperLink ID="hyperLink5" runat="server"
 NavigateUrl="vrDir/Level2DirB/Level2FileA.vrf" Text="Level
 2b, File A" /><br />
    <asp:HyperLink ID="hyperLink6" runat="server"
 NavigateUrl="vrDir/Level2DirB/Level2FileB.vrf" Text="Level
 2b, File B" /><br />
  </form>
</body>
</html>
<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

</script>

<html >
<head runat="server">
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"
 />
  <title>Virtual Path Provider Example</title>
</head>
<body>
  <form id="form1" runat="server">
    <asp:HyperLink ID="hyperLink1" runat="server" NavigateUrl="vrDir/Level1FileA.vrf"
 Text="Level 1, File A" /><br />
    <asp:HyperLink ID="hyperLink2" runat="server" NavigateUrl="vrDir/Level1FileB.vrf"
 Text="Level 1, File B" /><br />
    <asp:HyperLink ID="hyperLink3" runat="server" NavigateUrl="vrDir/Level2DirA/Level2FileA.vrf"
 Text="Level 2a, File A" /><br />
    <asp:HyperLink ID="hyperLink4" runat="server" NavigateUrl="vrDir/Level2DirA/Level2FileB.vrf"
 Text="Level 2a, File B" /><br />
    <asp:HyperLink ID="hyperLink5" runat="server" NavigateUrl="vrDir/Level2DirB/Level2FileA.vrf"
 Text="Level 2b, File A" /><br />
    <asp:HyperLink ID="hyperLink6" runat="server" NavigateUrl="vrDir/Level2DirB/Level2FileB.vrf"
 Text="Level 2b, File B" /><br />
  </form>
</body>
</html>
.NET Framework のセキュリティ.NET Frameworkセキュリティ
継承階層継承階層
System.Object
   System.MarshalByRefObject
    System.Web.Hosting.VirtualPathProvider
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
VirtualPathProvider メンバ
System.Web.Hosting 名前空間

VirtualPathProvider コンストラクタ

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

継承クラス インスタンスによって使用されるクラス初期化します。このコンストラクタは、継承クラスによってのみ呼び出すことができます

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

Dim instance As New VirtualPathProvider
protected VirtualPathProvider ()
protected:
VirtualPathProvider ()
protected VirtualPathProvider ()
protected function VirtualPathProvider ()
解説解説
使用例使用例

VirtualPathProvider カスタム クラス初期化する VirtualPathProvider コンストラクタ実装例次のコード例示します例の実行必要なコード全体については、VirtualPathProvider クラス概要トピックで「例」を参照してください

public SamplePathProvider()
  : base()
{
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
VirtualPathProvider クラス
VirtualPathProvider メンバ
System.Web.Hosting 名前空間

VirtualPathProvider プロパティ


プロテクト プロパティプロテクト プロパティ

参照参照

関連項目

VirtualPathProvider クラス
System.Web.Hosting 名前空間

VirtualPathProvider メソッド


パブリック メソッドパブリック メソッド

( プロテクト メソッド参照)
  名前 説明
パブリック メソッド CombineVirtualPaths ベース パス相対パス結合して仮想リソースへの絶対パス返します
パブリック メソッド CreateObjRef  リモート オブジェクトとの通信使用するプロキシ生成必要な情報をすべて格納しているオブジェクト作成します。 ( MarshalByRefObject から継承されます。)
パブリック メソッド DirectoryExists 仮想ファイル システムディレクトリ存在するかどうかを示す値を取得します
パブリック メソッド Equals  オーバーロードされます2 つObject インスタンス等しかどうか判断します。 ( Object から継承されます。)
パブリック メソッド FileExists 仮想ファイル システムファイル存在するかどうかを示す値を取得します
パブリック メソッド GetCacheDependency 指定した仮想パス基づいてキャッシュ依存関係作成します
パブリック メソッド GetCacheKey 指定した仮想パス使用されるキャッシュ キー返します
パブリック メソッド GetDirectory 仮想ファイル システムから仮想ディレクトリ取得します
パブリック メソッド GetFile 仮想ファイル システムから仮想ファイル取得します
パブリック メソッド GetFileHash 指定した仮想パスハッシュ返します
パブリック メソッド GetHashCode  特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用適してます。 ( Object から継承されます。)
パブリック メソッド GetLifetimeService  対象インスタンス有効期間ポリシー制御する現在の有効期間サービス オブジェクト取得します。 ( MarshalByRefObject から継承されます。)
パブリック メソッド GetType  現在のインスタンスType取得します。 ( Object から継承されます。)
パブリック メソッド InitializeLifetimeService オーバーライドされますリース作成されないようにすることで、VirtualPathProvider オブジェクト無期限有効期間指定します
パブリック メソッド OpenFile 仮想ファイルかストリーム返します
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 ( Object から継承されます。)
パブリック メソッド ToString  現在の Object を表す String返します。 ( Object から継承されます。)
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

VirtualPathProvider クラス
System.Web.Hosting 名前空間

VirtualPathProvider メンバ

Web アプリケーションによって仮想ファイル システムリソース取得できるようにする一連のメソッド用意されています。

VirtualPathProvider データ型公開されるメンバを以下の表に示します


プロテクト コンストラクタプロテクト コンストラクタ
  名前 説明
プロテクト メソッド VirtualPathProvider 継承クラス インスタンスによって使用されるクラス初期化します。このコンストラクタは、継承クラスによってのみ呼び出すことができます
プロテクト プロパティプロテクト プロパティ
パブリック メソッドパブリック メソッド
( プロテクト メソッド参照)
  名前 説明
パブリック メソッド CombineVirtualPaths ベース パス相対パス結合して仮想リソースへの絶対パス返します
パブリック メソッド CreateObjRef  リモート オブジェクトとの通信使用するプロキシ生成必要な情報をすべて格納しているオブジェクト作成します。 (MarshalByRefObject から継承されます。)
パブリック メソッド DirectoryExists 仮想ファイル システムディレクトリ存在するかどうかを示す値を取得します
パブリック メソッド Equals  オーバーロードされます2 つObject インスタンス等しかどうか判断します。 (Object から継承されます。)
パブリック メソッド FileExists 仮想ファイル システムファイル存在するかどうかを示す値を取得します
パブリック メソッド GetCacheDependency 指定した仮想パス基づいてキャッシュ依存関係作成します
パブリック メソッド GetCacheKey 指定した仮想パス使用されるキャッシュ キー返します
パブリック メソッド GetDirectory 仮想ファイル システムから仮想ディレクトリ取得します
パブリック メソッド GetFile 仮想ファイル システムから仮想ファイル取得します
パブリック メソッド GetFileHash 指定した仮想パスハッシュ返します
パブリック メソッド GetHashCode  特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用適してます。 (Object から継承されます。)
パブリック メソッド GetLifetimeService  対象インスタンス有効期間ポリシー制御する現在の有効期間サービス オブジェクト取得します。 (MarshalByRefObject から継承されます。)
パブリック メソッド GetType  現在のインスタンスType取得します。 (Object から継承されます。)
パブリック メソッド InitializeLifetimeService オーバーライドされますリース作成されないようにすることで、VirtualPathProvider オブジェクト無期限有効期間指定します
パブリック メソッド OpenFile 仮想ファイルかストリーム返します
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 (Object から継承されます。)
パブリック メソッド ToString  現在の Object を表す String返します。 (Object から継承されます。)
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

VirtualPathProvider クラス
System.Web.Hosting 名前空間



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

辞書ショートカット

すべての辞書の索引

「VirtualPathProvider」の関連用語

VirtualPathProviderのお隣キーワード
検索ランキング

   

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



VirtualPathProviderのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS