All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
ASP.NET中连接MYSQL_[Asp.Net教程]
[delphi语法6]delphi中Repeat语句的使用实例
php中的安全模式是指的什么?_php资料_编程技术
DataGrid单击一行服务器事件_[Asp.Net教程]
ASP.NET,2.0,Web窗体语法指导_[Asp.Net教程]
建立灵巧结构的PHP程序_php资料_编程技术
动态网页技术PHP程序中包含文件问题_php资料_编程技术
delphi结构化异常处理
C#中continue语句的使用方法
PHP中使用crypt()实现用户身份验证_php资料_编程技术
Reading number is top 10 pictures
中国处女图鉴1
Cesarean section, bloody, silently into it!2
西班牙山村小景2
青春清纯美女大集合3
Chinese paper-cut grilles art appreciation2
9.3阅兵全景图4-陸海空现代化兵种方阵梯队
Look at the Spring Festival people crowded into the what kind
The real super beauty6
Flow chart of breast implants
The dog buy the ham oneself
Download software ranking
网络管理员第三版
天龙八部最新服务端
Kung fu panda - the secret of the teacher
Ashlynn Video4
终极变速大师Speeder3.26
C#程序员参考手册
变速齿轮3.26
Adobe Flash Player(IE) 10.0.32.18 浏览器专用的FLASH插件
株洲本地在线棋牌游戏
传奇私服架设教程
delv published in(发表于) 2014/1/6 9:04:54 Edit(编辑)
Asp.net给站点某目录增加Aspnet用户_[Asp.Net教程]

Asp.net给站点某目录增加Aspnet用户_[Asp.Net教程]

Asp.net给站点某目录增加Aspnet用户_[Asp.Net教程]

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();
}
}


///


/// 给文件夹添加ASPNET用户
///

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 + "\\ASPNET", FileSystemRights.FullControl, AccessControlType.Allow));


dirinfo.SetAccessControl(dirsecurity);
}
}


来源:网络







添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.