次の方法で共有


VirtualDirectory.LogonMethod プロパティ

定義

構成された物理的な場所にアクセスするために仮想ディレクトリが使用する認証方法を取得または設定します。

public:
 property Microsoft::Web::Administration::AuthenticationLogonMethod LogonMethod { Microsoft::Web::Administration::AuthenticationLogonMethod get(); void set(Microsoft::Web::Administration::AuthenticationLogonMethod value); };
public Microsoft.Web.Administration.AuthenticationLogonMethod LogonMethod { get; set; }
member this.LogonMethod : Microsoft.Web.Administration.AuthenticationLogonMethod with get, set
Public Property LogonMethod As AuthenticationLogonMethod

プロパティ値

現在の AuthenticationLogonMethod 仮想ディレクトリの値の 1 つ。 既定では、 ClearTextです。

次の例では、仮想ディレクトリの プロパティを LogonMethod 設定する方法を示します。


using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Web.Administration;
using Microsoft.Web.Management;

namespace AdministrationSnippets
{
    public class AdministrationAuthenticationLogonMethod
    {
        // Creates a new virtual directory and sets the logon method.
        public void SetLogonMethod()
        {
            ServerManager manager = new ServerManager();
            Site defaultSite = manager.Sites["Default Web Site"];
            Application reports = defaultSite.Applications.Add(
                "/reports", @"\\FileServer\Reports");

            // Configure the default virtual directory for the application.
            VirtualDirectory reportDir = reports.VirtualDirectories[0];
            reportDir.LogonMethod = AuthenticationLogonMethod.Batch;
            reportDir.UserName = @"HumanResources\Jane";
            reportDir.Password = @"iL@1Fnw!";

            manager.CommitChanges();
        }
    }
}

適用対象