示例#1
0
        //public IActionResult LogManage()
        //{
        //    return View();
        //}
        public IActionResult TxtLog()
        {
            DataTable dt = FileSystemObject.GetDirectoryInfos(function.VToP(GetLogPath()), FsoMethod.File);

            dt.DefaultView.Sort = "CreateTime DESC";
            return(View(dt));
        }
        private DataTable GetDirAndFileList()
        {
            DataTable dt = new DataTable();

            siteName = Server.HtmlEncode(Request.QueryString["siteName"]);
            if (string.IsNullOrEmpty(Request.QueryString["index"]) || !Int32.TryParse(Request.QueryString["index"], out index)) //如果转换失败
            {
                function.WriteErrMsg("站点不存在<a href='Default.aspx' style='margin-left:10px;'>点击返回</a>");
            }
            try
            {
                rootPath = iis.Sites[siteName].Applications[0].VirtualDirectories[index].PhysicalPath;
                string path = rootPath;
                if (!string.IsNullOrEmpty(Request.QueryString["PPath"]))
                {
                    PPath = Request.QueryString["PPath"]; path += Request.QueryString["PPath"];
                }
                dt = FileSystemObject.GetDirectoryInfos(@path, FsoMethod.All);
                dt.Columns.Add("PartPath", typeof(string));
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    dt.Rows[i]["PartPath"] = dt.Rows[i]["FullPath"].ToString().Remove(0, path.Length);
                }
            }
            catch { Response.Write("目录不存在<a href='Default.aspx' style='margin-left:10px;'>点击返回</a>"); Response.Flush(); Response.End(); }
            return(dt);
        }
示例#3
0
        private void InitTreeNode(TreeNodeCollection Nds, string UpDir)
        {
            string AbsPath = this.AppPath + UpDir + "/";

            AbsPath = AbsPath.Replace("/", @"\");
            AbsPath = AbsPath.Replace(@"\\", @"\");
            TreeNode  tmpNd;
            string    search = "UploadFile.aspx?Dir=";
            DataTable dt     = FileSystemObject.GetDirectoryInfos(AbsPath, FsoMethod.Folder);

            foreach (DataRow dr in dt.Rows)
            {
                tmpNd = new TreeNode();
                string objPath = UpDir + "/" + dr["Name"].ToString();
                tmpNd.Value       = dr["Name"].ToString();
                tmpNd.Text        = dr["Name"].ToString();
                tmpNd.NavigateUrl = search + base.Server.UrlEncode(objPath);
                tmpNd.Target      = "main_right";
                Nds.Add(tmpNd);
                string NextDir = UpDir + "/" + tmpNd.Value;
                string aPath   = this.AppPath + NextDir + "/";
                aPath = aPath.Replace("/", @"\");
                aPath = aPath.Replace(@"\\", @"\");
                if (FileSystemObject.GetDirectoryInfos(aPath, FsoMethod.Folder).Rows.Count > 0)
                {
                    InitTreeNode(tmpNd.ChildNodes, NextDir);
                }
            }
        }
示例#4
0
        private void MyBind()
        {
            DataTable dt = FileSystemObject.GetDirectoryInfos(function.VToP(GetLogPath()), FsoMethod.File);

            dt.DefaultView.Sort = "CreateTime DESC";
            EGV.DataSource      = dt.DefaultView.ToTable();
            EGV.DataBind();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            B_Admin badmin = new B_Admin();

            if (!B_ARoleAuth.Check(ZLEnum.Auth.label, "TemplateManage"))
            {
                function.WriteErrMsg(Resources.L.没有权限进行此项操作);
            }
            if (!IsPostBack)
            {
                GetBread();
                //UrlReferer = "TemplateManage.aspx?setTemplate=" + Server.UrlEncode(TemplateDir) + "&Dir=" + Server.UrlEncode(CurDir);
                //if (string.IsNullOrEmpty(CurDir))
                //{
                //    lblDir.Text = "/";
                //    LitParentDirLink.Text = "<a disabled='disabled'><i class='fa fa-arrow-circle-up' style='color:#4586BD;'></i>"+Resources.L.返回上一级 + "</a>";
                //}
                //else
                //{
                //    string pdir = "";
                //    lblDir.Text = CurDir;
                //    if (CurDir.LastIndexOf("/") > 0)
                //    {
                //        pdir = CurDir.Remove(CurDir.LastIndexOf("/"), CurDir.Length - CurDir.LastIndexOf("/"));
                //    }
                //    LitParentDirLink.Text = "<a href=\"TemplateManage.aspx?setTemplate=" + Server.UrlEncode(TemplateDir) + "&Dir=" + pdir + "\"><i class='fa fa-arrow-circle-up' style='color:#4586BD;'></i>" + Resources.L.返回上一级 + "</a>";
                //}
                DataTable fileList = FileSystemObject.GetDirectoryInfos(PPathDir, FsoMethod.All);
                fileList.DefaultView.RowFilter = "name<>'配置库' and name<>'标签库' and name<>'节点库' and name<>'模型库' and name<>'style' and name<>'.svn' and name<>'Thumbs.db'";
                repFile.DataSource             = fileList;
                repFile.DataBind();
                Page.DataBind();
                DataTable filedt = fileList.DefaultView.ToTable();
                DataRow[] dr     = filedt.Select("name='全站首页.html'");
                if (dr.Length > 0)
                {
                    ViewEdit_A.HRef = customPath2 + "Template/Design.aspx?vpath=" + HttpUtility.UrlEncode(function.PToV(dr[0]["FullPath"].ToString()));
                }
                else
                {
                    dr = filedt.Select("name LIKE '%.html%'");
                    if (dr.Length > 0)
                    {
                        Random rd = new Random();
                        ViewEdit_A.HRef = customPath2 + "Template/Design.aspx?vpath=" + HttpUtility.UrlEncode(function.PToV(dr[rd.Next(dr.Length)]["FullPath"].ToString()));
                    }
                    else
                    {
                        ViewEdit_A.HRef = "#";
                    }
                }
                Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "Main.aspx'>" + Resources.L.工作台 + "</a></li><li><a href='TemplateSet.aspx'>" + Resources.L.模板风格 + "</a></li><li class='active'><a href='TemplateManage.aspx'>模板列表</a></li><li>[<a href='TemplateEdit.aspx' style='color:red'>" + Resources.L.新建模板 + "</a>]</li>" + Call.GetHelp(20));
            }
        }
示例#6
0
        protected void MyBind()
        {
            string    pdir    = function.VToP(VDir);
            DataTable filesDT = FileSystemObject.GetDirectoryInfos(pdir, FsoMethod.All);

            filesDT.DefaultView.RowFilter = "name<>'配置库' and name<>'标签库' and name<>'节点库' and name<>'模型库' and name <>'style' and (name like '%.htm%' OR ExName='FileFolder')";
            filesDT        = filesDT.DefaultView.ToTable();
            RPT.DataSource = filesDT;
            RPT.DataBind();
            GetBread();
        }
示例#7
0
        protected void BindData()
        {
            string str2 = this.m_ConfigUploadDir + base.Request.QueryString["Dir"];

            if (string.IsNullOrEmpty(this.TxtSearchKeyword.Text))
            {
                this.RptFiles.DataSource = FileSystemObject.GetDirectoryInfos(base.Request.PhysicalApplicationPath + str2, FsoMethod.All);
            }
            else
            {
                this.RptFiles.DataSource = FileSystemObject.SearchFiles(base.Request.PhysicalApplicationPath + str2, this.TxtSearchKeyword.Text);
            }
            this.RptFiles.DataBind();
        }
示例#8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.InitTheExtensionImgDictionary();
     this.m_ConfigUploadDir = SiteConfig.SiteOption.UploadDir;
     this.m_CurrentDir      = BasePage.RequestString("Dir").Replace("..", string.Empty);
     this.m_UrlReferrer     = "FileManage.aspx?Dir=" + base.Server.UrlEncode(this.m_CurrentDir);
     if (!string.IsNullOrEmpty(this.m_ConfigUploadDir))
     {
         string path = "";
         if (!string.IsNullOrEmpty(this.m_CurrentDir) && (this.m_CurrentDir.LastIndexOf("/", StringComparison.Ordinal) > 0))
         {
             this.m_ParentDir = base.Server.UrlEncode(this.m_CurrentDir.Remove(this.m_CurrentDir.LastIndexOf("/", StringComparison.Ordinal), this.m_CurrentDir.Length - this.m_CurrentDir.LastIndexOf("/", StringComparison.Ordinal)));
         }
         path = this.m_ConfigUploadDir + this.m_CurrentDir + "/";
         this.LblCurrentDir.Text = path;
         path = base.Request.PhysicalApplicationPath + path;
         DirectoryInfo info = new DirectoryInfo(path);
         if (info.Exists)
         {
             if (string.IsNullOrEmpty(this.TxtSearchKeyword.Text))
             {
                 this.m_CurrentDirectoryInfo = FileSystemObject.GetDirectoryInfos(path, FsoMethod.All);
             }
             else
             {
                 string text = this.TxtSearchKeyword.Text;
                 if (!text.Contains("*"))
                 {
                     text = "*" + text + "*.*";
                 }
                 this.m_CurrentDirectoryInfo = FileSystemObject.SearchFiles(path, text);
             }
         }
     }
     else
     {
         this.PanContent.Visible = false;
         this.LitMessage.Text    = "请在网站配置中配置上传文件目录";
         this.LitMessage.Visible = true;
     }
     if (!this.Page.IsPostBack)
     {
         this.BindData();
     }
     this.BtnSearch.Click += new EventHandler(this.BtnSearch_Click);
 }
示例#9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         B_Admin badmin = new B_Admin();
         badmin.CheckMulitLogin();
         if (!badmin.ChkPermissions("TemplateManage"))
         {
             function.WriteErrMsg("没有权限进行此项操作");
         }
         string str2        = base.Request.QueryString["Dir"];
         string TemplateDir = SiteConfig.SiteOption.TemplateDir;
         this.m_UrlReferrer = "TemplateManage.aspx?Dir=" + base.Server.UrlEncode(base.Request.QueryString["Dir"]);
         if (string.IsNullOrEmpty(str2))
         {
             this.lblDir.Text           = "/";
             this.DirPath               = TemplateDir;
             this.LitParentDirLink.Text = "<a disabled='disabled'>返回上一级</a>";
         }
         else
         {
             this.lblDir.Text = str2;
             this.DirPath     = TemplateDir + "/" + str2;
             if (str2.LastIndexOf("/") > 0)
             {
                 this.ParentDir = str2.Remove(str2.LastIndexOf("/"), str2.Length - str2.LastIndexOf("/"));
             }
             this.LitParentDirLink.Text = "<a href=\"TemplateManage.aspx?Dir=" + this.ParentDir + "\">返回上一级</a>";
         }
         this.AbsPath       = base.Request.PhysicalApplicationPath + TemplateDir + str2 + "/";
         this.AbsPath       = this.AbsPath.Replace("/", @"\");
         this.AbsPath       = this.AbsPath.Replace(@"\\", @"\");
         this.HdnPath.Value = this.AbsPath;
         try
         {
             DataTable fileList = FileSystemObject.GetDirectoryInfos(this.AbsPath, FsoMethod.All);
             this.repFile.DataSource = fileList;
             this.repFile.DataBind();
             this.Page.DataBind();
         }
         catch (Exception exception)
         {
             string message = exception.Message;
         }
     }
 }
示例#10
0
        protected void MyBind()
        {
            M_UserInfo        mu    = buser.GetLogin();
            M_Design_SiteInfo sfMod = sfBll.SelReturnModel(SiteID);

            sfBll.CheckAuthEx(sfMod, mu);
            string pdir = function.VToP(VDir);

            if (!Directory.Exists(pdir))
            {
                function.WriteErrMsg("[" + VDir + "]目录不存在");
            }
            DataTable filesDT = FileSystemObject.GetDirectoryInfos(pdir, FsoMethod.All);

            RPT.DataSource = filesDT;
            RPT.DataBind();
            GetBread();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            function.AccessRulo();
            B_Admin badmin = new B_Admin();

            B_Admin.CheckIsLogged();
            Call.SetBreadCrumb(Master, "<li>后台管理</li><li>CRM应用</li><li><a href='ProjectsModel.aspx'>项目模型</a></li>");
            if (!this.Page.IsPostBack)
            {
                if (!File.Exists(HttpContext.Current.Server.MapPath("~/Images/ModelIcon/")))
                {
                    FileSystemObject.Create(HttpContext.Current.Server.MapPath("~/Images/ModelIcon/"), FsoMethod.Folder);
                }
                foreach (DataRow row in FileSystemObject.GetDirectoryInfos(HttpContext.Current.Server.MapPath("~/Images/ModelIcon/"), FsoMethod.File).Rows)
                {
                    this.DrpItemIcon.Items.Add(new ListItem(row["name"].ToString(), row["name"].ToString()));
                }
                this.DrpItemIcon.Attributes.Add("onchange", "ChangeImgItemIcon(this.value);ChangeTxtItemIcon(this.value);");
                this.TxtItemIcon.Attributes.Add("onchange", "ChangeImgItemIcon(this.value);");
                string id = base.Request.QueryString["ModelID"];
                if (!string.IsNullOrEmpty(id))
                {
                    this.HdnModelId.Value = id;
                    this.LTitle.Text      = "修改项目模型";
                    M_ModelInfo info = this.bll.GetModelById(int.Parse(id));
                    this.TxtModelName.Text      = info.ModelName;
                    this.LblTablePrefix.Visible = false;
                    this.TxtTableName.Text      = info.TableName;
                    this.TxtTableName.Enabled   = false;
                    this.TxtItemName.Text       = info.ItemName;
                    this.TxtItemUnit.Text       = info.ItemUnit;
                    string selectValue = string.IsNullOrEmpty(info.ItemIcon) ? "Default.gif" : info.ItemIcon;
                    //this.ImgItemIcon.ImageUrl = "~/Images/ModelIcon/" + selectValue;
                    this.DrpItemIcon.SelectedValue = selectValue;
                    this.TxtItemIcon.Text          = info.ItemIcon;
                    this.TxtDescription.Text       = info.Description;
                }
                else
                {
                    this.HdnModelId.Value = "0";
                }
            }
        }
        protected void BindData()
        {
            DataView defaultView = FileSystemObject.GetDirectoryInfos(this.currentDirectory, FsoMethod.All).DefaultView;

            this.Pager.RecordCount = defaultView.Count;
            int num  = (this.Pager.CurrentPageIndex - 1) * this.Pager.PageSize;
            int num2 = num + this.Pager.PageSize;
            List <DataRowView> list = new List <DataRowView>();

            for (int i = num; i < num2; i++)
            {
                if (i < defaultView.Count)
                {
                    list.Add(defaultView[i]);
                }
            }
            this.EgvFiles.DataSource = list;
            this.EgvFiles.DataBind();
        }
        protected void BindData()
        {
            DataTable directoryInfos;
            string    str4;

            if (((str4 = BasePage.RequestString("Action")) != null) && (str4 == "TemplateSearch"))
            {
                int    num  = BasePage.RequestInt32("DropSearch");
                string str  = BasePage.RequestString("TxtSearch");
                string str2 = BasePage.RequestString("Dir");
                string str3 = SiteConfig.SiteOption.TemplateDir + str2 + "/";
                if (num == 0)
                {
                    directoryInfos = FileSystemObject.SearchTemplateFiles(base.Request.PhysicalApplicationPath + str3, str.Trim());
                }
                else
                {
                    directoryInfos = FileSystemObject.SearchFileContent(base.Request.PhysicalApplicationPath + str3, "*.html", str.Trim());
                }
            }
            else
            {
                directoryInfos = FileSystemObject.GetDirectoryInfos(this.currentDirectory, FsoMethod.All);
            }
            DataView defaultView = directoryInfos.DefaultView;

            defaultView.RowFilter  = "Name <> '标签库' AND Name<> '分页标签库'";
            this.Pager.RecordCount = defaultView.Count;
            int num2 = (this.Pager.CurrentPageIndex - 1) * this.Pager.PageSize;
            int num3 = num2 + this.Pager.PageSize;
            List <DataRowView> list = new List <DataRowView>();

            for (int i = num2; i < num3; i++)
            {
                if (i < defaultView.Count)
                {
                    list.Add(defaultView[i]);
                }
            }
            this.EgvFiles.DataSource = list;
            this.EgvFiles.DataBind();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            ZoomLa.Common.function.AccessRulo();
            if (!this.Page.IsPostBack)
            {
                B_Admin badmin = new B_Admin();

                if (!B_ARoleAuth.Check(ZLEnum.Auth.shop, "ShopModelManage"))
                {
                    function.WriteErrMsg("没有权限进行此项操作");
                }
                foreach (DataRow row in FileSystemObject.GetDirectoryInfos(HttpContext.Current.Server.MapPath("~/Images/ModelIcon/"), FsoMethod.File).Rows)
                {
                    this.DrpItemIcon.Items.Add(new ListItem(row["name"].ToString(), row["name"].ToString()));
                }
                this.DrpItemIcon.Attributes.Add("onchange", "ChangeImgItemIcon(this.value);ChangeTxtItemIcon(this.value);");
                this.TxtItemIcon.Attributes.Add("onchange", "ChangeImgItemIcon(this.value);");
                string id = base.Request.QueryString["ModelID"];
                if (!string.IsNullOrEmpty(id))
                {
                    this.HdnModelId.Value = id;
                    this.LTitle.Text      = "修改商品模型";
                    M_ModelInfo info = this.bll.GetModelById(int.Parse(id));
                    this.TxtModelName.Text      = info.ModelName;
                    this.LblTablePrefix.Visible = false;
                    this.TxtTableName.Text      = info.TableName;
                    this.TxtTableName.Enabled   = false;
                    this.TxtItemName.Text       = info.ItemName;
                    this.TxtItemUnit.Text       = info.ItemUnit;
                    string selectValue = string.IsNullOrEmpty(info.ItemIcon) ? "Default.gif" : info.ItemIcon;
                    this.ImgItemIcon.ImageUrl      = "~/Images/ModelIcon/" + selectValue;
                    this.DrpItemIcon.SelectedValue = selectValue;
                    this.TxtItemIcon.Text          = info.ItemIcon;
                    this.TxtDescription.Text       = info.Description;
                }
                else
                {
                    this.HdnModelId.Value = "0";
                }
                Call.SetBreadCrumb(Master, "<li>商城管理</li><li><a href='ModelManage.aspx'>商品模型管理</a></li><li>添加商品模型</li>");
            }
        }
示例#15
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         B_Admin badmin = new B_Admin();
         badmin.CheckMulitLogin();
         if (!badmin.ChkPermissions("ModelEdit"))
         {
             function.WriteErrMsg("没有权限进行此项操作");
         }
         foreach (DataRow row in FileSystemObject.GetDirectoryInfos(HttpContext.Current.Server.MapPath("~/Images/ModelIcon/"), FsoMethod.File).Rows)
         {
             this.DrpItemIcon.Items.Add(new ListItem(row["name"].ToString(), row["name"].ToString()));
         }
         this.DrpItemIcon.Attributes.Add("onchange", "ChangeImgItemIcon(this.value);ChangeTxtItemIcon(this.value);");
         this.TxtItemIcon.Attributes.Add("onchange", "ChangeImgItemIcon(this.value);");
         string id = base.Request.QueryString["ModelID"];
         if (!string.IsNullOrEmpty(id))
         {
             this.HdnModelId.Value = id;
             this.LNav.Text        = "修改内容模型";
             this.LTitle.Text      = "修改内容模型";
             M_ModelInfo info = this.bll.GetModelById(int.Parse(id));
             this.TxtModelName.Text      = info.ModelName;
             this.LblTablePrefix.Visible = false;
             this.TxtTableName.Text      = info.TableName;
             this.TxtTableName.Enabled   = false;
             this.TxtItemName.Text       = info.ItemName;
             this.TxtItemUnit.Text       = info.ItemUnit;
             string selectValue = string.IsNullOrEmpty(info.ItemIcon) ? "Default.gif" : info.ItemIcon;
             this.ImgItemIcon.ImageUrl      = "~/Images/ModelIcon/" + selectValue;
             this.DrpItemIcon.SelectedValue = selectValue;
             this.TxtItemIcon.Text          = info.ItemIcon;
             this.TxtDescription.Text       = info.Description;
         }
         else
         {
             this.HdnModelId.Value = "0";
         }
     }
 }
示例#16
0
        protected void WaterMarkByFolder(string folderPath)
        {
            string path = this.m_ConfigUploadDir + this.m_CurrentDir + "/" + folderPath;

            path = (base.Request.PhysicalApplicationPath + path.Replace("/", @"\")).Replace(@"\\", @"\");
            DirectoryInfo info = new DirectoryInfo(path);

            if (info.Exists)
            {
                foreach (DataRow row in FileSystemObject.GetDirectoryInfos(path, FsoMethod.All).Rows)
                {
                    if (row["type"].ToString() == "2")
                    {
                        this.WaterMarkByFile(folderPath, row["name"].ToString(), row["content_type"].ToString());
                    }
                    if (row["type"].ToString() == "1")
                    {
                        this.WaterMarkByFolder(folderPath + "/" + row["name"].ToString());
                    }
                }
            }
        }
示例#17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            B_Admin badmin = new B_Admin();

            if (!IsPostBack)
            {
                if (!B_ARoleAuth.Check(ZLEnum.Auth.label, "CssManage"))
                {
                    function.WriteErrMsg(Resources.L.没有权限进行此项操作);
                }
                //string dir = base.Request.QueryString["Dir"];
                //TemplateDir = (!string.IsNullOrEmpty(SiteConfig.SiteOption.CssDir)) ? SiteConfig.SiteOption.CssDir : @"\Skin";
                //this.m_UrlReferrer = "CssManage.aspx?Dir=" + base.Server.UrlEncode(base.Request.QueryString["Dir"]);
                GetBread();
                //if (string.IsNullOrEmpty(Dir))
                //{
                //    this.lblDir.Text = "/";
                //    this.LitParentDirLink.Text = "<a disabled='disabled'>↑"+ Resources.L.返回上一级 + "</a>";
                //}
                //else
                //{
                //    this.lblDir.Text = Dir;
                //    //this.DirPath = TemplateDir + "/" + Dir;
                //    this.LitParentDirLink.Text = "<a href=\"CssManage.aspx?Dir=" + this.ParentDir + "\">↑"+ Resources.L.返回上一级 + "</a>";
                //}
                try
                {
                    DataTable fileList = FileSystemObject.GetDirectoryInfos(function.VToP(CurDirPath), FsoMethod.All);
                    this.repFile.DataSource = fileList;
                    this.repFile.DataBind();
                    this.Page.DataBind();
                }
                catch (Exception exception)
                {
                    string message = exception.Message;
                }
                Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "Main.aspx'>" + Resources.L.工作台 + "</a></li><li><a href='TemplateSet.aspx'>" + Resources.L.模板风格 + "</a></li><li class='active'><a href='CssManage.aspx'>" + Resources.L.风格管理 + "</a></li><li>[<a href='CssEdit.aspx' style='color:red;'>" + Resources.L.新建风格 + "</a>]</li>" + Call.GetHelp(22));
            }
        }
 protected void MyBind()
 {
     if (!Directory.Exists(backPath))
     {
         SafeSC.CreateDir(backPath);
     }
     dt = FileSystemObject.GetDirectoryInfos(backPath, FsoMethod.File);
     if (dt != null && dt.Rows.Count > 0)
     {
         EGV.DataSource = dt;
         EGV.DataBind();
         Creat.Visible = false;
     }
     else
     {
         EGV.Visible = false;
     }
     if (!DBHelper.IsLocalDB(Request.ServerVariables["LOCAl_ADDR"], Request.ServerVariables["SERVER_NAME"]))
     {
         dbnolocal_sp.Visible = true;
         DatabasePath.Value   = @"D:\Backup\" + DatabasePath.Value;
     }
 }
示例#19
0
        public IActionResult DBBackUP()
        {
            if (adminMod.AdminId < 1)
            {
                return(WriteErr("仅超管可访问该页面"));
            }
            if (!Directory.Exists(function.VToP(dbPath)))
            {
                SafeSC.CreateDir(dbPath);
            }
            if (Request.IsAjax())
            {
                //返回进度
                return(Content(cfg.Result.P_Percent));
            }
            DataTable dt = FileSystemObject.GetDirectoryInfos(function.VToP(dbPath), FsoMethod.File);

            if (dt != null && dt.Rows.Count > 0)
            {
                dt.DefaultView.Sort = "createTime DESC";
            }
            ViewBag.dt = dt;
            return(View());
        }
示例#20
0
 protected void Page_Load(object sender, EventArgs e)
 {
     foreach (DataRow row in FileSystemObject.GetDirectoryInfos(HttpContext.Current.Server.MapPath("~/Images/ModelIcon/"), FsoMethod.File).Rows)
     {
         this.DrpItemIcon.Items.Add(new ListItem(row["name"].ToString(), row["name"].ToString()));
     }
     this.DrpItemIcon.Attributes.Add("onchange", "ChangeImgItemIcon(this.value);ChangeTxtItemIcon(this.value);");
     this.TxtItemIcon.Attributes.Add("onchange", "ChangeImgItemIcon(this.value);");
     if (!base.IsPostBack)
     {
         string str = BasePage.RequestString("Action", "Add");
         this.ViewState["action"] = str;
         if (str == "Modify")
         {
             ModelInfo modelInfoById = ModelManager.GetModelInfoById(BasePage.RequestInt32("ModelID"));
             if (modelInfoById.IsNull)
             {
                 AdminPage.WriteErrMsg("<li>模型不存在!</li>");
             }
             this.TxtModelName.Text   = modelInfoById.ModelName.ToString();
             this.TxtDescription.Text = modelInfoById.Description;
             this.TxtItemName.Text    = modelInfoById.ItemName;
             this.TxtItemUnit.Text    = modelInfoById.ItemUnit;
             string selectValue = string.IsNullOrEmpty(modelInfoById.ItemIcon) ? "Default.gif" : modelInfoById.ItemIcon;
             this.ImgItemIcon.ImageUrl = "~/Images/ModelIcon/" + selectValue;
             BasePage.SetSelectedIndexByValue(this.DrpItemIcon, selectValue);
             this.TxtItemIcon.Text                  = modelInfoById.ItemIcon;
             this.TxtTableName.Text                 = modelInfoById.TableName;
             this.FileCTemplate.Text                = modelInfoById.DefaultTemplateFile;
             this.TscPrintTemplate.Text             = modelInfoById.PrintTemplate;
             this.TscSearchTemplate.Text            = modelInfoById.SearchTemplate;
             this.TscAdvanceSearchFormTemplate.Text = modelInfoById.AdvanceSearchFormTemplate;
             this.TscAdvanceSearchTemplate.Text     = modelInfoById.AdvanceSearchTemplate;
             this.TscCommentManageTemplate.Text     = modelInfoById.CommentManageTemplate;
             this.TxtTableName.Enabled              = false;
             this.RadioIsCountHits.SelectedValue    = modelInfoById.IsCountHits.ToString();
             this.RadioDisabled.SelectedValue       = modelInfoById.Disabled.ToString();
             this.HdnModelId.Value                  = modelInfoById.ModelId.ToString();
             this.HdnModelName.Value                = modelInfoById.ModelName;
             this.HdnTableName.Value                = modelInfoById.TableName;
             this.LblTablePrefix.Visible            = false;
             this.TxtAddInfoFilePath.Text           = modelInfoById.AddInfoFilePath;
             this.TxtManageInfoFilePath.Text        = modelInfoById.ManageInfoFilePath;
             this.TxtPreviewInfoFilePath.Text       = modelInfoById.PreviewInfoFilePath;
             this.TxtBatchInfoFilePath.Text         = modelInfoById.BatchInfoFilePath;
             this.TxtModelChargeTips.Text           = modelInfoById.ChargeTips;
             this.RadioEnableCharge.SelectedValue   = modelInfoById.EnableCharge.ToString();
             this.RadioEnableSignin.SelectedValue   = modelInfoById.EnableSignIn.ToString();
             this.RadVote.SelectedValue             = modelInfoById.EnbaleVote.ToString();
             this.trModelTemmpalteId.Visible        = false;
             this.TxtMaxPerUser.Text                = modelInfoById.MaxPerUser.ToString();
         }
         else
         {
             this.ShowFieldModelList();
         }
         if (!SiteConfig.SiteOption.EnablePointMoneyExp)
         {
             this.EnableCharge.Style.Add("display", "none");
             this.EnableChargeTips.Style.Add("display", "none");
         }
     }
 }
示例#21
0
    public void bindShengji()
    {
        try
        {
            //升级节点
            DataSet nodelist = nll.GetDirectory();
            if (nodelist != null)
            {
                //生成目录
                if (!FileSystemObject.IsExist(base.Request.PhysicalApplicationPath + @"\" + SiteConfig.SiteOption.TemplateDir.Replace("/", @"\") + @"\配置库\节点\", FsoMethod.Folder))
                {
                    FileSystemObject.CreateFileFolder(base.Request.PhysicalApplicationPath + @"\" + SiteConfig.SiteOption.TemplateDir.Replace("/", @"\") + @"\配置库\节点\");
                }
                nodelist.WriteXml(base.Request.PhysicalApplicationPath + @"\" + SiteConfig.SiteOption.TemplateDir.Replace("/", @"\") + @"\配置库\节点\Directory.node");

                if (!FileSystemObject.IsExist(base.Request.PhysicalApplicationPath + @"\" + SiteConfig.SiteOption.TemplateDir.Replace("/", @"\") + @"\配置库\节点\NodeList", FsoMethod.Folder))
                {
                    FileSystemObject.CreateFileFolder(base.Request.PhysicalApplicationPath + @"\" + SiteConfig.SiteOption.TemplateDir.Replace("/", @"\") + @"\配置库\节点\NodeList");
                }

                for (int i = 0; i < nodelist.Tables[0].Rows.Count; i++)
                {
                    int     NodeID   = DataConverter.CLng(nodelist.Tables[0].Rows[i]["NodeID"]);
                    string  NodeName = nodelist.Tables[0].Rows[i]["NodeName"].ToString();
                    DataSet nodeset  = nll.GetNodeSet(NodeID);
                    nodeset.WriteXml(base.Request.PhysicalApplicationPath + @"\" + SiteConfig.SiteOption.TemplateDir.Replace("/", @"\") + @"\配置库\节点\NodeList\" + NodeID.ToString() + ".node");
                }
            }
            nodelist.Dispose();
            if (!FileSystemObject.IsExist(base.Request.PhysicalApplicationPath + @"\" + SiteConfig.SiteOption.TemplateDir.Replace("/", @"\") + @"\配置库\标签\", FsoMethod.Folder))
            {
                FileSystemObject.CreateFileFolder(base.Request.PhysicalApplicationPath + @"\" + SiteConfig.SiteOption.TemplateDir.Replace("/", @"\") + @"\配置库\标签\");
            }
            string    dirfilename = base.Request.PhysicalApplicationPath + @"\" + SiteConfig.SiteOption.TemplateDir.Replace("/", @"\") + @"\配置库\标签\Directory.label";
            DataSet   nodedir     = new DataSet("NewDataSet");
            DataTable dttemp      = labelBll.GetLabelCateListXML();
            DataSet   dsLabals    = new DataSet("NewDataSet");
            DataTable dtLabals    = new DataTable("DataTable");
            dsLabals.Tables.Add(dtLabals);
            for (int i = 0; i < dttemp.Rows.Count; i++)
            {
                DataRow   dr          = dttemp.Rows[i];
                DataSet   labeltable1 = new DataSet("NewDataSet");
                DataTable dtFIle      = FileSystemObject.GetDirectoryInfos(base.Request.PhysicalApplicationPath + @"\" + SiteConfig.SiteOption.TemplateDir.Replace("/", @"\") + @"\配置库\标签\" + dr["name"].ToString(), FsoMethod.File);
                for (int ss = 0; ss < dtFIle.Rows.Count; ss++)
                {
                    if (dtFIle.Rows[ss]["content_type"].ToString().ToLower() == "label")
                    {
                        string  filenameLabel = SiteConfig.SiteMapath().Substring(0, SiteConfig.SiteMapath().Length - 1) + SiteConfig.SiteOption.TemplateDir.Replace("/", @"\") + @"\配置库\标签\" + dr["name"] + @"\" + dtFIle.Rows[ss]["name"];
                        DataSet tempset       = new DataSet();
                        tempset.ReadXml(filenameLabel);
                        DataTable converttable = tempset.Tables[0].Copy();
                        tempset.Dispose();
                        if (dtLabals.Columns.Count <= 0)
                        {
                            for (int jj = 0; jj < converttable.Columns.Count; jj++)
                            {
                                dtLabals.Columns.Add(converttable.Columns[jj].ColumnName, converttable.Columns[jj].DataType);
                            }
                        }
                        dtLabals.ImportRow(converttable.Rows[0]);
                    }
                }
                if (labeltable1.Tables.Count <= 0)
                {
                    DataTable  dtnew = new DataTable("Table");
                    DataColumn dc    = new DataColumn("LabelID", typeof(string));
                    dtnew.Columns.Add(dc);
                    dc = new DataColumn("LabelName", typeof(string));
                    dtnew.Columns.Add(dc);
                    dc = new DataColumn("LabelType", typeof(string));
                    dtnew.Columns.Add(dc);
                    dc = new DataColumn("LabelCate", typeof(string));
                    dtnew.Columns.Add(dc);
                    labeltable1.Tables.Add(dtnew);
                }
            }
            for (int i = dtLabals.Columns.Count - 1; i >= 4; i--)
            {
                dtLabals.Columns.RemoveAt(i);
            }
            DataTable labeltoptable = dsLabals.Tables[0].Copy();
            labeltoptable.TableName = "Table";
            nodedir.Tables.Add(labeltoptable);
            nodedir.WriteXml(dirfilename);
            nodedir.Dispose();
            mll.UpModel();
            lblKai.Text = "一键开销成功";
        }
        catch
        {
            lblKai.Text = "一键开销成功";
            throw;
        }
    }
 protected void BindData()
 {
     this.RptFiles.DataSource = FileSystemObject.GetDirectoryInfos(base.Request.PhysicalApplicationPath + this.m_CurrentDir, FsoMethod.All);
     this.RptFiles.DataBind();
 }
示例#23
0
 protected void BindData(string dir)
 {
     this.RepFiles.DataSource = FileSystemObject.GetDirectoryInfos(base.Request.PhysicalApplicationPath + dir, FsoMethod.All);
     this.RepFiles.DataBind();
 }
示例#24
0
        public ActionResult ShowEdit()
        {
            string    str               = base.Request.QueryString["Dir"];
            string    m_UserInput       = base.Request.QueryString["OpenWords"];
            string    m_ConfigUploadDir = SiteConfig.SiteOption.UploadDir;
            string    m_ParentDir       = "";
            DataTable dt = new DataTable();

            if (!string.IsNullOrEmpty(m_ConfigUploadDir))
            {
                string configUploadDir = m_ConfigUploadDir;
                if (!string.IsNullOrEmpty(str) && (str.LastIndexOf("/") > 0))
                {
                    m_ParentDir = str.Remove(str.LastIndexOf("/"), str.Length - str.LastIndexOf("/"));
                }
                if (!string.IsNullOrEmpty(str))
                {
                    str = configUploadDir + "/DocTemp/" + str;
                }
                else
                {
                    str = configUploadDir + "/DocTemp";
                }
                string dirPath = Server.MapPath(str);
                //回朔Bug处理,1,只能访问上传目录 2,替换../
                if (!dirPath.ToLower().Contains(configUploadDir.ToLower().Replace("/", @"\")))
                {
                    function.WriteErrMsg("路径错误!"); return(Content(""));
                }
                DirectoryInfo info = new DirectoryInfo(dirPath);
                if (info.Exists)
                {
                    string str2 = "";
                    try
                    {
                        if (!string.IsNullOrEmpty(base.Request.QueryString["Dir"]))
                        {
                            str2 = m_ConfigUploadDir + "/DocTemp/" + base.Request.QueryString["Dir"];
                        }
                        else
                        {
                            str2 = m_ConfigUploadDir + "/DocTemp";
                        }
                        if (string.IsNullOrEmpty(Request.Form["TxtSearchKeyword"]))
                        {
                            //为空并且显示目录

                            dt = FileSystemObject.GetDirectoryInfos(base.Request.PhysicalApplicationPath + str2, FsoMethod.All);
                            dt.DefaultView.RowFilter = "content_type not in ('xml')";
                        }
                        else
                        {
                            //如果不为空则搜索
                            dt = FileSystemObject.SearchFiles(base.Request.PhysicalApplicationPath + str2 + "/DocTemp", Request.Form["TxtSearchKeyword"]);
                            dt.DefaultView.RowFilter = "content_type not in ('xml')";
                        }
                    }
                    catch { function.WriteErrMsg(str2); return(Content("")); }
                }
                else
                {
                    function.WriteErrMsg(info.FullName); return(Content(""));
                }
                ViewBag.currentdir = str;
            }
            ViewBag.m_userinput = m_UserInput;
            ViewBag.dir         = Request["dir"] ?? "";
            return(View(dt.DefaultView.ToTable()));
        }
示例#25
0
        public DataTable Sel()
        {
            DataTable dt = FileSystemObject.GetDirectoryInfos(pdir, FsoMethod.File);

            return(dt);
        }