设置IIS权限好像不行,不过写入是可以的呀,写入数据库,或者写入服务器硬盘都是可以的,只要在页面上加入验证就没有问题!

解决方案 »

  1.   

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

  2.   

    孟子又出现了 呵呵不过应该是window程序,否则权限不购,asp.net只能模拟权限了
      

  3.   

    更改IIS用户权限?
    默认帐号是ASPNET,只听说过更改帐号的,改权限倒是头次看到