Esempio n. 1
0
 // Token: 0x06000041 RID: 65 RVA: 0x0000600C File Offset: 0x0000420C
 protected override void View()
 {
     if (this.ispost)
     {
         string mapPath  = FPUtils.GetMapPath(this.webpath + "cache");
         string fileName = Path.GetFileName(FPRequest.Files["uploadfile"].FileName);
         string a        = Path.GetExtension(fileName).ToLower();
         if (a != ".zip")
         {
             this.ShowErr("对不起,该文件不是系统更新文件类型。");
             return;
         }
         if (!Directory.Exists(mapPath))
         {
             Directory.CreateDirectory(mapPath);
         }
         if (File.Exists(mapPath + "\\" + fileName))
         {
             File.Delete(mapPath + "\\" + fileName);
         }
         FPRequest.Files["uploadfile"].SaveAs(mapPath + "\\" + fileName);
         if (Directory.Exists(mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName)))
         {
             Directory.Delete(mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName), true);
         }
         FPZip.UnZipFile(mapPath + "\\" + fileName, "");
         File.Delete(mapPath + "\\" + fileName);
         string mapPath2   = FPUtils.GetMapPath(this.webpath);
         string sourcePath = mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName);
         sysupdate.CopyDirectory(sourcePath, mapPath2);
         Directory.Delete(mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName), true);
         base.Response.Redirect("sysupdate.aspx");
     }
     base.SaveRightURL();
 }
Esempio n. 2
0
        // Token: 0x0600002A RID: 42 RVA: 0x000047AC File Offset: 0x000029AC
        protected override void View()
        {
            string mapPath = FPUtils.GetMapPath(this.webpath + "sites/" + this.m_sitepath);

            if (!File.Exists(mapPath + "\\site.config"))
            {
                this.ShowErr("该站点不存在或已被删除。");
            }
            else
            {
                this.m_siteconfig = SiteConfigs.LoadConfig(mapPath + "\\site.config");
                if (this.ispost)
                {
                    string mapPath2 = FPUtils.GetMapPath(this.webpath + "cache");
                    string fileName = Path.GetFileName(FPRequest.Files["uploadfile"].FileName);
                    string a        = Path.GetExtension(fileName).ToLower();
                    if (a != ".fpsite" && a != ".zip")
                    {
                        this.ShowErr("对不起,该文件不是方配站点更新文件类型。");
                        return;
                    }
                    if (!Directory.Exists(mapPath2))
                    {
                        Directory.CreateDirectory(mapPath2);
                    }
                    if (File.Exists(mapPath2 + "\\" + fileName))
                    {
                        File.Delete(mapPath2 + "\\" + fileName);
                    }
                    FPRequest.Files["uploadfile"].SaveAs(mapPath2 + "\\" + fileName);
                    if (Directory.Exists(mapPath2 + "\\" + Path.GetFileNameWithoutExtension(fileName)))
                    {
                        Directory.Delete(mapPath2 + "\\" + Path.GetFileNameWithoutExtension(fileName), true);
                    }
                    FPZip.UnZipFile(mapPath2 + "\\" + fileName, "");
                    File.Delete(mapPath2 + "\\" + fileName);
                    if (!File.Exists(mapPath2 + "\\" + Path.GetFileNameWithoutExtension(fileName) + "\\site.config"))
                    {
                        Directory.Delete(mapPath2 + "\\" + Path.GetFileNameWithoutExtension(fileName), true);
                        this.ShowErr("站点配置文件不存在或有错误。");
                        return;
                    }
                    SiteConfig siteConfig = SiteConfigs.LoadConfig(mapPath2 + "\\" + Path.GetFileNameWithoutExtension(fileName) + "\\site.config");
                    Version    v          = new Version(FPUtils.StrToDecimal(this.m_siteconfig.version).ToString("0.0"));
                    Version    v2         = new Version(FPUtils.StrToDecimal(siteConfig.version).ToString("0.0"));
                    if (v > v2)
                    {
                        this.ShowErr("对不起,您更新的版本比安装版本还低,不能更新");
                        return;
                    }
                    string mapPath3   = FPUtils.GetMapPath(this.webpath + "sites/" + this.siteconfig.sitepath);
                    string sourcePath = mapPath2 + "\\" + Path.GetFileNameWithoutExtension(fileName);
                    siteupdate.CopyDirectory(sourcePath, mapPath3);
                    Directory.Delete(mapPath2 + "\\" + Path.GetFileNameWithoutExtension(fileName), true);
                    base.Response.Redirect("sitemanage.aspx");
                }
                base.SaveRightURL();
            }
        }
Esempio n. 3
0
 // Token: 0x06000057 RID: 87 RVA: 0x00007994 File Offset: 0x00005B94
 protected override void View()
 {
     this.appinfo = DbHelper.ExecuteModel <AppInfo>(this.appid);
     if (this.appinfo.id == 0)
     {
         this.ShowErr("该应用不存在或已被删除。");
     }
     else
     {
         if (this.ispost)
         {
             string mapPath  = FPUtils.GetMapPath(this.webpath + "cache");
             string fileName = Path.GetFileName(FPRequest.Files["uploadfile"].FileName);
             string a        = Path.GetExtension(fileName).ToLower();
             if (a != ".fpk" && a != ".zip")
             {
                 this.ShowErr("对不起,该文件不是方配系统应用更新文件类型。");
                 return;
             }
             if (!Directory.Exists(mapPath))
             {
                 Directory.CreateDirectory(mapPath);
             }
             if (File.Exists(mapPath + "\\" + fileName))
             {
                 File.Delete(mapPath + "\\" + fileName);
             }
             FPRequest.Files["uploadfile"].SaveAs(mapPath + "\\" + fileName);
             if (Directory.Exists(mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName)))
             {
                 Directory.Delete(mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName), true);
             }
             FPZip.UnZipFile(mapPath + "\\" + fileName, "");
             File.Delete(mapPath + "\\" + fileName);
             if (!File.Exists(mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName) + "\\app.config"))
             {
                 Directory.Delete(mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName), true);
                 this.ShowErr("应用配置文件不存在或有错误。");
                 return;
             }
             AppInfo appInfo = FPSerializer.Load <AppInfo>(mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName) + "\\app.config");
             if (this.appinfo.guid == "")
             {
                 this.ShowErr("对不起,该应用标识码错误,更新失败。");
                 return;
             }
             SqlParam sqlParam = DbHelper.MakeAndWhere("guid", this.appinfo.guid);
             this.appinfo = DbHelper.ExecuteModel <AppInfo>(new SqlParam[]
             {
                 sqlParam
             });
             if (this.appinfo.id == 0)
             {
                 this.ShowErr("对不起,该应用不存在或已被删除。");
                 return;
             }
             Version v  = new Version(FPUtils.StrToDecimal(appInfo.version).ToString("0.0"));
             Version v2 = new Version(FPUtils.StrToDecimal(this.appinfo.version).ToString("0.0"));
             if (v < v2)
             {
                 this.ShowErr("对不起,您更新的版本比安装版本还低,不能更新");
                 return;
             }
             this.appinfo.name    = appInfo.name;
             this.appinfo.version = appInfo.version;
             this.appinfo.notes   = appInfo.notes;
             this.appinfo.author  = appInfo.author;
             string mapPath2   = FPUtils.GetMapPath(this.webpath + this.appinfo.installpath);
             string sourcePath = mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName);
             this.appinfo.files = appupdate.CopyDirectory(sourcePath, mapPath2, "", this.appinfo.files);
             if (DbHelper.ExecuteUpdate <AppInfo>(this.appinfo) > 0)
             {
                 foreach (string strContent in appInfo.sortapps.Split(new char[]
                 {
                     '|'
                 }))
                 {
                     string[] array2 = FPUtils.SplitString(strContent, ",", 4);
                     if (!(array2[0] == ""))
                     {
                         SqlParam[] sqlparams = new SqlParam[]
                         {
                             DbHelper.MakeAndWhere("appid", this.appinfo.id),
                             DbHelper.MakeAndWhere("name", array2[0])
                         };
                         SortAppInfo sortAppInfo = DbHelper.ExecuteModel <SortAppInfo>(sqlparams);
                         if (sortAppInfo.id > 0)
                         {
                             sortAppInfo.name      = array2[0];
                             sortAppInfo.markup    = array2[1];
                             sortAppInfo.indexpage = array2[2];
                             sortAppInfo.viewpage  = array2[3];
                             DbHelper.ExecuteUpdate <SortAppInfo>(sortAppInfo);
                         }
                         else
                         {
                             sortAppInfo.appid     = this.appinfo.id;
                             sortAppInfo.name      = array2[0];
                             sortAppInfo.markup    = array2[1];
                             sortAppInfo.indexpage = array2[2];
                             sortAppInfo.viewpage  = array2[3];
                             DbHelper.ExecuteInsert <SortAppInfo>(sortAppInfo);
                         }
                     }
                 }
             }
             Directory.Delete(mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName), true);
             CacheBll.RemoveSortCache();
             base.Response.Redirect("appmanage.aspx");
         }
         base.SaveRightURL();
     }
 }
Esempio n. 4
0
 // Token: 0x0600001E RID: 30 RVA: 0x00003758 File Offset: 0x00001958
 protected override void View()
 {
     if (this.pluname != "")
     {
         this.pluginconfig             = FPSerializer.Load <PluginConfig>(FPUtils.GetMapPath(this.webpath + "plugins/" + this.pluname + "/plugin.config"));
         this.pluginconfig.installpath = this.pluname;
     }
     if (this.ispost)
     {
         string mapPath  = FPUtils.GetMapPath(this.webpath + "cache");
         string fileName = Path.GetFileName(FPRequest.Files["uploadfile"].FileName);
         string a        = Path.GetExtension(fileName).ToLower();
         if (a != ".plu" && a != ".zip")
         {
             this.ShowErr("对不起,该文件不是方配系统插件更新文件类型。");
         }
         else
         {
             if (!Directory.Exists(mapPath))
             {
                 Directory.CreateDirectory(mapPath);
             }
             if (File.Exists(mapPath + "\\" + fileName))
             {
                 File.Delete(mapPath + "\\" + fileName);
             }
             FPRequest.Files["uploadfile"].SaveAs(mapPath + "\\" + fileName);
             if (Directory.Exists(mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName)))
             {
                 Directory.Delete(mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName), true);
             }
             FPZip.UnZipFile(mapPath + "\\" + fileName, "");
             File.Delete(mapPath + "\\" + fileName);
             if (!File.Exists(mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName) + "\\plugin.config"))
             {
                 Directory.Delete(mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName), true);
                 this.ShowErr("插件配置文件不存在或有错误。");
             }
             else
             {
                 PluginConfig pluginConfig = FPSerializer.Load <PluginConfig>(mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName) + "\\plugin.config");
                 if (pluginConfig.guid == "")
                 {
                     this.ShowErr("对不起,该插件标识码错误,更新失败。");
                 }
                 else
                 {
                     Version v  = new Version(FPUtils.StrToDecimal(pluginConfig.version).ToString("0.0"));
                     Version v2 = new Version(FPUtils.StrToDecimal(this.pluginconfig.version).ToString("0.0"));
                     if (v < v2)
                     {
                         this.ShowErr("对不起,您更新的版本比安装版本还低,不能更新");
                     }
                     else
                     {
                         string mapPath2   = FPUtils.GetMapPath(this.webpath + "plugins/" + pluginConfig.installpath);
                         string sourcePath = mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName);
                         pluginupdate.CopyDirectory(sourcePath, mapPath2);
                         Directory.Delete(mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName), true);
                         base.Response.Redirect("pluginmanage.aspx");
                     }
                 }
             }
         }
     }
 }
Esempio n. 5
0
 // Token: 0x06000068 RID: 104 RVA: 0x000093E8 File Offset: 0x000075E8
 protected override void View()
 {
     if (this.ispost)
     {
         string mapPath = FPUtils.GetMapPath(this.webpath + "cache");
         if (this.step == "step1")
         {
             this.filename = Path.GetFileName(FPRequest.Files["uploadfile"].FileName);
             string a = Path.GetExtension(this.filename).ToLower();
             if (a != ".zip" && a != ".fpsite")
             {
                 this.ShowErr("该文件不是方配站点安装文件类型");
                 return;
             }
             if (!Directory.Exists(mapPath))
             {
                 Directory.CreateDirectory(mapPath);
             }
             if (File.Exists(mapPath + "\\" + this.filename))
             {
                 File.Delete(mapPath + "\\" + this.filename);
             }
             FPRequest.Files["uploadfile"].SaveAs(mapPath + "\\" + this.filename);
             if (Directory.Exists(mapPath + "\\" + Path.GetFileNameWithoutExtension(this.filename)))
             {
                 Directory.Delete(mapPath + "\\" + Path.GetFileNameWithoutExtension(this.filename), true);
             }
             FPZip.UnZipFile(mapPath + "\\" + this.filename, "");
             File.Delete(mapPath + "\\" + this.filename);
             if (!File.Exists(mapPath + "\\" + Path.GetFileNameWithoutExtension(this.filename) + "\\site.config"))
             {
                 string mapPath2   = FPUtils.GetMapPath(this.webpath + "sites");
                 string sourcePath = mapPath + "\\" + Path.GetFileNameWithoutExtension(this.filename);
                 siteinstall.CopyDirectory(sourcePath, mapPath2);
                 Directory.Delete(mapPath + "\\" + Path.GetFileNameWithoutExtension(this.filename), true);
                 base.Response.Redirect("sitemanage.aspx");
             }
             else
             {
                 this.siteinfo = SiteConfigs.LoadConfig(mapPath + "\\" + Path.GetFileNameWithoutExtension(this.filename) + "\\site.config");
             }
         }
         else if (this.step == "step2")
         {
             string text = FPRequest.GetString("installpath").ToLower();
             if (text == "")
             {
                 this.ShowErr("安装目录不能为空。");
                 return;
             }
             this.filename          = FPRequest.GetString("filename");
             this.siteinfo          = SiteConfigs.LoadConfig(mapPath + "\\" + Path.GetFileNameWithoutExtension(this.filename) + "\\site.config");
             this.siteinfo.sitepath = text;
             string mapPath2    = FPUtils.GetMapPath(this.webpath + "sites/" + this.siteinfo.sitepath);
             string sourcePath2 = mapPath + "\\" + Path.GetFileNameWithoutExtension(this.filename);
             siteinstall.CopyDirectory(sourcePath2, mapPath2);
             Directory.Delete(mapPath + "\\" + Path.GetFileNameWithoutExtension(this.filename), true);
             base.Response.Redirect("sitemanage.aspx");
         }
     }
     base.SaveRightURL();
 }
Esempio n. 6
0
 // Token: 0x06000021 RID: 33 RVA: 0x00003C60 File Offset: 0x00001E60
 protected override void View()
 {
     if (this.ispost)
     {
         string mapPath  = FPUtils.GetMapPath(this.webpath + "cache");
         string fileName = Path.GetFileName(FPRequest.Files["uploadfile"].FileName);
         string a        = Path.GetExtension(fileName).ToLower();
         if (a != ".task")
         {
             this.ShowErr("对不起,该文件不是方配系统任务安装文件类型。");
         }
         else
         {
             if (!Directory.Exists(mapPath))
             {
                 Directory.CreateDirectory(mapPath);
             }
             if (File.Exists(mapPath + "\\" + fileName))
             {
                 File.Delete(mapPath + "\\" + fileName);
             }
             FPRequest.Files["uploadfile"].SaveAs(mapPath + "\\" + fileName);
             if (Directory.Exists(mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName)))
             {
                 Directory.Delete(mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName), true);
             }
             FPZip.UnZipFile(mapPath + "\\" + fileName, "");
             File.Delete(mapPath + "\\" + fileName);
             if (!File.Exists(mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName) + "\\task.config"))
             {
                 Directory.Delete(mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName), true);
                 this.ShowErr("应用配置文件不存在或有错误。");
             }
             else
             {
                 TaskInfo taskInfo = FPSerializer.Load <TaskInfo>(mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName) + "\\task.config");
                 if (taskInfo.key == "")
                 {
                     taskInfo.key = Guid.NewGuid().ToString();
                 }
                 SqlParam sqlParam  = DbHelper.MakeAndWhere("key", taskInfo.key);
                 TaskInfo taskInfo2 = DbHelper.ExecuteModel <TaskInfo>(new SqlParam[]
                 {
                     sqlParam
                 });
                 if (taskInfo2.id > 0)
                 {
                     taskInfo2.type = taskInfo.type;
                     taskInfo2.name = taskInfo.name;
                     DbHelper.ExecuteUpdate <TaskInfo>(taskInfo2);
                 }
                 else
                 {
                     DbHelper.ExecuteInsert <TaskInfo>(taskInfo);
                 }
                 DirectoryInfo directoryInfo = new DirectoryInfo(mapPath + "\\" + Path.GetFileNameWithoutExtension(fileName));
                 foreach (FileInfo fileInfo in directoryInfo.GetFiles())
                 {
                     if (fileInfo.Extension == ".dll")
                     {
                         fileInfo.CopyTo(FPUtils.GetMapPath(WebConfig.WebPath + "bin/" + fileInfo.Name), true);
                     }
                 }
                 base.Response.Redirect("taskmanage.aspx");
             }
         }
     }
 }
Esempio n. 7
0
        // Token: 0x0600027C RID: 636 RVA: 0x00008E34 File Offset: 0x00007034
        public static string RestoreDatabase(string backupfile)
        {
            string result;

            if (!File.Exists(backupfile))
            {
                result = "备份文件已不存在。";
            }
            else
            {
                DbConfigInfo dbConfig = DbConfigs.GetDbConfig();
                if (dbConfig.dbtype == FangPage.Data.DbType.SqlServer)
                {
                    SQLServer sqlserver = new SQLServerClass();
                    if (Path.GetExtension(backupfile) == ".zip" || Path.GetExtension(backupfile) == ".config")
                    {
                        FPZip.UnZipFile(backupfile, "");
                    }
                    backupfile = string.Concat(new string[]
                    {
                        Path.GetDirectoryName(backupfile),
                        "\\",
                        Path.GetFileName(backupfile),
                        "\\",
                        dbConfig.dbname,
                        ".bak"
                    });
                    if (!File.Exists(backupfile))
                    {
                        return("备份文件已不存在。");
                    }
                    try
                    {
                        sqlserver.Connect(dbConfig.dbpath, dbConfig.userid, dbConfig.password);
                        QueryResults queryResults = sqlserver.EnumProcesses(-1);
                        int          num          = -1;
                        int          num2         = -1;
                        for (int i = 1; i <= queryResults.Columns; i++)
                        {
                            string text = queryResults.get_ColumnName(i);
                            if (text.ToUpper().Trim() == "SPID")
                            {
                                num = i;
                            }
                            else if (text.ToUpper().Trim() == "DBNAME")
                            {
                                num2 = i;
                            }
                            if (num != -1 && num2 != -1)
                            {
                                break;
                            }
                        }
                        for (int i = 1; i <= queryResults.Rows; i++)
                        {
                            int    columnLong   = queryResults.GetColumnLong(i, num);
                            string columnString = queryResults.GetColumnString(i, num2);
                            if (columnString.ToUpper() == dbConfig.dbname.ToUpper())
                            {
                                sqlserver.KillProcess(columnLong);
                            }
                        }
                        ((_Restore) new RestoreClass
                        {
                            Action = SQLDMO_RESTORE_TYPE.SQLDMORestore_Database,
                            Files = backupfile,
                            Database = dbConfig.dbname,
                            ReplaceDatabase = true
                        }).SQLRestore(sqlserver);
                        File.Delete(backupfile);
                        return(string.Empty);
                    }
                    catch (Exception ex)
                    {
                        return(ex.Message);
                    }
                    finally
                    {
                        sqlserver.DisConnect();
                    }
                }
                string mapPath = FPUtils.GetMapPath(WebConfig.WebPath + Path.GetDirectoryName(dbConfig.dbpath));
                try
                {
                    if (!Directory.Exists(mapPath))
                    {
                        Directory.CreateDirectory(mapPath);
                    }
                    if (Path.GetExtension(backupfile) == ".zip" || Path.GetExtension(backupfile) == ".config")
                    {
                        FPZip.UnZipFile(backupfile, mapPath);
                    }
                    else
                    {
                        File.Copy(backupfile, mapPath + "\\" + dbConfig.dbname);
                    }
                    result = string.Empty;
                }
                catch (Exception ex)
                {
                    result = ex.Message;
                }
            }
            return(result);
        }
Esempio n. 8
0
 // Token: 0x06000025 RID: 37 RVA: 0x00004088 File Offset: 0x00002288
 protected override void View()
 {
     if (this.ispost)
     {
         string mapPath = FPUtils.GetMapPath(this.webpath + "cache");
         if (this.step == "step1")
         {
             this.filename = Path.GetFileName(FPRequest.Files["uploadfile"].FileName);
             string a = Path.GetExtension(this.filename).ToLower();
             if (a != ".zip" && a != ".plu")
             {
                 this.ShowErr("该文件不是方配WMS系统插件安装文件类型");
                 return;
             }
             if (!Directory.Exists(mapPath))
             {
                 Directory.CreateDirectory(mapPath);
             }
             if (File.Exists(mapPath + "\\" + this.filename))
             {
                 File.Delete(mapPath + "\\" + this.filename);
             }
             FPRequest.Files["uploadfile"].SaveAs(mapPath + "\\" + this.filename);
             if (Directory.Exists(mapPath + "\\" + Path.GetFileNameWithoutExtension(this.filename)))
             {
                 Directory.Delete(mapPath + "\\" + Path.GetFileNameWithoutExtension(this.filename), true);
             }
             FPZip.UnZipFile(mapPath + "\\" + this.filename, "");
             File.Delete(mapPath + "\\" + this.filename);
             if (!File.Exists(mapPath + "\\" + Path.GetFileNameWithoutExtension(this.filename) + "\\plugin.config"))
             {
                 Directory.Delete(mapPath + "\\" + Path.GetFileNameWithoutExtension(this.filename), true);
                 this.ShowErr("插件安装配置文件不存在。");
                 return;
             }
             this.plugininfo = FPSerializer.Load <PluginConfig>(mapPath + "\\" + Path.GetFileNameWithoutExtension(this.filename) + "\\plugin.config");
             if (this.plugininfo.guid == "")
             {
                 this.ShowErr("对不起,该插件安装标识码不能为空。");
                 return;
             }
         }
         else if (this.step == "step2")
         {
             string @string = FPRequest.GetString("installpath");
             if (@string == "")
             {
                 this.ShowErr("安装目录不能为空。");
                 return;
             }
             this.filename               = FPRequest.GetString("filename");
             this.plugininfo             = FPSerializer.Load <PluginConfig>(mapPath + "\\" + Path.GetFileNameWithoutExtension(this.filename) + "\\plugin.config");
             this.plugininfo.installpath = @string;
             string mapPath2   = FPUtils.GetMapPath(this.webpath + "plugins/" + this.plugininfo.installpath);
             string sourcePath = mapPath + "\\" + Path.GetFileNameWithoutExtension(this.filename);
             plugininstall.CopyDirectory(sourcePath, mapPath2);
             Directory.Delete(mapPath + "\\" + Path.GetFileNameWithoutExtension(this.filename), true);
             base.Response.Redirect("pluginmanage.aspx");
         }
     }
     base.SaveRightURL();
 }
Esempio n. 9
0
 // Token: 0x06000050 RID: 80 RVA: 0x00006B80 File Offset: 0x00004D80
 protected override void View()
 {
     if (this.ispost)
     {
         string mapPath = FPUtils.GetMapPath(this.webpath + "cache");
         if (this.step == "step1")
         {
             this.filename = Path.GetFileName(FPRequest.Files["uploadfile"].FileName);
             string a = Path.GetExtension(this.filename).ToLower();
             if (a != ".fpk" && a != ".zip")
             {
                 this.ShowErr("该文件不是方配站点应用安装文件类型");
                 return;
             }
             if (!Directory.Exists(mapPath))
             {
                 Directory.CreateDirectory(mapPath);
             }
             if (File.Exists(mapPath + "\\" + this.filename))
             {
                 File.Delete(mapPath + "\\" + this.filename);
             }
             FPRequest.Files["uploadfile"].SaveAs(mapPath + "\\" + this.filename);
             if (Directory.Exists(mapPath + "\\" + Path.GetFileNameWithoutExtension(this.filename)))
             {
                 Directory.Delete(mapPath + "\\" + Path.GetFileNameWithoutExtension(this.filename), true);
             }
             FPZip.UnZipFile(mapPath + "\\" + this.filename, "");
             File.Delete(mapPath + "\\" + this.filename);
             if (!File.Exists(mapPath + "\\" + Path.GetFileNameWithoutExtension(this.filename) + "\\app.config"))
             {
                 Directory.Delete(mapPath + "\\" + Path.GetFileNameWithoutExtension(this.filename), true);
                 this.ShowErr("应用安装配置文件不存在。");
                 return;
             }
             this.appinfo = FPSerializer.Load <AppInfo>(mapPath + "\\" + Path.GetFileNameWithoutExtension(this.filename) + "\\app.config");
             if (this.appinfo.guid == "")
             {
                 this.ShowErr("对不起,该应用安装标识码不能为空。");
                 return;
             }
             SqlParam sqlParam = DbHelper.MakeAndWhere("guid", this.appinfo.guid);
             if (DbHelper.ExecuteCount <AppInfo>(new SqlParam[]
             {
                 sqlParam
             }) > 0)
             {
                 this.ShowErr("对不起,该应用已安装,不能重复安装。");
                 return;
             }
         }
         else if (this.step == "step2")
         {
             this.filename = FPRequest.GetString("filename");
             this.appinfo  = FPSerializer.Load <AppInfo>(mapPath + "\\" + Path.GetFileNameWithoutExtension(this.filename) + "\\app.config");
             if (this.appinfo.name == "")
             {
                 this.appinfo.name = "无应用名称";
             }
             if (FPRequest.GetString("installpath") == "")
             {
                 this.ShowErr("对不起,安装目录不能为空");
                 return;
             }
             this.appinfo.installpath = FPRequest.GetString("installpath");
             if (!Directory.Exists(FPUtils.GetMapPath(this.webpath + this.appinfo.installpath)))
             {
                 Directory.CreateDirectory(FPUtils.GetMapPath(this.webpath + this.appinfo.installpath));
             }
             string mapPath2   = FPUtils.GetMapPath(this.webpath + this.appinfo.installpath);
             string sourcePath = mapPath + "\\" + Path.GetFileNameWithoutExtension(this.filename);
             this.appinfo.files = this.CopyDirectory(sourcePath, mapPath2, "");
             this.appinfo.id    = DbHelper.ExecuteInsert <AppInfo>(this.appinfo);
             if (this.appinfo.id > 0)
             {
                 foreach (string strContent in this.appinfo.sortapps.Split(new char[]
                 {
                     '|'
                 }))
                 {
                     string[] array2 = FPUtils.SplitString(strContent, ",", 4);
                     if (!(array2[0] == ""))
                     {
                         DbHelper.ExecuteInsert <SortAppInfo>(new SortAppInfo
                         {
                             appid       = this.appinfo.id,
                             name        = array2[0],
                             markup      = array2[1],
                             indexpage   = array2[2],
                             viewpage    = array2[3],
                             installpath = this.appinfo.installpath
                         });
                     }
                 }
             }
             Directory.Delete(mapPath + "\\" + Path.GetFileNameWithoutExtension(this.filename), true);
             CacheBll.RemoveSortCache();
             base.Response.Redirect("appmanage.aspx");
         }
     }
     base.SaveRightURL();
 }