VirtualDirectory.Path プロパティ
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
親を基準とした仮想ディレクトリの仮想パスを取得または設定します。
public:
property System::String ^ Path { System::String ^ get(); void set(System::String ^ value); };
public string Path { get; set; }
member this.Path : string with get, set
Public Property Path As String
プロパティ値
仮想ディレクトリの相対仮想パス。
例
次の例では、仮想ディレクトリの プロパティを Path 設定する方法を示します。
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Web.Administration;
using Microsoft.Web.Management;
using Microsoft.Web.Management.Client;
namespace AdministrationSnippets
{
public class AdministrationVirtualDirectory
{
// Creates a new virtual directory, retrieves the configuration,
// then changes the Path and PhysicalPath
public void SetPathAndPhysicalPath()
{
// Create a new application and update the configuration system
ServerManager manager = new ServerManager();
Site defaultSite = manager.Sites["Default Web Site"];
Application reports =
defaultSite.Applications.Add("/reports", @"C:\inetpub\reports");
manager.CommitChanges();
// Read the data back from the updated configuration system,
// then modify the Path and Physical Path.
reports = manager.Sites["Default Web Site"].Applications["/reports"];
VirtualDirectory reportDir = reports.VirtualDirectories[0];
reportDir.Path = "/private_reports";
reportDir.PhysicalPath = @"C:\inetpub\secure\reports";
manager.CommitChanges();
}
}
}
注釈
このプロパティを設定する場合、パスには クラスの VirtualDirectoryCollection プロパティの文字をInvalidVirtualDirectoryPathCharacters含めてはいけません。 メソッドの パラメーターを使用して、このプロパティの値をpath
Add設定することもできます。
適用対象
フィードバック
https://aka.ms/ContentUserFeedback」を参照してください。
以下は間もなく提供いたします。2024 年を通じて、コンテンツのフィードバック メカニズムとして GitHub の issue を段階的に廃止し、新しいフィードバック システムに置き換えます。 詳細については、「フィードバックの送信と表示