C#如何更改IIS用户权限 设置IIS权限好像不行,不过写入是可以的呀,写入数据库,或者写入服务器硬盘都是可以的,只要在页面上加入验证就没有问题! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 DirectoryEntry tbEntry = WebRoot.Children.Add(virtualDirName, strSchema); //必须以'\'结尾 if(virtualDirPath.EndsWith("\\") == false) { virtualDirPath += "\\"; } //设置物理目录 tbEntry.Properties["Path"][0] = virtualDirPath; //是否创建为应用程序 tbEntry.Invoke("AppCreate",true); //允许读取 tbEntry.Properties["AccessRead"][0] = true; //允许写入 tbEntry.Properties["AccessWrite"][0] = false; //脚本资源访问 tbEntry.Properties["AccessExecute"][0] = false; //允许匿名访问 tbEntry.Properties["AuthAnonymous"][0] = true; //允许基本验证 tbEntry.Properties["AuthBasic"][0] = true; //允许WIndows集成验证 tbEntry.Properties["AuthNTLM"][0] = true; //索引此资源 tbEntry.Properties["ContentIndexed"][0] = false; //目录浏览 tbEntry.Properties["EnableDirBrowsing"][0] = false; //脚本可执行 tbEntry.Properties["AccessScript"][0] = true; //设置默认文档 tbEntry.Properties["DefaultDoc"][0] = "Default.htm, Default.asp, Default.aspx, index.asp, index.htm.index.html"; tbEntry.Properties["EnableDefaultDoc"][0] = true; //允许父路径 tbEntry.Properties["AspEnableParentPaths"][0] = true; tbEntry.Properties["AppFriendlyName"][0] = virtualDirName; //应用程序保护 tbEntry.Properties["AppIsolated"][0] = 2; //日志访问 tbEntry.Properties["DontLog"][0] = true; tbEntry.CommitChanges(); 孟子又出现了 呵呵不过应该是window程序,否则权限不购,asp.net只能模拟权限了 更改IIS用户权限?默认帐号是ASPNET,只听说过更改帐号的,改权限倒是头次看到 C#垃圾回收机制内存的释放 winfrom 的dategridview 数据绑定问题 菜鸟求助! wpf中page页面的使用 C#多线程Socket的网络通信(C/S) DataTable的拆分取值问题 如何将Arraylist转换成int数组? 一个捆扰我一下午的问题,是关于获取系统信息的问题. c# 如何读取dbf自由表? 统计玩家拥有城池的时间 gridview中commandfield的更新按钮中代码怎么写才能实现数据更新呢(RowUpdating,RowDeleting) gridview选择行,删除出错的问题
if(virtualDirPath.EndsWith("\\") == false)
{
virtualDirPath += "\\";
}
//设置物理目录
tbEntry.Properties["Path"][0] = virtualDirPath;
//是否创建为应用程序
tbEntry.Invoke("AppCreate",true);
//允许读取
tbEntry.Properties["AccessRead"][0] = true;
//允许写入
tbEntry.Properties["AccessWrite"][0] = false;
//脚本资源访问
tbEntry.Properties["AccessExecute"][0] = false;
//允许匿名访问
tbEntry.Properties["AuthAnonymous"][0] = true;
//允许基本验证
tbEntry.Properties["AuthBasic"][0] = true;
//允许WIndows集成验证
tbEntry.Properties["AuthNTLM"][0] = true;
//索引此资源
tbEntry.Properties["ContentIndexed"][0] = false;
//目录浏览
tbEntry.Properties["EnableDirBrowsing"][0] = false;
//脚本可执行
tbEntry.Properties["AccessScript"][0] = true;
//设置默认文档
tbEntry.Properties["DefaultDoc"][0] = "Default.htm, Default.asp, Default.aspx, index.asp, index.htm.index.html";
tbEntry.Properties["EnableDefaultDoc"][0] = true;
//允许父路径
tbEntry.Properties["AspEnableParentPaths"][0] = true; tbEntry.Properties["AppFriendlyName"][0] = virtualDirName;
//应用程序保护
tbEntry.Properties["AppIsolated"][0] = 2;
//日志访问
tbEntry.Properties["DontLog"][0] = true;
tbEntry.CommitChanges();
默认帐号是ASPNET,只听说过更改帐号的,改权限倒是头次看到