日期:2014-05-18  浏览次数:20873 次

c#控制iis 填写默认文档问题请教
DfDoc="sfsfsd.aspx";
rootDir.Properties["DefaultDoc"].Value = DfDoc;
rootDir.CommitChanges();

这样可以写入iis

object[] array = new object[100];
ArrayList arl = new ArrayList();
arl.Add(DfDoc);
array = arl.ToArray();
rootDir.Properties["DefaultDoc"].AddRange(array);
rootDir.CommitChanges();

这样就不能写入了,也就是我想写入多个不可以,现在在测试所以用了DdDoc一个数据,如果一个可以插入,我在试多个

------解决方案--------------------
rootDir.Properties["DefaultDoc"].Value = "index.htm,index.html,list.htm,list.html,default.aspx,default.htm,default.html";

这样就可以设置多个了,我在IIS6上面就这样做的