public ActionResult Main(String id) { if (id == "Restart") { HttpRuntime.UnloadAppDomain(); id = null; } ViewBag.Act = id; //ViewBag.User = ManageProvider.User; ViewBag.Config = SysConfig.Current; var name = Request.ServerVariables["Server_SoftWare"]; if (String.IsNullOrEmpty(name)) { name = Process.GetCurrentProcess().ProcessName; } // 检测集成管道,低版本.Net不支持,请使用者根据情况自行注释 try { if (HttpRuntime.UsingIntegratedPipeline) { name += " [集成管道]"; } } catch { } ViewBag.WebServerName = name; ViewBag.MyAsms = AssemblyX.GetMyAssemblies().OrderBy(e => e.Name).OrderByDescending(e => e.Compile).ToArray(); var Asms = AssemblyX.GetAssemblies(null).ToArray(); Asms = Asms.OrderBy(e => e.Name).OrderByDescending(e => e.Compile).ToArray(); ViewBag.Asms = Asms; //return View(); switch ((id + "").ToLower()) { case "processmodules": return(View("ProcessModules")); case "assembly": return(View("Assembly")); case "session": return(View("Session")); case "cache": return(View("Cache")); case "servervar": return(View("ServerVar")); default: return(View()); } }
public ActionResult Main(String id) { if (id == "Restart") { HttpRuntime.UnloadAppDomain(); id = null; } ViewBag.Act = id; ViewBag.User = ManageProvider.User; ViewBag.Config = SysConfig.Current; String name = Request.ServerVariables["Server_SoftWare"]; if (String.IsNullOrEmpty(name)) { name = Process.GetCurrentProcess().ProcessName; } // 检测集成管道,低版本.Net不支持,请使用者根据情况自行注释 try { if (HttpRuntime.UsingIntegratedPipeline) { name += " [集成管道]"; } } catch { } ViewBag.WebServerName = name; ViewBag.MyAsms = AssemblyX.GetMyAssemblies().OrderBy(e => e.Name).OrderByDescending(e => e.Compile).ToArray(); var Asms = AssemblyX.GetAssemblies(null).ToArray(); Asms = Asms.OrderBy(e => e.Name).OrderByDescending(e => e.Compile).ToArray(); ViewBag.Asms = Asms; return(View()); }
protected void Page_Load(object sender, EventArgs e) { if (ManageProvider.Provider.Current == null) { Response.Write("无权访问!"); Response.End(); return; } if (Request["Act"] == "Restart") { HttpRuntime.UnloadAppDomain(); Response.Redirect(Path.GetFileName(Request.Path)); return; } if (!IsPostBack) { gv.DataSource = AssemblyX.GetMyAssemblies(); gv.DataBind(); } }
protected void gv_Sorting(object sender, GridViewSortEventArgs e) { List <AssemblyX> list = AssemblyX.GetMyAssemblies(); list.Sort(delegate(AssemblyX item1, AssemblyX item2) { Int32 d = e.SortDirection == SortDirection.Ascending ? 1 : -1; if (e.SortExpression == "Compile") { return(d * item1.Compile.CompareTo(item2.Compile)); } else if (e.SortExpression == "Title") { return(d * item1.Title.CompareTo(item2.Title)); } else if (e.SortExpression == "FileVersion") { return(d * item1.FileVersion.CompareTo(item2.FileVersion)); } else if (e.SortExpression == "Version") { return(d * item1.Version.CompareTo(item2.Version)); } else if (e.SortExpression == "Name") { return(d * item1.Name.CompareTo(item2.Name)); } else { return(d * item1.Name.CompareTo(item2.Name)); } }); gv.DataSource = list; gv.DataBind(); }