110,536
社区成员
发帖
与我相关
我的任务
分享
public static void RestartIISProcess()
{
try
{
System.Xml.XmlDocument xmldoc = new System.Xml.XmlDocument();
xmldoc.Load(Utils.GetMapPath("~/web.config"));
System.Xml.XmlTextWriter writer = new System.Xml.XmlTextWriter(Utils.GetMapPath("~/web.config"), null);
writer.Formatting = System.Xml.Formatting.Indented;
xmldoc.WriteTo(writer);
writer.Flush();
writer.Close();
}
catch
{ ; }
}
Utils.GetMapPath就是HttpContext.Current.Server.MapPath