急!!!怎样获得IIS的根目录位置?

dennisXing 2005-04-26 12:13:37
怎样在程序里面获得IIS的根目录位置阿?
并能判断IIS是否开启IIS,如果没开启能启动它

谢了!急
...全文
287 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
usepc 2005-04-28
  • 打赏
  • 举报
回复
http://community.csdn.net/Expert/topic/3819/3819973.xml?temp=2.573794E-02

启动:DirectoryEntry StartSite = new DirectoryEntry(WebRootPath+ "/"+网站标识,serverName + "\\administrator", admindata.pass,AuthenticationTypes.Secure);
StartSite.Invoke("Start");
Stbr.Text="提示: "+StartSite.Properties["ServerComment"].Value.ToString()+"网站已启动";

kingbao 2005-04-26
  • 打赏
  • 举报
回复
MapPath("\")
dennisXing 2005-04-26
  • 打赏
  • 举报
回复

ding~
tl_pear 2005-04-26
  • 打赏
  • 举报
回复
能不能给我一份,
谢谢先!
base1980@163.com
usepc 2005-04-26
  • 打赏
  • 举报
回复
public string serverName="LocalHost";
public string WebRootPath="IIS://LocalHost/W3SVC";

DirectoryEntry ListSite = new DirectoryEntry(WebRootPath,serverName + "\\administrator", password,AuthenticationTypes.Secure);
foreach(DirectoryEntry li in ListSite.Children)
{
if(li.Name.ToString()!="AppPools")
{
if(li.Name.ToString()!="Filters")
{
if(li.Name.ToString()!="Info")
{
WebAbout.Nodes.Add(li.Name.ToString());
}
}
}

}
取得目录

我有取得目录、网站标识、启动、停止的代码,需要的向我索取。
kingbao 2005-04-26
  • 打赏
  • 举报
回复
????没start?那aspx如何跑啊???
dennisXing 2005-04-26
  • 打赏
  • 举报
回复
如果没开启呢?

110,571

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧