如何用C#操纵IIS

None.gif using  System; 
None.gif
using  System.DirectoryServices; 
None.gif
using  System.Collections; 
None.gif
using  System.Text.RegularExpressions; 
None.gif
using  System.Text; 
None.gif
None.gif
namespace  Wuhy.ToolBox 
ExpandedBlockStart.gifContractedBlock.gif
dot.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif     
/**//**//**////  
InBlock.gif     
///  这个类是静态类。用来实现管理IIS的基本操作。 
InBlock.gif     
///  管理IIS有两种方式,一是ADSI,一是WMI。由于系统限制的原因,只好选择使用ADSI实现功能。 
InBlock.gif     
///  这是一个遗憾。只有等到只有使用IIS 6的时候,才有可能使用WMI来管理系统 
InBlock.gif     
///  不过有一个问题就是,我现在也觉得这样的一个方法在本地执行会比较的好。最好不要远程执行。 
InBlock.gif     
///  因为那样需要占用相当数量的带宽,即使要远程执行,也是推荐在同一个网段里面执行 
ExpandedSubBlockEnd.gif     
///  

InBlock.gif     public class IISAdminLib 
ExpandedSubBlockStart.gifContractedSubBlock.gif     
dot.gif
ContractedSubBlock.gifExpandedSubBlockStart.gif          UserName,Password,HostName的定义
UserName,Password,HostName的定义#region UserName,Password,HostName的定义 
InBlock.gif
InBlock.gif         
public static string HostName 
ExpandedSubBlockStart.gifContractedSubBlock.gif         
dot.gif
InBlock.gif              
get 
ExpandedSubBlockStart.gifContractedSubBlock.gif              
dot.gif
InBlock.gif                   
return hostName; 
ExpandedSubBlockEnd.gif              }
 
InBlock.gif              
set 
ExpandedSubBlockStart.gifContractedSubBlock.gif              
dot.gif
InBlock.gif                   hostName 
= value; 
ExpandedSubBlockEnd.gif              }
 
ExpandedSubBlockEnd.gif         }
 
InBlock.gif         
public static string UserName 
ExpandedSubBlockStart.gifContractedSubBlock.gif         
dot.gif
InBlock.gif
InBlock.gif              
get 
ExpandedSubBlockStart.gifContractedSubBlock.gif              
dot.gif
InBlock.gif
InBlock.gif                   
return userName; 
InBlock.gif
ExpandedSubBlockEnd.gif              }
 
InBlock.gif
InBlock.gif              
set 
ExpandedSubBlockStart.gifContractedSubBlock.gif              
dot.gif
InBlock.gif
InBlock.gif                   userName 
= value; 
InBlock.gif
ExpandedSubBlockEnd.gif              }
 
InBlock.gif
ExpandedSubBlockEnd.gif         }
 
InBlock.gif         
public static string Password 
ExpandedSubBlockStart.gifContractedSubBlock.gif         
dot.gif
InBlock.gif
InBlock.gif              
get 
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif              
dot.gif
InBlock.gif
InBlock.gif                   
return password; 
InBlock.gif
ExpandedSubBlockEnd.gif              }
 
InBlock.gif
InBlock.gif              
set 
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif              
dot.gif
InBlock.gif
InBlock.gif                   
if(UserName.Length <= 1
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif                   
dot.gif
InBlock.gif
InBlock.gif                       
throw new ArgumentException("还没有指定好用户名。请先指定用户名"); 
InBlock.gif
ExpandedSubBlockEnd.gif                   }
 
InBlock.gif
InBlock.gif  
InBlock.gif
InBlock.gif                   password 
= value; 
InBlock.gif
ExpandedSubBlockEnd.gif              }
 
InBlock.gif
ExpandedSubBlockEnd.gif         }
 
InBlock.gif
InBlock.gif  
InBlock.gif
InBlock.gif         
public static void RemoteConfig(string hostName, string userName, string password) 
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif         
dot.gif
InBlock.gif
InBlock.gif              HostName 
= hostName; 
InBlock.gif
InBlock.gif              UserName 
= userName; 
InBlock.gif
InBlock.gif              Password 
= password; 
InBlock.gif
ExpandedSubBlockEnd.gif         }
 
InBlock.gif
InBlock.gif  
InBlock.gif
InBlock.gif          
private static string hostName = "localhost"
InBlock.gif
InBlock.gif          
private static string userName; 
InBlock.gif
InBlock.gif          
private static string password; 
InBlock.gif
ExpandedSubBlockEnd.gif          
#endregion
 
InBlock.gif
InBlock.gif  
InBlock.gif
ContractedSubBlock.gifExpandedSubBlockStart.gif          根据路径构造Entry的方法
根据路径构造Entry的方法#region 根据路径构造Entry的方法 
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif         
/**//**//**////  
InBlock.gif
InBlock.gif         
///  根据是否有用户名来判断是否是远程服务器。 
InBlock.gif
InBlock.gif         
///  然后再构造出不同的DirectoryEntry出来 
InBlock.gif
InBlock.gif         
///  
InBlock.gif
InBlock.gif         
/// DirectoryEntry的路径 
InBlock.gif
ExpandedSubBlockEnd.gif         
/// 返回的是DirectoryEntry实例 

InBlock.gif
InBlock.gif         
public static DirectoryEntry GetDirectoryEntry(string entPath) 
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif         
dot.gif
InBlock.gif
InBlock.gif              DirectoryEntry ent; 
InBlock.gif
InBlock.gif  
InBlock.gif
InBlock.gif              
if(UserName == null
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif              
dot.gif
InBlock.gif
InBlock.gif                   ent 
= new DirectoryEntry(entPath); 
InBlock.gif
ExpandedSubBlockEnd.gif              }
 
InBlock.gif
InBlock.gif              
else 
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif              
dot.gif
InBlock.gif
InBlock.gif                   
//    ent = new DirectoryEntry(entPath, HostName+"\\"+UserName, Password, AuthenticationTypes.Secure); 
InBlock.gif

InBlock.gif                   ent 
= new DirectoryEntry(entPath, UserName, Password, AuthenticationTypes.Secure); 
InBlock.gif
ExpandedSubBlockEnd.gif              }
 
InBlock.gif
InBlock.gif  
InBlock.gif
InBlock.gif              
return ent; 
InBlock.gif
ExpandedSubBlockEnd.gif         }
 
InBlock.gif
ExpandedSubBlockEnd.gif          
#endregion
 
InBlock.gif
InBlock.gif  
InBlock.gif
ContractedSubBlock.gifExpandedSubBlockStart.gif          添加,删除网站的方法
添加,删除网站的方法#region 添加,删除网站的方法 
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif         
/**//**//**////  
InBlock.gif
InBlock.gif         
///  创建一个新的网站。根据传过来的信息进行配置 
InBlock.gif
InBlock.gif         
///  
InBlock.gif
ExpandedSubBlockEnd.gif         
/// 存储的是新网站的信息 

InBlock.gif
InBlock.gif         
public static void CreateNewWebSite(NewWebSiteInfo siteInfo) 
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif         
dot.gif
InBlock.gif
InBlock.gif              
if(! EnsureNewSiteEnavaible(siteInfo.BindString)) 
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif              
dot.gif
InBlock.gif
InBlock.gif                   
throw new DuplicatedWebSiteException("已经有了这样的网站了。" + Environment.NewLine + siteInfo.BindString); 
InBlock.gif
ExpandedSubBlockEnd.gif              }
 
InBlock.gif
InBlock.gif  
InBlock.gif
InBlock.gif              
string entPath = String.Format("IIS://{0}/w3svc", HostName); 
InBlock.gif
InBlock.gif              DirectoryEntry rootEntry 
= GetDirectoryEntry(entPath); 
InBlock.gif
InBlock.gif  
InBlock.gif
InBlock.gif              
string newSiteNum = GetNewWebSiteID(); 
InBlock.gif
InBlock.gif              DirectoryEntry newSiteEntry 
= rootEntry.Children.Add(newSiteNum, "IIsWebServer"); 
InBlock.gif
InBlock.gif              newSiteEntry.CommitChanges(); 
InBlock.gif
InBlock.gif  
InBlock.gif
InBlock.gif              newSiteEntry.Properties[
"ServerBindings"].Value = siteInfo.BindString; 
InBlock.gif
InBlock.gif              newSiteEntry.Properties[
"ServerComment"].Value = siteInfo.CommentOfWebSite; 
InBlock.gif
InBlock.gif              newSiteEntry.CommitChanges(); 
InBlock.gif
InBlock.gif  
InBlock.gif
InBlock.gif              DirectoryEntry vdEntry 
= newSiteEntry.Children.Add("root""IIsWebVirtualDir"); 
InBlock.gif
InBlock.gif              vdEntry.CommitChanges(); 
InBlock.gif
InBlock.gif  
InBlock.gif
InBlock.gif              vdEntry.Properties[
"Path"].Value = siteInfo.WebPath; 
InBlock.gif
InBlock.gif              vdEntry.CommitChanges(); 
InBlock.gif
ExpandedSubBlockEnd.gif         }
 
InBlock.gif
InBlock.gif  
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif         
/**//**//**////  
InBlock.gif
InBlock.gif         
///  删除一个网站。根据网站名称删除。 
InBlock.gif
InBlock.gif         
///  
InBlock.gif
ExpandedSubBlockEnd.gif         
/// 网站名称 

InBlock.gif
InBlock.gif         
public static void DeleteWebSiteByName(string siteName) 
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif         
dot.gif
InBlock.gif
InBlock.gif              
string siteNum = GetWebSiteNum(siteName); 
InBlock.gif
InBlock.gif              
string siteEntPath = String.Format("IIS://{0}/w3svc/{1}", HostName, siteNum); 
InBlock.gif
InBlock.gif              DirectoryEntry siteEntry 
= GetDirectoryEntry(siteEntPath); 
InBlock.gif
InBlock.gif  
InBlock.gif
InBlock.gif              
string rootPath = String.Format("IIS://{0}/w3svc", HostName); 
InBlock.gif
InBlock.gif              DirectoryEntry rootEntry 
= GetDirectoryEntry(rootPath); 
InBlock.gif
InBlock.gif  
InBlock.gif
InBlock.gif              rootEntry.Children.Remove(siteEntry); 
InBlock.gif
InBlock.gif              rootEntry.CommitChanges(); 
InBlock.gif
ExpandedSubBlockEnd.gif         }
 
InBlock.gif
ExpandedSubBlockEnd.gif          
#endregion
 
InBlock.gif
InBlock.gif  
InBlock.gif
ContractedSubBlock.gifExpandedSubBlockStart.gif          Start和Stop网站的方法
Start和Stop网站的方法#region Start和Stop网站的方法 
InBlock.gif
InBlock.gif         
public static void StartWebSite(string siteName) 
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif         
dot.gif
InBlock.gif
InBlock.gif              
string siteNum = GetWebSiteNum(siteName); 
InBlock.gif
InBlock.gif              
string siteEntPath = String.Format("IIS://{0}/w3svc/{1}", HostName, siteNum); 
InBlock.gif
InBlock.gif              DirectoryEntry siteEntry 
= GetDirectoryEntry(siteEntPath); 
InBlock.gif
InBlock.gif  
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif              siteEntry.Invoke(
"Start"new object[] dot.gif{}); 
InBlock.gif
ExpandedSubBlockEnd.gif         }
 
InBlock.gif
InBlock.gif  
InBlock.gif
InBlock.gif         
public static void StopWebSite(string siteName) 
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif         
dot.gif
InBlock.gif
InBlock.gif              
string siteNum = GetWebSiteNum(siteName); 
InBlock.gif
InBlock.gif              
string siteEntPath = String.Format("IIS://{0}/w3svc/{1}", HostName, siteNum); 
InBlock.gif
InBlock.gif              DirectoryEntry siteEntry 
= GetDirectoryEntry(siteEntPath); 
InBlock.gif
InBlock.gif  
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif              siteEntry.Invoke(
"Stop"new object[] dot.gif{}); 
InBlock.gif
ExpandedSubBlockEnd.gif         }
 
InBlock.gif
ExpandedSubBlockEnd.gif          
#endregion
 
InBlock.gif
InBlock.gif  
InBlock.gif
ContractedSubBlock.gifExpandedSubBlockStart.gif          确认网站是否相同
确认网站是否相同#region 确认网站是否相同 
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif         
/**//**//**////  
InBlock.gif
InBlock.gif         
///  确定一个新的网站与现有的网站没有相同的。 
InBlock.gif
InBlock.gif         
///  这样防止将非法的数据存放到IIS里面去 
InBlock.gif
InBlock.gif         
///  
InBlock.gif
InBlock.gif         
/// 网站邦定信息 
InBlock.gif
ExpandedSubBlockEnd.gif         
/// 真为可以创建,假为不可以创建 

InBlock.gif
InBlock.gif         
public static bool EnsureNewSiteEnavaible(string bindStr) 
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif         
dot.gif
InBlock.gif
InBlock.gif              
string entPath = String.Format("IIS://{0}/w3svc", HostName); 
InBlock.gif
InBlock.gif              DirectoryEntry ent 
= GetDirectoryEntry(entPath); 
InBlock.gif
InBlock.gif    
InBlock.gif
InBlock.gif              
foreach(DirectoryEntry child in ent.Children) 
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif              
dot.gif
InBlock.gif
InBlock.gif                   
if(child.SchemaClassName == "IIsWebServer"
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif                   
dot.gif
InBlock.gif
InBlock.gif                        
if(child.Properties["ServerBindings"].Value != null
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif                       
dot.gif
InBlock.gif
InBlock.gif                            
if(child.Properties["ServerBindings"].Value.ToString() == bindStr) 
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif                            
dot.gif
InBlock.gif
InBlock.gif                                 
return false
InBlock.gif
ExpandedSubBlockEnd.gif                            }
 
InBlock.gif
ExpandedSubBlockEnd.gif                       }
 
InBlock.gif
ExpandedSubBlockEnd.gif                   }
 
InBlock.gif
ExpandedSubBlockEnd.gif              }
 
InBlock.gif
InBlock.gif  
InBlock.gif
InBlock.gif              
return true
InBlock.gif
ExpandedSubBlockEnd.gif         }
 
InBlock.gif
ExpandedSubBlockEnd.gif          
#endregion
 
InBlock.gif
InBlock.gif  
InBlock.gif
ContractedSubBlock.gifExpandedSubBlockStart.gif          获取一个网站编号的方法
获取一个网站编号的方法#region 获取一个网站编号的方法 
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif         
/**//**//**////  
InBlock.gif
InBlock.gif         
///  获取一个网站的编号。根据网站的ServerBindings或者ServerComment来确定网站编号 
InBlock.gif
InBlock.gif         
///  
InBlock.gif
InBlock.gif         
///  
InBlock.gif
InBlock.gif         
/// 返回网站的编号 
InBlock.gif
ExpandedSubBlockEnd.gif         
/// 表示没有找到网站 

InBlock.gif
InBlock.gif         
public static string GetWebSiteNum(string siteName) 
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif         
dot.gif
InBlock.gif
InBlock.gif              Regex regex 
= new Regex(siteName); 
InBlock.gif
InBlock.gif              
string tmpStr; 
InBlock.gif
InBlock.gif  
InBlock.gif
InBlock.gif              
string entPath = String.Format("IIS://{0}/w3svc", HostName); 
InBlock.gif
InBlock.gif              DirectoryEntry ent 
= GetDirectoryEntry(entPath); 
InBlock.gif
InBlock.gif    
InBlock.gif
InBlock.gif              
foreach(DirectoryEntry child in ent.Children) 
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif              
dot.gif
InBlock.gif
InBlock.gif                   
if(child.SchemaClassName == "IIsWebServer"
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif                   
dot.gif
InBlock.gif
InBlock.gif                        
if(child.Properties["ServerBindings"].Value != null
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif                       
dot.gif
InBlock.gif
InBlock.gif                            tmpStr 
= child.Properties["ServerBindings"].Value.ToString(); 
InBlock.gif
InBlock.gif                            
if(regex.Match(tmpStr).Success) 
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif                            
dot.gif
InBlock.gif
InBlock.gif                                 
return child.Name; 
InBlock.gif
ExpandedSubBlockEnd.gif                            }
 
InBlock.gif
ExpandedSubBlockEnd.gif                       }
 
InBlock.gif
InBlock.gif  
InBlock.gif
InBlock.gif                        
if(child.Properties["ServerComment"].Value != null
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif                       
dot.gif
InBlock.gif
InBlock.gif                            tmpStr 
= child.Properties["ServerComment"].Value.ToString(); 
InBlock.gif
InBlock.gif                            
if(regex.Match(tmpStr).Success) 
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif                            
dot.gif
InBlock.gif
InBlock.gif                                 
return child.Name; 
InBlock.gif
ExpandedSubBlockEnd.gif                            }
 
InBlock.gif
ExpandedSubBlockEnd.gif                       }
 
InBlock.gif
ExpandedSubBlockEnd.gif                   }
 
InBlock.gif
ExpandedSubBlockEnd.gif              }
 
InBlock.gif
InBlock.gif  
InBlock.gif
InBlock.gif              
throw new NotFoundWebSiteException("没有找到我们想要的站点" + siteName); 
InBlock.gif
ExpandedSubBlockEnd.gif         }
 
InBlock.gif
ExpandedSubBlockEnd.gif          
#endregion
 
InBlock.gif
InBlock.gif  
InBlock.gif
ContractedSubBlock.gifExpandedSubBlockStart.gif          获取新网站id的方法
获取新网站id的方法#region 获取新网站id的方法 
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif         
/**//**//**////  
InBlock.gif
InBlock.gif         
///  获取网站系统里面可以使用的最小的ID。 
InBlock.gif
InBlock.gif         
///  这是因为每个网站都需要有一个唯一的编号,而且这个编号越小越好。 
InBlock.gif
InBlock.gif         
///  这里面的算法经过了测试是没有问题的。 
InBlock.gif
InBlock.gif         
///  
InBlock.gif
ExpandedSubBlockEnd.gif         
/// 最小的id 

InBlock.gif
InBlock.gif         
public static string GetNewWebSiteID() 
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif         
dot.gif
InBlock.gif
InBlock.gif              ArrayList list 
= new ArrayList(); 
InBlock.gif
InBlock.gif              
string tmpStr; 
InBlock.gif
InBlock.gif  
InBlock.gif
InBlock.gif              
string entPath = String.Format("IIS://{0}/w3svc", HostName); 
InBlock.gif
InBlock.gif              DirectoryEntry ent 
= GetDirectoryEntry(entPath); 
InBlock.gif
InBlock.gif    
InBlock.gif
InBlock.gif              
foreach(DirectoryEntry child in ent.Children) 
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif              
dot.gif
InBlock.gif
InBlock.gif                   
if(child.SchemaClassName == "IIsWebServer"
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif                   
dot.gif
InBlock.gif
InBlock.gif                       tmpStr 
= child.Name.ToString(); 
InBlock.gif
InBlock.gif                        list.Add(Convert.ToInt32(tmpStr)); 
InBlock.gif
ExpandedSubBlockEnd.gif                   }
 
InBlock.gif
ExpandedSubBlockEnd.gif              }
 
InBlock.gif
InBlock.gif  
InBlock.gif
InBlock.gif              list.Sort(); 
InBlock.gif
InBlock.gif  
InBlock.gif
InBlock.gif              
int i = 1
InBlock.gif
InBlock.gif              
foreach(int j in list) 
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif              
dot.gif
InBlock.gif
InBlock.gif                   
if(i == j) 
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif                   
dot.gif
InBlock.gif
InBlock.gif                       i
++
InBlock.gif
ExpandedSubBlockEnd.gif                   }
 
InBlock.gif
ExpandedSubBlockEnd.gif              }
 
InBlock.gif
InBlock.gif  
InBlock.gif
InBlock.gif              
return i.ToString(); 
InBlock.gif
ExpandedSubBlockEnd.gif         }
 
InBlock.gif
ExpandedSubBlockEnd.gif          
#endregion
 
InBlock.gif
ExpandedSubBlockEnd.gif     }
 
InBlock.gif
InBlock.gif  
InBlock.gif
ContractedSubBlock.gifExpandedSubBlockStart.gif     新网站信息结构体
新网站信息结构体#region 新网站信息结构体 
InBlock.gif
InBlock.gif     
public struct NewWebSiteInfo 
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif     
dot.gif
InBlock.gif
InBlock.gif          
private string hostIP;   // The Hosts IP Address 
InBlock.gif

InBlock.gif          
private string portNum;   // The New Web Sites Port.generally is "80" 
InBlock.gif

InBlock.gif          
private string descOfWebSite; // 网站表示。一般为网站的网站名。例如"www.dns.com.cn" 
InBlock.gif

InBlock.gif          
private string commentOfWebSite;// 网站注释。一般也为网站的网站名。 
InBlock.gif

InBlock.gif          
private string webPath;   // 网站的主目录。例如"e:\tmp" 
InBlock.gif

InBlock.gif  
InBlock.gif
InBlock.gif         
public NewWebSiteInfo(string hostIP, string portNum, string descOfWebSite, string commentOfWebSite, string webPath) 
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif         
dot.gif
InBlock.gif
InBlock.gif              
this.hostIP = hostIP; 
InBlock.gif
InBlock.gif              
this.portNum = portNum; 
InBlock.gif
InBlock.gif              
this.descOfWebSite = descOfWebSite; 
InBlock.gif
InBlock.gif              
this.commentOfWebSite = commentOfWebSite; 
InBlock.gif
InBlock.gif              
this.webPath = webPath; 
InBlock.gif
ExpandedSubBlockEnd.gif         }
 
InBlock.gif
InBlock.gif  
InBlock.gif
InBlock.gif         
public string BindString 
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif         
dot.gif
InBlock.gif
InBlock.gif              
get 
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif              
dot.gif
InBlock.gif
InBlock.gif                   
return String.Format("{0}:{1}:{2}", hostIP, portNum, descOfWebSite); 
InBlock.gif
ExpandedSubBlockEnd.gif              }
 
InBlock.gif
ExpandedSubBlockEnd.gif         }
 
InBlock.gif
InBlock.gif  
InBlock.gif
InBlock.gif         
public string CommentOfWebSite 
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif         
dot.gif
InBlock.gif
InBlock.gif              
get 
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif              
dot.gif
InBlock.gif
InBlock.gif                   
return commentOfWebSite; 
InBlock.gif
ExpandedSubBlockEnd.gif              }
 
InBlock.gif
ExpandedSubBlockEnd.gif         }
 
InBlock.gif
InBlock.gif  
InBlock.gif
InBlock.gif         
public string WebPath 
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif         
dot.gif
InBlock.gif
InBlock.gif              
get 
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif              
dot.gif
InBlock.gif
InBlock.gif                   
return webPath; 
InBlock.gif
ExpandedSubBlockEnd.gif              }
 
InBlock.gif
ExpandedSubBlockEnd.gif         }
 
InBlock.gif
ExpandedSubBlockEnd.gif     }
 
InBlock.gif
ExpandedSubBlockEnd.gif     
#endregion
 
InBlock.gif
ExpandedBlockEnd.gif}
 
None.gif
None.gif

转载于:https://www.cnblogs.com/suchenge/articles/891862.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值