Beispiel #1
0
    List <AssemblyX> GetSource()
    {
        String           bin  = HttpRuntime.BinDirectory.ToLower();
        List <AssemblyX> list = new List <AssemblyX>();

        foreach (AssemblyX asmx in AssemblyX.GetAssemblies())
        {
            if (String.IsNullOrEmpty(asmx.FileVersion))
            {
                continue;
            }
            String file = asmx.Asm.CodeBase;
            if (String.IsNullOrEmpty(file))
            {
                continue;
            }
            file = file.ToLower();
            if (file.StartsWith("file:///"))
            {
                file = file.Substring("file:///".Length);
            }
            file = file.Replace("/", "\\");
            if (!file.StartsWith(bin))
            {
                continue;
            }

            list.Add(asmx);
        }

        return(list);
    }
Beispiel #2
0
        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());
            }
        }
Beispiel #3
0
        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());
        }