Exemple #1
0
        // Token: 0x06000051 RID: 81 RVA: 0x000070C8 File Offset: 0x000052C8
        private string CopyDirectory(string sourcePath, string targetPath, string vpath)
        {
            string        text          = "";
            DirectoryInfo directoryInfo = new DirectoryInfo(sourcePath);

            if (!Directory.Exists(targetPath))
            {
                Directory.CreateDirectory(targetPath);
            }
            foreach (FileInfo fileInfo in directoryInfo.GetFiles())
            {
                if (text != "")
                {
                    text += ",";
                }
                if (fileInfo.Extension == ".dll")
                {
                    fileInfo.CopyTo(FPUtils.GetMapPath(WebConfig.WebPath + "bin/" + fileInfo.Name), true);
                    text = text + "bin/" + fileInfo.Name;
                }
                else if (fileInfo.Extension == ".sql")
                {
                    fileInfo.CopyTo(targetPath + "\\" + fileInfo.Name, true);
                    if (fileInfo.Name.ToLower().EndsWith("access.sql") && DbConfigs.DbType == DbType.Access)
                    {
                        string sqlstring = FPFile.ReadFile(fileInfo.FullName);
                        DbHelper.ExecuteSql(sqlstring);
                    }
                    else if (fileInfo.Name.ToLower().EndsWith("sqlserver.sql") && DbConfigs.DbType == DbType.SqlServer)
                    {
                        string sqlstring = FPFile.ReadFile(fileInfo.FullName);
                        DbHelper.ExecuteSql(sqlstring);
                    }
                    text = text + vpath + fileInfo.Name;
                }
                else
                {
                    fileInfo.CopyTo(targetPath + "\\" + fileInfo.Name, true);
                    text = text + vpath + fileInfo.Name;
                }
            }
            foreach (DirectoryInfo directoryInfo2 in directoryInfo.GetDirectories())
            {
                string text2 = this.CopyDirectory(directoryInfo2.FullName, targetPath + "\\" + directoryInfo2.Name, vpath + directoryInfo2.Name + "/");
                if (text2 != "")
                {
                    if (text != "")
                    {
                        text += ",";
                    }
                    text += text2;
                }
            }
            return(text);
        }
Exemple #2
0
        // Token: 0x06000046 RID: 70 RVA: 0x00006508 File Offset: 0x00004708
        protected override void View()
        {
            string mapPath = FPUtils.GetMapPath(this.webpath + "cache/tasklog.config");

            this.logcontent = FPFile.ReadFile(mapPath);
            if (this.ispost)
            {
                this.logcontent = FPRequest.GetString("logcontent");
                FPFile.WriteFile(mapPath, this.logcontent);
            }
            base.SaveRightURL();
        }
Exemple #3
0
        // Token: 0x0600001F RID: 31 RVA: 0x00003A68 File Offset: 0x00001C68
        public static void CopyDirectory(string sourcePath, string targetPath)
        {
            DirectoryInfo directoryInfo = new DirectoryInfo(sourcePath);

            if (!Directory.Exists(targetPath))
            {
                Directory.CreateDirectory(targetPath);
            }
            foreach (FileInfo fileInfo in directoryInfo.GetFiles())
            {
                if (fileInfo.Extension == ".dll")
                {
                    fileInfo.CopyTo(FPUtils.GetMapPath(WebConfig.WebPath + "bin/" + fileInfo.Name), true);
                    fileInfo.CopyTo(targetPath + "\\" + fileInfo.Name, true);
                }
                else if (fileInfo.Extension == ".sql")
                {
                    fileInfo.CopyTo(targetPath + "\\" + fileInfo.Name, true);
                    if (fileInfo.Name.ToLower().EndsWith("access.sql") && DbConfigs.DbType == DbType.Access)
                    {
                        string sqlstring = FPFile.ReadFile(fileInfo.FullName);
                        DbHelper.ExecuteSql(sqlstring);
                    }
                    else if (fileInfo.Name.ToLower().EndsWith("sqlserver.sql") && DbConfigs.DbType == DbType.SqlServer)
                    {
                        string sqlstring = FPFile.ReadFile(fileInfo.FullName);
                        DbHelper.ExecuteSql(sqlstring);
                    }
                }
                else
                {
                    fileInfo.CopyTo(targetPath + "\\" + fileInfo.Name, true);
                }
            }
            foreach (DirectoryInfo directoryInfo2 in directoryInfo.GetDirectories())
            {
                pluginupdate.CopyDirectory(directoryInfo2.FullName, targetPath + "\\" + directoryInfo2.Name);
            }
        }
Exemple #4
0
 // Token: 0x06000006 RID: 6 RVA: 0x000023A8 File Offset: 0x000005A8
 protected override void View()
 {
     this.link = "dbreset.aspx";
     if (this.ispost)
     {
         if (DbConfigs.DbType == FangPage.Data.DbType.Access)
         {
             this.ShowErr("对不起,本操作不支持Access数据库版本,请安装SqlServer版本。");
             return;
         }
         if (this.action == "table")
         {
             string @string = FPRequest.GetString("tablename");
             if (string.IsNullOrEmpty(@string))
             {
                 this.ShowErr("没有选择要重置的表。");
                 return;
             }
             string   text  = "";
             string[] array = FPUtils.SplitString(FPFile.ReadFile(FPUtils.GetMapPath("sqlreset.sql")), "GO\r\n", 8);
             string   text2 = "";
             foreach (string text3 in FPUtils.SplitString(@string))
             {
                 if (text != "")
                 {
                     text += "GO\r\n";
                 }
                 text = text + "TRUNCATE TABLE " + text3;
                 if (text3.EndsWith("WMS_UserInfo"))
                 {
                     if (text2 != "")
                     {
                         text2 += "GO\r\n";
                     }
                     text2 += array[0];
                 }
                 else if (text3.EndsWith("WMS_UserGrade"))
                 {
                     if (text2 != "")
                     {
                         text2 += "GO\r\n";
                     }
                     text2 += array[1];
                 }
                 else if (text3.EndsWith("WMS_RoleInfo"))
                 {
                     if (text2 != "")
                     {
                         text2 += "GO\r\n";
                     }
                     text2 += array[2];
                 }
                 else if (text3.EndsWith("WMS_Permission"))
                 {
                     if (text2 != "")
                     {
                         text2 += "GO\r\n";
                     }
                     text2 += array[3];
                 }
                 else if (text3.EndsWith("WMS_MenuInfo"))
                 {
                     if (text2 != "")
                     {
                         text2 += "GO\r\n";
                     }
                     text2 += array[4];
                 }
                 else if (text3.EndsWith("WMS_DesktopInfo"))
                 {
                     if (text2 != "")
                     {
                         text2 += "GO\r\n";
                     }
                     text2 += array[5];
                 }
                 else if (text3.EndsWith("WMS_ChannelInfo"))
                 {
                     if (text2 != "")
                     {
                         text2 += "GO\r\n";
                     }
                     text2 += array[6];
                 }
                 else if (text3.EndsWith("WMS_AttachType"))
                 {
                     if (text2 != "")
                     {
                         text2 += "GO\r\n";
                     }
                     text2 += array[7];
                 }
             }
             if (text2 != "")
             {
                 if (text != "")
                 {
                     text += "GO\r\n";
                 }
                 text += text2;
             }
             DbHelper.ExecuteSql(text);
         }
         else if (this.action == "system")
         {
             this.dbtablelist = DbHelper.GetDbTableList();
             string text = "";
             foreach (object obj in this.dbtablelist.Rows)
             {
                 DataRow dataRow = (DataRow)obj;
                 if (dataRow["TABLE_NAME"].ToString().StartsWith(DbConfigs.Prefix))
                 {
                     if (text != "")
                     {
                         text += "|";
                     }
                     text = text + "TRUNCATE TABLE " + dataRow["TABLE_NAME"].ToString();
                 }
             }
             DbHelper.ExecuteSql(text);
             text = FPFile.ReadFile(FPUtils.GetMapPath("sqlreset.sql")).Replace("|", "");
             DbHelper.ExecuteSql(text);
             this.link = this.adminpath + "logout.aspx";
         }
     }
     this.dbtablelist = DbHelper.GetDbTableList();
     base.SaveRightURL();
 }
Exemple #5
0
 // Token: 0x06000053 RID: 83 RVA: 0x00007374 File Offset: 0x00005574
 protected override void View()
 {
     if (this.ispost)
     {
         if (!this.isperm)
         {
             this.ShowErr("对不起,您没有权限操作。");
             return;
         }
         int     @int    = FPRequest.GetInt("appid");
         AppInfo appInfo = DbHelper.ExecuteModel <AppInfo>(@int);
         string  mapPath = FPUtils.GetMapPath(this.webpath + appInfo.installpath);
         if (this.action == "delete")
         {
             if (DbHelper.ExecuteDelete <AppInfo>(@int) > 0)
             {
                 foreach (string text in FPUtils.SplitString(appInfo.files))
                 {
                     if (text.StartsWith("bin/"))
                     {
                         if (File.Exists(FPUtils.GetMapPath(WebConfig.WebPath + text)))
                         {
                             File.Delete(FPUtils.GetMapPath(WebConfig.WebPath + text));
                         }
                     }
                     if (File.Exists(mapPath + "/" + text))
                     {
                         if (text.EndsWith(".sql"))
                         {
                             if (text.ToLower().EndsWith("access_un.sql") && DbConfigs.DbType == DbType.Access)
                             {
                                 string sqlstring = FPFile.ReadFile(mapPath + "/" + text);
                                 DbHelper.ExecuteSql(sqlstring);
                             }
                             else if (text.ToLower().EndsWith("sqlserver_un.sql") && DbConfigs.DbType == DbType.SqlServer)
                             {
                                 string sqlstring = FPFile.ReadFile(mapPath + "/" + text);
                                 DbHelper.ExecuteSql(sqlstring);
                             }
                         }
                         File.Delete(mapPath + "/" + text);
                     }
                 }
                 if (Directory.Exists(mapPath))
                 {
                     DirectoryInfo directoryInfo = new DirectoryInfo(mapPath);
                     if (directoryInfo.GetFiles().Length == 0)
                     {
                         directoryInfo.Delete(true);
                     }
                 }
                 SqlParam sqlParam = DbHelper.MakeAndWhere("appid", @int);
                 DbHelper.ExecuteDelete <SortAppInfo>(new SqlParam[]
                 {
                     sqlParam
                 });
             }
             FPCache.Remove("FP_SORTTREE");
             base.Response.Redirect("appmanage.aspx");
         }
     }
     this.applist = DbHelper.ExecuteList <AppInfo>(OrderBy.ASC);
     base.SaveRightURL();
 }