WebContext Oluşturucu
Tanım
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
WebContext sınıfının yeni bir örneğini başlatır.
public:
WebContext(System::Web::Configuration::WebApplicationLevel pathLevel, System::String ^ site, System::String ^ applicationPath, System::String ^ path, System::String ^ locationSubPath, System::String ^ appConfigPath);
public WebContext (System.Web.Configuration.WebApplicationLevel pathLevel, string site, string applicationPath, string path, string locationSubPath, string appConfigPath);
new System.Web.Configuration.WebContext : System.Web.Configuration.WebApplicationLevel * string * string * string * string * string -> System.Web.Configuration.WebContext
Public Sub New (pathLevel As WebApplicationLevel, site As String, applicationPath As String, path As String, locationSubPath As String, appConfigPath As String)
Parametreler
- pathLevel
- WebApplicationLevel
Bir WebApplicationLevel nesnesi.
- site
- String
Web sitesinin adı.
- applicationPath
- String
Geçerli Web uygulamasının kök düzeyinin sanal yolu.
- path
- String
Geçerli yapılandırma nesnesinin temsil ettiği Web.config dosyasının sanal yolu.
- locationSubPath
- String
Şu anda düzenlenmekte location
olan öğenin yol değeri.
- appConfigPath
- String
Geçerli Web uygulamasının yapılandırma yolu.
Örnekler
Aşağıdaki örnekte bu oluşturucunun nasıl kullanılacağı gösterilmektedir. Bu kod örneği, sınıfı için WebContext sağlanan daha büyük bir örneğin parçasıdır.
// Get the context.
WebContext webContext = (WebContext)config.EvaluationContext.HostingContext;
' Get the context.
Dim webContext As WebContext = config.EvaluationContext.HostingContext