操作IIS过程中碰到的问题总结

1.在代码中不能引入System.DirectoryServices命名空间--首先需要在解决方案中添加对System.DirectoryServices的引用
2.添加引用后,在后台代码可以引入System.DirectoryServices命名空间,在类中却不行--具体原因不知,不过直接把using System.DirectoryServices;写到类中,反正不会报错
3.获得另外一个虚拟目录的路径:第一种方法,使用DirectoryEntry类,DirectoryEntry dirroot = new DirectoryEntry("IIS://" + lpComputerName + "/W3svc/1/Root/Webtest"),其中Webtest是虚拟目录的名称,dirroot.Properties["path"]
第二种方法,Server.Mappath("/Webtest"),注意,一定要用iis当服务器,如果用2005自带的那个服务器的话,就不能获取
4获取虚拟目录的全部属性
None.gif          foreach  (PropertyValueCollection pvc  in  dirroot.Properties)
ExpandedBlockStart.gifContractedBlock.gif        
dot.gif {
InBlock.gif            Response.Write(pvc.PropertyName 
+ "==");
InBlock.gif            Response.Write(dirroot.Properties[pvc.PropertyName][
0+ "<br/>");
ExpandedBlockEnd.gif        }
5.另外转一片关于操作虚拟目录的文章: 文章见此
6.另转一个关于IIS操作的类,非常好用,忘了从哪弄来的了,作者见谅
None.gif
None.gif
using  System;
None.gif
using  System.Data;
None.gif
using  System.DirectoryServices;
None.gif
using  System.Collections;
None.gif
None.gif
namespace  Softcy.IIS
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif    
/**//// <summary> 
InBlock.gif    
/// IISManager 的摘要说明。 
ExpandedSubBlockEnd.gif    
/// </summary> 

InBlock.gif
InBlock.gif    
public class IISManager
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
InBlock.gif        
//定义需要使用的 
InBlock.gif
        private string _server, _website;
InBlock.gif        
private VirtualDirectories _virdirs;
InBlock.gif        
protected System.DirectoryServices.DirectoryEntry rootfolder;
InBlock.gif        
private bool _batchflag;
InBlock.gif        
public IISManager()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
//默认情况下使用localhost,即访问本地机 
InBlock.gif
            _server = "localhost";
InBlock.gif            _website 
= "1";
InBlock.gif            _batchflag 
= false;
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
public IISManager(string strServer)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            _server 
= strServer;
InBlock.gif            _website 
= "1";
InBlock.gif           _batchflag 
= false;
ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary> 
InBlock.gif
InBlock.gif        
/// 定义公共属性 
InBlock.gif
ExpandedSubBlockEnd.gif        
/// </summary> 

InBlock.gif
InBlock.gif
InBlock.gif
InBlock.gif        
//Server属性定义访问机器的名字,可以是IP与计算名 
InBlock.gif

InBlock.gif        
public string Server
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif            
get dot.gifreturn _server; }
ExpandedSubBlockStart.gifContractedSubBlock.gif            
set dot.gif{ _server = value; }
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
//WebSite属性定义,为一数字,为方便,使用string 
InBlock.gif
InBlock.gif        
//一般来说第一台主机为1,第二台主机为2,依次类推 
InBlock.gif

InBlock.gif        
public string WebSite
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif            
get dot.gifreturn _website; }
ExpandedSubBlockStart.gifContractedSubBlock.gif            
set dot.gif{ _website = value; }
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif
InBlock.gif
InBlock.gif        
//虚拟目录的名字 
InBlock.gif

InBlock.gif        
public VirtualDirectories VirDirs
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif            
get dot.gifreturn _virdirs; }
ExpandedSubBlockStart.gifContractedSubBlock.gif            
set dot.gif{ _virdirs = value; }
ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**////<summary> 
InBlock.gif
InBlock.gif        
///定义公共方法 
InBlock.gif
ExpandedSubBlockEnd.gif        
///</summary> 

InBlock.gif
InBlock.gif
InBlock.gif
InBlock.gif        
//连接服务器 
InBlock.gif

InBlock.gif        
public void Connect()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif           ConnectToServer();
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
//为方便重载 
InBlock.gif

InBlock.gif        
public void Connect(string strServer)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            _server 
= strServer;
InBlock.gif            ConnectToServer();
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
//为方便重载 
InBlock.gif
        public void Connect(string strServer, string strWebSite)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            _server 
= strServer;
InBlock.gif            _website 
= strWebSite;
InBlock.gif            ConnectToServer();
ExpandedSubBlockEnd.gif        }

InBlock.gif        
//判断是否存这个虚拟目录 
InBlock.gif
        public bool Exists(string strVirdir)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
return _virdirs.Contains(strVirdir);
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
//添加一个虚拟目录 
InBlock.gif
        public void Create(VirtualDirectory newdir)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
string strPath = "IIS://" + _server + "/W3SVC/" + _website + "/ROOT/" + newdir.Name;
InBlock.gif            
if (!_virdirs.Contains(newdir.Name) || _batchflag)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
try
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    
//加入到ROOT的Children集合中去 
InBlock.gif
                    DirectoryEntry newVirDir = rootfolder.Children.Add(newdir.Name, "IIsWebVirtualDir");
InBlock.gif                    newVirDir.Invoke(
"AppCreate"true);
InBlock.gif                    newVirDir.CommitChanges();
InBlock.gif                    rootfolder.CommitChanges();
InBlock.gif                    
//然后更新数据 
InBlock.gif
                    UpdateDirInfo(newVirDir, newdir);
ExpandedSubBlockEnd.gif                }

InBlock.gif                
catch (Exception ee)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    
throw new Exception(ee.ToString());
ExpandedSubBlockEnd.gif                }

ExpandedSubBlockEnd.gif            }

InBlock.gif            
else
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
throw new Exception("This virtual directory is already exist.");
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

InBlock.gif        
//得到一个虚拟目录 
InBlock.gif
        public VirtualDirectory GetVirDir(string strVirdir)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            VirtualDirectory tmp 
= null;
InBlock.gif            
if (_virdirs.Contains(strVirdir))
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                tmp 
= _virdirs.Find(strVirdir);
InBlock.gif                ((VirtualDirectory)_virdirs[strVirdir]).flag 
= 2;
ExpandedSubBlockEnd.gif            }

InBlock.gif            
else
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
throw new Exception("This virtual directory is not exists");
ExpandedSubBlockEnd.gif            }

InBlock.gif            
return tmp;
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif
InBlock.gif
InBlock.gif        
//更新一个虚拟目录 
InBlock.gif

InBlock.gif        
public void Update(VirtualDirectory dir)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
//判断需要更改的虚拟目录是否存在 
InBlock.gif
            if (_virdirs.Contains(dir.Name))
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                DirectoryEntry ode 
= rootfolder.Children.Find(dir.Name, "IIsWebVirtualDir");
InBlock.gif                UpdateDirInfo(ode, dir);
ExpandedSubBlockEnd.gif            }

InBlock.gif            
else
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
throw new Exception("This virtual directory is not exists.");
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
//删除一个虚拟目录 
InBlock.gif

InBlock.gif        
public void Delete(string strVirdir)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
if (_virdirs.Contains(strVirdir))
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
object[] paras = new object[2];
InBlock.gif                paras[
0= "IIsWebVirtualDir"//表示操作的是虚拟目录 
InBlock.gif
                paras[1= strVirdir;
InBlock.gif                rootfolder.Invoke(
"Delete", paras);
InBlock.gif                rootfolder.CommitChanges();
ExpandedSubBlockEnd.gif            }

InBlock.gif            
else
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
throw new Exception("Can''t delete " + strVirdir + ",because it isn''t exists.");
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
//批量更新 
InBlock.gif

InBlock.gif        
public void UpdateBatch()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            BatchUpdate(_virdirs);
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
//重载一个:-) 
InBlock.gif

InBlock.gif        
public void UpdateBatch(VirtualDirectories vds)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            BatchUpdate(vds);
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**////<summary> 
InBlock.gif
InBlock.gif        
///私有方法 
InBlock.gif
ExpandedSubBlockEnd.gif        
///</summary> 

InBlock.gif
InBlock.gif
InBlock.gif
InBlock.gif        
//连接服务器 
InBlock.gif

InBlock.gif        
private void ConnectToServer()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
string strPath = "IIS://" + _server + "/W3SVC/" + _website + "/ROOT";
InBlock.gif            
try
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
this.rootfolder = new DirectoryEntry(strPath);
InBlock.gif                _virdirs 
= GetVirDirs(this.rootfolder.Children);
ExpandedSubBlockEnd.gif            }

InBlock.gif            
catch (Exception e)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
throw new Exception("Can''t connect to the server [" + _server + "dot.gif", e);
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
//执行批量更新 
InBlock.gif

InBlock.gif        
private void BatchUpdate(VirtualDirectories vds)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            _batchflag 
= true;
InBlock.gif           
foreach (object item in vds.Values)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                VirtualDirectory vd 
= (VirtualDirectory)item;
InBlock.gif                
switch (vd.flag)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    
case 0:
InBlock.gif                        
break;
InBlock.gif                    
case 1:
InBlock.gif                        Create(vd);
InBlock.gif                        
break;
InBlock.gif                    
case 2:
InBlock.gif                        Update(vd);
InBlock.gif                        
break;
ExpandedSubBlockEnd.gif                }

ExpandedSubBlockEnd.gif            }

InBlock.gif            _batchflag 
= false;
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
//更新东东 
InBlock.gif

InBlock.gif        
private void UpdateDirInfo(DirectoryEntry de, VirtualDirectory vd)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            de.Properties[
"AnonymousUserName"][0= vd.AnonymousUserName;
InBlock.gif            de.Properties[
"AnonymousUserPass"][0= vd.AnonymousUserPass;
InBlock.gif            de.Properties[
"AccessRead"][0= vd.AccessRead;
InBlock.gif            de.Properties[
"AccessExecute"][0= vd.AccessExecute;
InBlock.gif            de.Properties[
"AccessWrite"][0= vd.AccessWrite;
InBlock.gif            de.Properties[
"AuthBasic"][0= vd.AuthBasic;
InBlock.gif            de.Properties[
"AuthNTLM"][0= vd.AuthNTLM;
InBlock.gif            de.Properties[
"ContentIndexed"][0= vd.ContentIndexed;
InBlock.gif            de.Properties[
"EnableDefaultDoc"][0= vd.EnableDefaultDoc;
InBlock.gif            de.Properties[
"EnableDirBrowsing"][0= vd.EnableDirBrowsing;
InBlock.gif            de.Properties[
"AccessSSL"][0= vd.AccessSSL;
InBlock.gif            de.Properties[
"AccessScript"][0= vd.AccessScript;
InBlock.gif            de.Properties[
"DefaultDoc"][0= vd.DefaultDoc;
InBlock.gif            de.Properties[
"Path"][0= vd.Path;
InBlock.gif            de.CommitChanges();
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif
InBlock.gif
InBlock.gif        
//获取虚拟目录集合 
InBlock.gif

InBlock.gif        
private VirtualDirectories GetVirDirs(DirectoryEntries des)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            VirtualDirectories tmpdirs 
= new VirtualDirectories();
InBlock.gif            
foreach (DirectoryEntry de in des)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
if (de.SchemaClassName == "IIsWebVirtualDir")
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    VirtualDirectory vd 
= new VirtualDirectory();
InBlock.gif                    vd.Name 
= de.Name;
InBlock.gif                    vd.AccessRead 
= (bool)de.Properties["AccessRead"][0];
InBlock.gif                    vd.AccessExecute 
= (bool)de.Properties["AccessExecute"][0];
InBlock.gif                    vd.AccessWrite 
= (bool)de.Properties["AccessWrite"][0];
InBlock.gif                    vd.AnonymousUserName 
= (string)de.Properties["AnonymousUserName"][0];
InBlock.gif                    vd.AnonymousUserPass 
= (string)de.Properties["AnonymousUserName"][0];
InBlock.gif                    vd.AuthBasic 
= (bool)de.Properties["AuthBasic"][0];
InBlock.gif                    vd.AuthNTLM 
= (bool)de.Properties["AuthNTLM"][0];
InBlock.gif                    vd.ContentIndexed 
= (bool)de.Properties["ContentIndexed"][0];
InBlock.gif                    vd.EnableDefaultDoc 
= (bool)de.Properties["EnableDefaultDoc"][0];
InBlock.gif                    vd.EnableDirBrowsing 
= (bool)de.Properties["EnableDirBrowsing"][0];
InBlock.gif                    vd.AccessSSL 
= (bool)de.Properties["AccessSSL"][0];
InBlock.gif                    vd.AccessScript 
= (bool)de.Properties["AccessScript"][0];
InBlock.gif                    vd.Path 
= (string)de.Properties["Path"][0];
InBlock.gif                    vd.flag 
= 0;
InBlock.gif                    vd.DefaultDoc 
= (string)de.Properties["DefaultDoc"][0];
InBlock.gif                    tmpdirs.Add(vd.Name, vd);
ExpandedSubBlockEnd.gif                }

ExpandedSubBlockEnd.gif            }

InBlock.gif            
return tmpdirs;
ExpandedSubBlockEnd.gif        }

ExpandedSubBlockEnd.gif    }

InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif    
/**//// <summary> 
InBlock.gif
InBlock.gif    
/// VirtualDirectory类 
InBlock.gif
ExpandedSubBlockEnd.gif    
/// </summary> 

InBlock.gif
InBlock.gif    
public class VirtualDirectory
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
InBlock.gif        
private bool _read, _execute, _script, _ssl, _write, _authbasic, _authntlm, _indexed, _endirbrow, _endefaultdoc;
InBlock.gif        
private string _ausername, _auserpass, _name, _path;
InBlock.gif        
private int _flag;
InBlock.gif        
private string _defaultdoc;
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary> 
InBlock.gif
InBlock.gif        
/// 构造函数 
InBlock.gif
ExpandedSubBlockEnd.gif        
/// </summary> 

InBlock.gif
InBlock.gif        
public VirtualDirectory()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            SetValue();
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
public VirtualDirectory(string strVirDirName)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            _name 
= strVirDirName;
InBlock.gif            SetValue();
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
private void SetValue()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            _read 
= true; _execute = false; _script = false; _ssl = false; _write = false; _authbasic = false; _authntlm = false;
InBlock.gif            _indexed 
= false; _endirbrow = false; _endefaultdoc = false;
InBlock.gif            _flag 
= 1;
InBlock.gif            _defaultdoc 
= "default.htm,default.aspx,default.asp,index.htm";
InBlock.gif            _path 
= "C:\\";
InBlock.gif            _ausername 
= ""; _auserpass = ""; _name = "";
ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**////<summary> 
InBlock.gif
InBlock.gif        
///定义属性,IISVirtualDir太多属性了 
InBlock.gif
InBlock.gif        
///我只搞了比较重要的一些,其它的大伙需要的自个加吧。 
InBlock.gif
ExpandedSubBlockEnd.gif        
///</summary> 

InBlock.gif
InBlock.gif
InBlock.gif
InBlock.gif        
public int flag
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif            
get dot.gifreturn _flag; }
ExpandedSubBlockStart.gifContractedSubBlock.gif            
set dot.gif{ _flag = value; }
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
public bool AccessRead
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif            
get dot.gifreturn _read; }
ExpandedSubBlockStart.gifContractedSubBlock.gif            
set dot.gif{ _read = value; }
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
public bool AccessWrite
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif            
get dot.gifreturn _write; }
ExpandedSubBlockStart.gifContractedSubBlock.gif            
set dot.gif{ _write = value; }
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
public bool AccessExecute
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif            
get dot.gifreturn _execute; }
ExpandedSubBlockStart.gifContractedSubBlock.gif            
set dot.gif{ _execute = value; }
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
public bool AccessSSL
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif            
get dot.gifreturn _ssl; }
ExpandedSubBlockStart.gifContractedSubBlock.gif            
set dot.gif{ _ssl = value; }
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
public bool AccessScript
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif            
get dot.gifreturn _script; }
ExpandedSubBlockStart.gifContractedSubBlock.gif            
set dot.gif{ _script = value; }
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
public bool AuthBasic
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif            
get dot.gifreturn _authbasic; }
ExpandedSubBlockStart.gifContractedSubBlock.gif            
set dot.gif{ _authbasic = value; }
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
public bool AuthNTLM
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif            
get dot.gifreturn _authntlm; }
ExpandedSubBlockStart.gifContractedSubBlock.gif            
set dot.gif{ _authntlm = value; }
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
public bool ContentIndexed
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif            
get dot.gifreturn _indexed; }
ExpandedSubBlockStart.gifContractedSubBlock.gif            
set dot.gif{ _indexed = value; }
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
public bool EnableDirBrowsing
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif            
get dot.gifreturn _endirbrow; }
ExpandedSubBlockStart.gifContractedSubBlock.gif            
set dot.gif{ _endirbrow = value; }
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
public bool EnableDefaultDoc
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif            
get dot.gifreturn _endefaultdoc; }
ExpandedSubBlockStart.gifContractedSubBlock.gif            
set dot.gif{ _endefaultdoc = value; }
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
public string Name
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif            
get dot.gifreturn _name; }
ExpandedSubBlockStart.gifContractedSubBlock.gif            
set dot.gif{ _name = value; }
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
public string Path
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif            
get dot.gifreturn _path; }
ExpandedSubBlockStart.gifContractedSubBlock.gif            
set dot.gif{ _path = value; }
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
public string DefaultDoc
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif            
get dot.gifreturn _defaultdoc; }
ExpandedSubBlockStart.gifContractedSubBlock.gif            
set dot.gif{ _defaultdoc = value; }
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
public string AnonymousUserName
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif            
get dot.gifreturn _ausername; }
ExpandedSubBlockStart.gifContractedSubBlock.gif            
set dot.gif{ _ausername = value; }
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
public string AnonymousUserPass
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif            
get dot.gifreturn _auserpass; }
ExpandedSubBlockStart.gifContractedSubBlock.gif            
set dot.gif{ _auserpass = value; }
ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockEnd.gif    }

InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif    
/**//// <summary> 
InBlock.gif
InBlock.gif    
/// 集合VirtualDirectories 
InBlock.gif
ExpandedSubBlockEnd.gif    
/// </summary> 

InBlock.gif
InBlock.gif
InBlock.gif
InBlock.gif    
public class VirtualDirectories : System.Collections.Hashtable
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
InBlock.gif        
public VirtualDirectories()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
//添加新的方法 
InBlock.gif
        public VirtualDirectory Find(string strName)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
return (VirtualDirectory)this[strName];
ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockEnd.gif    }

InBlock.gif
InBlock.gif
//}
InBlock.gif
7.2005中使用IIS作为服务器的方法:创建网站的时候选择http,并填写 http://localhost/Webtest。打开网站的时候选择本地IIS
8。仍然存在的问题,创建虚拟目录或删除虚拟目录时没有权限,望有人解答

转载于:https://www.cnblogs.com/xu8512/archive/2007/05/03/735358.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值