中文字幕日韩一区二区_国产一区二区av_国产毛片av_久久久久国产一区_色婷婷电影_国产一区二区精品

Asp.net給站點某目錄增加Aspnet用戶

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using System.IO;
using System.NET;
using System.Security.AccessControl;
using System.Security.Principal;

public partial class ACLChange : System.Web.UI.Page
{
    //文件夾路徑
    private string strDir = "images";

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            AddDirectorySecurity();
        }
    }

    /// <summary>
    /// 給文件夾添加ASPNET用戶
    /// </summary>
    private void AddDirectorySecurity()
    {
        DirectoryInfo dirinfo = new DirectoryInfo(Server.MapPath(strDir));

        if ((dirinfo.Attributes & FileAttributes.ReadOnly) != 0)
        {
            dirinfo.Attributes = FileAttributes.Normal;
        }

        //取得訪問控制列表
        DirectorySecurity dirsecurity = dirinfo.GetAccessControl();

        string strDomain = Dns.GetHostName();

        dirsecurity.AddAccessRule(new FileSystemAccessRule(strDomain + "http://ASPNET", FileSystemRights.FullControl, AccessControlType.Allow));

        dirinfo.SetAccessControl(dirsecurity);
    }
}

AspNet技術Asp.net給站點某目錄增加Aspnet用戶,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 伊人久久精品一区二区三区 | 欧美一区二区大片 | 一区二区三区成人 | 日韩精品免费 | 国产精品区二区三区日本 | 一区二区精品在线 | 蜜桃综合在线 | 久久久123| 五月婷婷导航 | 久久人| 亚洲视频在线观看 | 久久精品aaa | 久久中文字幕av | 免费观看一级特黄欧美大片 | 国产一级毛片视频 | 久久成人免费观看 | 在线国产一区 | 日韩成人在线电影 | 一级黄色录像片子 | 国产一区二区三区在线 | 午夜视频在线观看网址 | 国产精品无码专区在线观看 | 久久久美女 | 亚洲欧洲精品在线 | 中文字幕不卡一区 | 国产精品jizz在线观看老狼 | 在线观看免费av网 | 成人免费黄色 | 亚洲精品二区 | 久久天堂网 | 国产观看 | 国产专区在线 | 天天操天天射天天舔 | 精品一区二区在线看 | 黄色免费网站在线看 | 国产免费观看视频 | 欧美精品久久久久 | 欧美aaa| 久久国| 2018中文字幕第一页 | 国产精品视频一区二区三区四蜜臂 |