Ejemplo n.º 1
0
        public ActionResult RestartWebApplication()
        {
            X.Storage.IStorage storage = new X.Storage.StorageManager("", "");

            try
            {
                var bytes     = storage.Download("web.config");
                var localPath = Path.GetTempFileName();
                System.IO.File.WriteAllBytes(localPath, bytes);
                System.IO.File.SetLastAccessTime(localPath, DateTime.Now);
                storage.Upload(System.IO.File.ReadAllBytes(localPath), "web.config");

                return(Content("OK"));
            }
            catch (Exception ex)
            {
                return(Content(ex.Message));
            }
        }
Ejemplo n.º 2
0
        public ActionResult RestartWebApplication()
        {
            X.Storage.IStorage storage = new X.Storage.StorageManager("", "");

            try
            {
                var bytes = storage.Download("web.config");
                var localPath = Path.GetTempFileName();
                System.IO.File.WriteAllBytes(localPath, bytes);
                System.IO.File.SetLastAccessTime(localPath, DateTime.Now);
                storage.Upload(System.IO.File.ReadAllBytes(localPath), "web.config");

                return Content("OK");
            }
            catch (Exception ex)
            {
                return Content(ex.Message);
            }
        }