Control.MapPathSecure メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > Control.MapPathSecure メソッドの意味・解説 

Control.MapPathSecure メソッド

仮想パス (絶対パスまたは相対パス) の割り当て先の物理パス取得します

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

Protected Friend Function
 MapPathSecure ( _
    virtualPath As String _
) As String
Dim virtualPath As String
Dim returnValue As String

returnValue = Me.MapPathSecure(virtualPath)
protected internal string MapPathSecure (
    string virtualPath
)
protected public:
String^ MapPathSecure (
    String^ virtualPath
)
protected String MapPathSecure (
    String virtualPath
)
protected internal function
 MapPathSecure (
    virtualPath : String
) : String

パラメータ

virtualPath

相対 URL、またはルートに対して相対的な URL

戻り値
要求されファイルへの物理パス

例外例外
解説解説
使用例使用例

Page オブジェクトまたは UserControl オブジェクト格納されている仮想ディレクトリ物理パスを、MapPathSecure メソッド使用して取得する例を次に示します

' An HttpException occurs if the server control does not,;
' have permissions to read the resulting mapped file.
output.Write("The Actual Path of the virtual directory : "
 & _
            MapPathSecure(TemplateSourceDirectory) & "<br>")

' Get all the files from the absolute path of 'MyControl';
' using TemplateSourceDirectory which gives the virtual Directory.
Dim myFiles As String()
 = Directory.GetFiles(MapPathSecure(TemplateSourceDirectory))
output.Write("The files in this Directory are <br>")

' List all the files.
Dim i As Integer
For i = 0 To myFiles.Length - 1
   output.Write(myFiles(i) & "<br>")
Next i
// An HttpException occurs if the server control does not,;
// have permissions to read the resulting mapped file. 
     output.Write("The Actual Path of the virtual directory : "+
     MapPathSecure(TemplateSourceDirectory)+"<br>");

    // Get all the files from the absolute path of 'MyControl';
    // using TemplateSourceDirectory which gives the virtual Directory.
        string [] myFiles=
        Directory.GetFiles(MapPathSecure(TemplateSourceDirectory));
        output.Write("The files in this
 Directory are <br>");

         // List all the files.
         for (int i=0;i<myFiles.Length;i++)
            output.Write(myFiles[i]+"<br>");
// An HttpException occurs if the server control does not,;
// have permissions to read the resulting mapped file. 
output.Write("The Actual Path of the virtual directory : " 
    + MapPathSecure(get_TemplateSourceDirectory()) + "<br>");

// Get all the files from the absolute path of 'MyControl';
// using TemplateSourceDirectory which gives the virtual Directory.
String myFiles[] = Directory.GetFiles(MapPathSecure(
    get_TemplateSourceDirectory()));
output.Write("The files in this Directory
 are <br>");

// List all the files.
for (int i = 0; i < myFiles.length; i++)
 {
    output.Write(myFiles.get_Item(i) + "<br>");
}  
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

「Control.MapPathSecure メソッド」の関連用語

Control.MapPathSecure メソッドのお隣キーワード
検索ランキング

   

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



Control.MapPathSecure メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS