日期:2014-05-18 浏览次数:21000 次
               public override void Uninstall(System.Collections.IDictionary savedState)
        {
            base.Uninstall(savedState);
            //卸载时删除虚拟目录,有问题
            System.DirectoryServices.DirectoryEntry dirroot = new DirectoryEntry("IIS://localhost/W3SVC/1/ROOT");
            StringBuilder sb = new StringBuilder();
            sb.Append(GetCurrentDomainPath());
            string sbb = sb.ToString();
            MessageBox.Show(sbb);
            string sweb = System.Web.HttpContext.Current.Server.MapPath("/");
            MessageBox.Show(sweb + sbb);
            DirectoryEntry Dirport = dirroot.Children.Find(sweb, sbb);
            Dirport.Invoke("AppDelete", true);
            dirroot.CommitChanges();
……………………