using System; using System.IO; public partial class ACLChange : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) /// <summary> if ((dirinfo.Attributes & FileAttributes.ReadOnly) != 0) //取得访问控制列表 string strDomain = Dns.GetHostName(); dirsecurity.AddAccessRule(new FileSystemAccessRule(strDomain + “\\ASPNET“, FileSystemRights.FullControl, AccessControlType.Allow)); dirinfo.SetAccessControl(dirsecurity);
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.Net;
using System.Security.AccessControl;
using System.Security.Principal;
{
//文件夹路径
private string strDir = “images”;
{
if (!IsPostBack)
{
AddDirectorySecurity();
}
}
/// 给文件夹添加ASPNET用户
/// </summary>
private void AddDirectorySecurity()
{
DirectoryInfo dirinfo = new DirectoryInfo(Server.MapPath(strDir));
{
dirinfo.Attributes = FileAttributes.Normal;
}
DirectorySecurity dirsecurity = dirinfo.GetAccessControl();
}
}
asp.net给站点某目录增加aspnet用户_asp.net技巧
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » asp.net给站点某目录增加aspnet用户_asp.net技巧
相关推荐
- 暂无文章
