Beispiel #1
0
        //All folders for json
        public List <foldersJson> GetAll()
        {
            string path      = HttpContext.Current.Server.MapPath("~/Shoots");
            string firstPath = path;

            HttpRuntime.Close();
            List <foldersJson> allfolders = new List <foldersJson>();
            int id = 0;

            foreach (var f in new DirectoryInfo(path).GetDirectories())
            {
                folderAttributes fa = new folderAttributes();
                fa.href = "/photos/index?id=" + f.FullName;
                foldersJson fj = new foldersJson();
                fj.data       = new foldersData();
                fj.data.title = f.Name;
                fj.data.id    = 1;
                fj.data.attr  = fa;
                List <foldersJson> specificList = new List <foldersJson>();
                fj.children = recursiveGetChildren(f, id, firstPath, 1);
                fj.state    = (fj.children.Count() != 0) ? "open" : "";
                allfolders.Add(fj);
                id++;
            }



            return(allfolders);
        }
Beispiel #2
0
    protected void Btnupgrade_Click(object sender, EventArgs e)
    {
        if (LearnSite.DBUtility.UpdateGrade.TableExistCheck())
        {
            if (!LearnSite.DBUtility.UpdateGrade.VersionCheck())
            {
                Oldupdate();//旧网站更新
                LearnSite.DBUtility.UpdateGrade.UpdateTableEnglish();
                Labelmsg.Text = "升级完毕,请删除本页面!以免数据库出错!";

                string ch = "数据库已经更新到最新版,点击跳回教师首页!";
                LearnSite.Common.CookieHelp.ClearTeacherCookies();
                LearnSite.Common.CookieHelp.ClearStudentCookies();//教师退出的话把本机模拟学生角色登录的学生平台也退出
                System.Threading.Thread.Sleep(200);
                LearnSite.Common.WordProcess.Alert(ch, this.Page);
                HttpRuntime.Close();//清除缓存,释放资源
                Response.Redirect("~/Teacher/index.aspx", false);
            }
            else
            {
                string ch = "已经更新过了!请点击跳回教师首页!\n若要求运行一次则补丁已经修正!";
                LearnSite.Common.WordProcess.Alert(ch, this.Page);
                Response.Redirect("~/Teacher/index.aspx", false);
            }
        }
        else
        {
            string ch = "很抱歉您创建的数据库为空,不存在数据表,请仔细查看或请求帮助!";
            LearnSite.Common.WordProcess.Alert(ch, this.Page);
        }
    }
Beispiel #3
0
 /// <summary>
 /// 清除所有缓存
 /// </summary>
 public void ClearCache()
 {
     HttpRuntime.Close();
     Memcached.ClientLibrary.MemcachedClient mc = new Memcached.ClientLibrary.MemcachedClient();
     mc.FlushAll();
     mc.FlushAll();
 }
Beispiel #4
0
        static void Main(string[] args)
        {
            // Create the application host
            object host = ApplicationHost.CreateApplicationHost(typeof(MyHost), "/", "c:\\");

            int request_count = 10;

            SimpleWorkerRequest [] requests = new SimpleWorkerRequest[request_count];

            int pos;

            for (pos = 0; pos != request_count; pos++)
            {
                requests[pos] = new SimpleWorkerRequest("test.aspx", "", Console.Out);
            }

            ModulesConfiguration.Add("syncmodule", typeof(SyncModule).AssemblyQualifiedName);
            ModulesConfiguration.Add("asyncmodule", typeof(AsyncModule).AssemblyQualifiedName);

            HandlerFactoryConfiguration.Add("get", "/", typeof(AsyncHandler).AssemblyQualifiedName);
            //HandlerFactoryConfiguration.Add("get", "/", typeof(SyncHandler).AssemblyQualifiedName);

            for (pos = 0; pos != request_count; pos++)
            {
                HttpRuntime.ProcessRequest(requests[pos]);
            }

            HttpRuntime.Close();

/*
 *                      Console.Write("Press Enter to quit.");
 *                      Console.WriteLine();
 *                      Console.ReadLine();
 */
        }
Beispiel #5
0
        public List <Metadata> GetAll()
        {
            HttpRuntime.Close();
            List <Metadata> allPhotos = new List <Metadata>();

            foreach (var folder in new DirectoryInfo(path).GetDirectories())
            {
                allPhotos.AddRange(recursiveSearch(folder, 0, path));
            }

            return(allPhotos);
        }
Beispiel #6
0
        /// <summary>
        /// 清除所有缓存
        /// </summary>
        public void ClearCache()
        {
            HttpRuntime.Close();

            /*
             * IDictionaryEnumerator mycache = HttpContext.Current.Cache.GetEnumerator();
             * while (mycache.MoveNext())
             * {
             *  HttpContext.Current.Cache.Remove(mycache.Key.ToString());
             * }*/
            Memcached.ClientLibrary.MemcachedClient mc = new Memcached.ClientLibrary.MemcachedClient();
            mc.FlushAll();
        }
Beispiel #7
0
 private void ShutDown()
 {
     try
     {
         lock (SyncRoot)
         {
             Trace.WriteLine("inside shutting down host");
             s_current = null;
             HttpRuntime.Close();
             HttpRuntime.UnloadAppDomain();
         }
     }
     catch (Exception ex)
     {
         Trace.WriteLine("Exception inside unloading HttpRuntime host:" + ex);
     }
 }
Beispiel #8
0
        /// <summary>
        /// Очищает все кэшированные страницы (вызывается после создания, редактирования и удаления поста,
        /// изменения параметров блога)
        /// </summary>
        public static void ClearAppCache()
        {
            // Этот вариант не всегда работает в ASP.NET MVC
            //List<string> toRemove = new List<string>();
            //foreach (DictionaryEntry cache in HttpRuntime.Cache)
            //{
            //    toRemove.Add(cache.Key.ToString()); // Получаем все ключи в кэше
            //}

            //foreach (string key in toRemove)
            //{
            //    HttpRuntime.Cache.Remove(key); // Удаляем элементы кэша
            //}

            // Подходящий вариант для такого приложения,
            // хотя выполняет больше, чем просто очистка кэша
            HttpRuntime.Close();
        }
Beispiel #9
0
        void IRegisteredObject.Stop(bool immediate)
        {
            // Unhook the Host so Server will process the requests in the new appdomain.

            if (_server != null)
            {
                _server.HostStopped();
            }

            // Make sure all the pending calls complete before this Object is unregistered.
            WaitForPendingCallsToFinish();

            HostingEnvironment.UnregisterObject(this);

            Thread.Sleep(100);
            HttpRuntime.Close();
            Thread.Sleep(100);
        }
Beispiel #10
0
        public static void DestroyRuntime(ServletContext context, IJDBCDriverDeregisterer evidence)
        {
            AppDomain servletDomain = (AppDomain)context.getAttribute(J2EEConsts.APP_DOMAIN);

            if (servletDomain == null)
            {
                return;
            }

            try {
                [email protected](servletDomain);
                Debug.WriteLine("Destroy of GhHttpServlet");
                HttpRuntime.Close();
                [email protected](evidence);
                context.removeAttribute(J2EEConsts.APP_DOMAIN);
                try {
                    FactoryFinder.releaseFactories();
                }
                catch (FacesException) { }

                java.lang.ClassLoader appClassLoader = vmw.common.TypeUtils.ToClass(evidence).getClassLoader();

                IJDBCDriverDeregisterer dereg = evidence;

                java.util.Enumeration en = java.sql.DriverManager.getDrivers();
                while (en.hasMoreElements())
                {
                    Object o = en.nextElement();
                    if (vmw.common.TypeUtils.ToClass(o).getClassLoader() == appClassLoader)
                    {
                        dereg.DeregisterDriver((java.sql.Driver)o);
                    }
                }

                java.lang.Thread.currentThread().setContextClassLoader(null);
            }
            catch (Exception e) {
                Debug.WriteLine(String.Format("ERROR in Servlet Destroy {0},{1}", e.GetType(), e.Message));
                Debug.WriteLine(e.StackTrace);
            }
            finally {
                [email protected]();
            }
        }
Beispiel #11
0
 /// <summary>
 /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
 /// </summary>
 public void Dispose()
 {
     HttpRuntime.Close();
 }
Beispiel #12
0
 public static void ClearAllCache()
 {
     HttpRuntime.Close();
 }
Beispiel #13
0
 public void Clear()
 {
     HttpRuntime.Close();
 }
 /// <include file='doc\ISAPIRuntime.uex' path='docs/doc[@for="ISAPIRuntime.StopProcessing"]/*' />
 /// <devdoc>
 ///    <para>[To be supplied.]</para>
 /// </devdoc>
 public void StopProcessing()
 {
     Debug.Trace("ISAPIRuntime", "StopProcessing");
     HttpRuntime.Close();
 }
Beispiel #15
0
        /*
         * Shutdown runtime
         */

        /// <devdoc>
        ///    <para>[To be supplied.]</para>
        /// </devdoc>
        public void StopProcessing()
        {
            ResetStateServerCounters();
            HttpRuntime.Close();
        }
Beispiel #16
0
 public void Close_PermitOnly_Unmanaged()
 {
     HttpRuntime.Close();
 }
Beispiel #17
0
 public void Close_Deny_Unmanaged()
 {
     HttpRuntime.Close();
 }
Beispiel #18
0
 public void Done()
 {
     HttpRuntime.Close();
 }
 public override void Flush()
 {
     // 从缓存中移除所有项
     HttpRuntime.Close();
 }
Beispiel #20
0
 public static void RestartApplication()
 {
     HttpRuntime.Close();
 }
Beispiel #21
0
 public void Close()
 {
     _app = null;
     HttpRuntime.Close();
 }
Beispiel #22
0
 /// <summary>
 /// Beendet die ASP.NET Laufzeitumgebung.
 /// </summary>
 /// <remarks>
 /// Der Aufruf kehrt erst wieder zurück, wenn alle ausstehenden Anfragen bearbeitet
 /// wurden. Neue Anfragen werden nicht angenommen.
 /// </remarks>
 public virtual void Stop() => HttpRuntime.Close();