コード例 #1
0
ファイル: TestFile.aspx.cs プロジェクト: jiaping/JPCMS
        protected void Button2_Click(object sender, EventArgs e)
        {
            var settings = SettingFileService.GetSettings("c:\\1.xml");

            var json = settings.ToJson();

            Response.Write(json);
        }
コード例 #2
0
ファイル: TestFile.aspx.cs プロジェクト: jiaping/JPCMS
        protected void Button1_Click(object sender, EventArgs e)
        {
            SettingFile settings = new SettingFile();

            for (int i = 0; i < 10; i++)
            {
                Dictionary <string, object> dic = new Dictionary <string, object>();
                dic.Add("name", "名称" + i.ToString());
                dic.Add("img", "img" + i.ToString());

                settings.Items.Add(dic);
            }
            SettingFileService.SaveFile("c:\\1.xml", settings);
        }
コード例 #3
0
ファイル: VisualService.asmx.cs プロジェクト: sunsiz/We7CMS
        public string GetLayoutSkins()
        {
            AjaxResponse ajaxResponse = new AjaxResponse();

            var layoutIndexFile = HttpContext.Current.Server.MapPath("~/Widgets/Themes/Themes.xml");

            try
            {
                var skins = SettingFileService.GetSettings(layoutIndexFile);

                ajaxResponse.Data    = skins;
                ajaxResponse.Success = true;
            }
            catch (Exception ex)
            {
                //获取widget列表失败
                ajaxResponse.Success = false;
                ajaxResponse.Message = ex.Message;
            }

            return(ajaxResponse.ToJson());
        }