本文整理汇总了C#中Discuz.Common.Xml.XmlDocumentExtender类的典型用法代码示例。如果您正苦于以下问题:C# XmlDocumentExtender类的具体用法?C# XmlDocumentExtender怎么用?C# XmlDocumentExtender使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XmlDocumentExtender类属于Discuz.Common.Xml命名空间,在下文中一共展示了XmlDocumentExtender类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: BindDataGrid
private void BindDataGrid()
{
DataGrid1.TableHeaderName = pagename + " 子菜单项管理";
XmlDocumentExtender doc = new XmlDocumentExtender();
doc.Load(configPath);
string submenuid = DNTRequest.GetString("submenuid");
XmlNodeList submenusitem = doc.SelectNodes("/dataset/submain");
DataTable dt = new DataTable();
dt.Columns.Add(new DataColumn("id"));
dt.Columns.Add(new DataColumn("menutitle"));
dt.Columns.Add(new DataColumn("link"));
int i = 0;
foreach (XmlNode menuitem in submenusitem)
{
if(menuitem["menuparentid"].InnerText == submenuid)
{
DataRow dr = dt.NewRow();
dr["id"] = i.ToString();
dr["menutitle"] = menuitem["menutitle"].InnerText;
dr["link"] = menuitem["link"].InnerText;
dt.Rows.Add(dr);
}
i++;
}
DataGrid1.DataSource = dt;
DataGrid1.DataBind();
}
开发者ID:wenysky,项目名称:dnt31-lite,代码行数:27,代码来源:managesubmenuitem.aspx.cs
示例2: BindEditData
private void BindEditData(string tid)
{
#region 装载主题编辑
panel1.Visible = true;
XmlDocumentExtender doc = new XmlDocumentExtender();
if (!File.Exists(configPath))
return;
doc.Load(configPath);
string topicPath = "/Aggregationinfo/Aggregationpage/Website/Forum/Topiclist/Topic";
if (fid != "")
topicPath = "/Aggregationinfo/Forum/Topiclist/Topic";
XmlNodeList topiclistNode = doc.SelectNodes(topicPath);
XmlNodeInnerTextVisitor topicvisitor = new XmlNodeInnerTextVisitor();
foreach (XmlNode topic in topiclistNode)
{
topicvisitor.SetNode(topic);
if (topicvisitor["topicid"] == tid)
{
topicid.Value = topicvisitor["topicid"];
title.Text = topicvisitor["title"];
poster.Text = topicvisitor["poster"];
postdatetime.Text = topicvisitor["postdatetime"];
shortdescription.Text = topicvisitor["shortdescription"];
fulldescription.Value = topicvisitor["fulldescription"];
}
}
#endregion
}
开发者ID:wenysky,项目名称:dnt31-lite,代码行数:28,代码来源:aggregation_editforumaggset.aspx.cs
示例3: LoadWebSiteConfig
/// <summary>
/// 装载WebSite信息
/// </summary>
private void LoadWebSiteConfig()
{
#region 装载主题信息
XmlDocumentExtender doc = new XmlDocumentExtender();
doc.Load(configPath);
XmlNodeList topiclistNode = doc.SelectNodes("/Aggregationinfo/Data/Hottopiclist/Topic");
XmlNodeList website_spacelistnode = doc.SelectNodes("/Aggregationinfo/Forum/Hottopiclist/Topic");
XmlNodeInnerTextVisitor topicvisitor = new XmlNodeInnerTextVisitor();
XmlNodeInnerTextVisitor pagetopicvisitor = new XmlNodeInnerTextVisitor();
forumlist.Text = "";
int i = 0;
foreach (XmlNode topic in topiclistNode)
{
topicvisitor.SetNode(topic);
bool isCheck = false;
foreach (XmlNode index in website_spacelistnode)
{
pagetopicvisitor.SetNode(index);
if (topicvisitor["tid"].ToString() == pagetopicvisitor["tid"].ToString())
{
isCheck = true;
break;
}
}
forumlist.Text += "<div class='mo' id='m" + i + "' flag='f" + i + "'><h1><input type='checkbox' name='tid' " + (isCheck ? "checked" : "") + " value='" + topicvisitor["tid"] + "'>" + topicvisitor["title"] + "</h1></div>\n";
i++;
}
#endregion
}
开发者ID:wenysky,项目名称:dnt31-lite,代码行数:32,代码来源:aggregation_forumhottopic.aspx.cs
示例4: NewMainMenu
/// <summary>
/// 增加主菜单
/// </summary>
/// <param name="title">主菜单标题</param>
/// <param name="defaulturl">主菜单默认展开的页面</param>
/// <returns>新主菜单项ID</returns>
public static int NewMainMenu(string title, string defaulturl)
{
XmlDocumentExtender doc = new XmlDocumentExtender();
doc.Load(configPath);
XmlNodeList mainmenus = doc.SelectNodes("/dataset/toptabmenu");
int newMenuId = mainmenus.Count + 1;
XmlElement newMainMenuItem = doc.CreateElement("toptabmenu");
XmlElement node = doc.CreateElement("id");
node.InnerText = newMenuId.ToString();
newMainMenuItem.AppendChild(node);
node = doc.CreateElement("title");
node.InnerText = title;
newMainMenuItem.AppendChild(node);
node = doc.CreateElement("mainmenulist");
node.InnerText = "";
newMainMenuItem.AppendChild(node);
node = doc.CreateElement("mainmenuidlist");
node.InnerText = "";
newMainMenuItem.AppendChild(node);
node = doc.CreateElement("defaulturl");
node.InnerText = defaulturl;
newMainMenuItem.AppendChild(node);
node = doc.CreateElement("system");
node.InnerText = "0";
newMainMenuItem.AppendChild(node);
doc.SelectSingleNode("/dataset").AppendChild(newMainMenuItem);
doc.Save(configPath);
return newMenuId;
}
开发者ID:Vinna,项目名称:DeepInSummer,代码行数:41,代码来源:MenuManage.cs
示例5: GetParm
/// <summary>
/// 获取当前页面的参数
/// </summary>
/// <param name="doc"></param>
/// <param name="menuparentid"></param>
/// <returns></returns>
public string[] GetParm(XmlDocumentExtender doc, string menuparentid)
{
string[] parm = new string[3];
XmlNodeList mainmenus = doc.SelectNodes("/dataset/mainmenu");
XmlNodeInnerTextVisitor menuvisitor = new XmlNodeInnerTextVisitor();
foreach (XmlNode mainmenu in mainmenus)
{
menuvisitor.SetNode(mainmenu);
if (menuvisitor["menuid"] == menuparentid)
{
parm[0] = menuvisitor["id"];
break;
}
}
XmlNodeList toptabmenus = doc.SelectNodes("/dataset/toptabmenu");
foreach (XmlNode toptabmenu in toptabmenus)
{
menuvisitor.SetNode(toptabmenu);
if (("," + menuvisitor["mainmenulist"] + ",").IndexOf("," + parm[0] + ",") != -1)
{
parm[1] = menuvisitor["id"];
parm[2] = menuvisitor["mainmenulist"];
break;
}
}
return parm;
}
开发者ID:ichari,项目名称:ichari,代码行数:33,代码来源:favoritefunction.ascx.cs
示例6: Uri
/*private void SaveManagerBody()
{
string url = Context.Request.Url.ToString().ToLower().Substring(0, Context.Request.Url.ToString().ToLower().IndexOf("rapidset")) + "framepage/managerbody.aspx";
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(new Uri(url));
req.Method = "GET";
WebResponse wr = req.GetResponse();
StreamReader sr = new StreamReader(wr.GetResponseStream(), System.Text.Encoding.GetEncoding("gb2312"));
string html = sr.ReadToEnd();
FileStream fs = new FileStream(Utils.GetMapPath("../framepage/managerbody.htm"), FileMode.Create);
byte[] bt = System.Text.Encoding.UTF8.GetBytes(html);
fs.Write(bt, 0, bt.Length);
fs.Close();
}*/
private void BindDataGrid()
{
DataGrid1.TableHeaderName = "菜单管理";
XmlDocumentExtender doc = new XmlDocumentExtender();
doc.Load(configPath);
XmlNodeList mainmenus = doc.SelectNodes("/dataset/toptabmenu");
DataTable dt = new DataTable();
dt.Columns.Add(new DataColumn("id"));
dt.Columns.Add(new DataColumn("title"));
dt.Columns.Add(new DataColumn("defaulturl"));
dt.Columns.Add(new DataColumn("system"));
dt.Columns.Add(new DataColumn("delitem"));
foreach (XmlNode menuitem in mainmenus)
{
DataRow dr = dt.NewRow();
dr["id"] = menuitem["id"].InnerText;
dr["title"] = menuitem["title"].InnerText;
dr["defaulturl"] = menuitem["defaulturl"].InnerText;
dr["system"] = menuitem["system"].InnerText != "0" ? "是" : "否";
if (menuitem["mainmenulist"].InnerText != "")
dr["delitem"] = "删除";
else
dr["delitem"] = "<a href='managemainmenu.aspx?mode=del&menuid=" + menuitem["id"].InnerText + "' onclick='return confirm(\"您确认要删除此菜单项吗?\")'>删除</a>";
dt.Rows.Add(dr);
}
DataGrid1.DataSource = dt;
DataGrid1.DataBind();
}
开发者ID:ichari,项目名称:ichari,代码行数:42,代码来源:managemainmenu.aspx.cs
示例7: BindData
public void BindData()
{
#region 绑定轮换图片列表
DataGrid1.AllowCustomPaging = false;
DataGrid1.DataKeyField = "rotatepicid";
DataGrid1.TableHeaderName = "聚合轮换图片列表";
XmlDocumentExtender xmldocument = new XmlDocumentExtender();
xmldocument.Load(configPath);
XmlNode node = xmldocument.SelectSingleNode(targetNode);
if (node == null || node.ChildNodes.Count == 0)
{
DataGrid1.Visible = SaveRotatepic.Visible = false;
return;
}
XmlNodeReader rdr = new XmlNodeReader(node);
dsSrc.ReadXml(rdr);
dsSrc.Tables[0].Columns.Add("rowid");
int i = 0;
foreach (DataRow dr in dsSrc.Tables[0].Rows)
{
dr["rowid"] = i.ToString();
i++;
}
DataGrid1.DataSource = dsSrc.Tables[0];
DataGrid1.DataBind();
#endregion
}
开发者ID:ChalmerLin,项目名称:dnt_v3.6.711,代码行数:28,代码来源:aggregation_rotatepic.aspx.cs
示例8: GetWebsiteConfig
private DataTable GetWebsiteConfig()
{
#region 装载主题
DataTable dt = new DataTable();
dt.Columns.Add("tid");
dt.Columns.Add("title");
dt.Columns.Add("poster");
dt.Columns.Add("postdatetime");
dt.Columns.Add("showtype");
XmlDocumentExtender doc = new XmlDocumentExtender();
doc.Load(configPath);
XmlNodeList topiclistNode = doc.SelectNodes("/Aggregationinfo/Aggregationpage/Website/Forum/Topiclist/Topic");
XmlNodeInnerTextVisitor topicvisitor = new XmlNodeInnerTextVisitor();
foreach (XmlNode topic in topiclistNode)
{
topicvisitor.SetNode(topic);
DataRow dr = dt.NewRow();
dr["tid"] = topicvisitor["topicid"];
dr["title"] = topicvisitor["title"];
dr["poster"] = topicvisitor["poster"];
dr["postdatetime"] = topicvisitor["postdatetime"];
dt.Rows.Add(dr);
}
return dt;
#endregion
}
开发者ID:ZeroneBit,项目名称:dnt3_src,代码行数:26,代码来源:aggregation_editforumaggset.aspx.cs
示例9: LoadWebSiteConfig
private void LoadWebSiteConfig()
{
#region 装载个人空间信息
XmlDocumentExtender doc = new XmlDocumentExtender();
doc.Load(configPath);
XmlNodeList data_spacelistNode = doc.SelectNodes("/Aggregationinfo/Aggregationdata/" + pagename + "aggregationdata/" + pagename + "_spacelist/Space");
XmlNodeList index_spacelistnode = doc.SelectNodes("/Aggregationinfo/Aggregationpage/" + pagename + "/" + pagename + "_spacelist/Space");
XmlNodeInnerTextVisitor dataspacevisitor = new XmlNodeInnerTextVisitor();
XmlNodeInnerTextVisitor indexspacevisitor = new XmlNodeInnerTextVisitor();
int i = 0;
spacelist.Text = "";
foreach (XmlNode data in data_spacelistNode)
{
dataspacevisitor.SetNode(data);
bool isCheck = false;
foreach (XmlNode index in index_spacelistnode)
{
indexspacevisitor.SetNode(index);
if (dataspacevisitor["spaceid"].ToString() == indexspacevisitor["spaceid"].ToString())
{
isCheck = true;
break;
}
}
spacelist.Text += "<div class='mo' id='m" + i + "' flag='f" + i + "'><h1><input type='checkbox' name='sid' " + (isCheck ? "checked" : "") + " value='" + dataspacevisitor["spaceid"] + "'>" + dataspacevisitor["title"] + "</h1></div>\n";
i++;
}
#endregion
}
开发者ID:ChalmerLin,项目名称:dnt_v3.6.711,代码行数:29,代码来源:spaceaggset.aspx.cs
示例10: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
// 在此处放置用户代码以初始化页面
allowUserGroup.Attributes.Add("onclick", "ChanageUserGroupStatus(this.checked)");
if (!IsPostBack)
{
EnableSpace.SelectedValue = config.Enablespace.ToString();
EnableSpace.Items[0].Attributes.Add("onclick", "ShowHiddenOption(true);");
EnableSpace.Items[1].Attributes.Add("onclick", "ShowHiddenOption(false);");
ShowSpaceOption.Attributes.Add("style", config.Enablespace == 1 ? "display:block" : "display:none");
ShowUserGroup.Attributes.Add("style", config.Enablespace == 1 ? "display:block" : "display:none");
LoadUserGroup();
XmlDocumentExtender xmlDoc = new XmlDocumentExtender();
xmlDoc.Load(Server.MapPath("../../config/space.config"));
XmlNode root = xmlDoc.SelectSingleNode("SpaceActiveConfigInfo");
XmlNodeInnerTextVisitor rootvisitor = new XmlNodeInnerTextVisitor();
rootvisitor.SetNode(root);
allowPostcount.Checked = rootvisitor["AllowPostcount"] == "1" ? true : false;
Postcount.Text = rootvisitor["Postcount"];
allowDigestcount.Checked = rootvisitor["AllowDigestcount"] == "1" ? true : false;
Digestcount.Text = rootvisitor["Digestcount"];
allowScore.Checked = rootvisitor["AllowScore"] == "1" ? true : false;
Score.Text = rootvisitor["Score"];
allowUserGroup.Checked = rootvisitor["AllowUsergroups"] == "1" ? true : false;
string groupList = rootvisitor["Usergroups"];
if (!allowUserGroup.Checked || groupList == "")
return;
else
BindUserGroup(groupList);
ActiveType.SelectedValue = rootvisitor["ActiveType"];
BindUserGorupMaxspaceattachsize();
}
}
开发者ID:khaliyo,项目名称:DiscuzNT,代码行数:33,代码来源:spaceapplysetting.aspx.cs
示例11: saveinfo_Click
protected void saveinfo_Click(object sender, EventArgs e)
{
string configPath = Page.Server.MapPath("../xml/user_" + this.userid + ".config");
XmlDocumentExtender doc = new XmlDocumentExtender();
if (System.IO.File.Exists(configPath))
{
if (doc.SelectSingleNode("/UserConfig/ShowInfo") == null)
{
XmlNode userconfig = doc.CreateElement("UserConfig");
doc.AppendChild(userconfig);
XmlNode showinfo = doc.CreateElement("ShowInfo");
showinfo.InnerText = showhelp.SelectedValue.ToString();
userconfig.AppendChild(showinfo);
}
else
{
XmlNode showinfo = doc.SelectSingleNode("/UserConfig/ShowInfo");
showinfo.InnerText = showhelp.SelectedValue.ToString();
}
}
else
{
XmlElement userconfig = doc.CreateElement("UserConfig");
XmlElement showinfo = doc.CreateElement("ShowInfo");
showinfo.InnerText = showhelp.SelectedValue.ToString();
userconfig.AppendChild(showinfo);
doc.AppendChild(userconfig);
}
doc.Save(configPath);
this.RegisterStartupScript("PAGE", "window.location='likesetting.aspx'");
}
开发者ID:ZeroneBit,项目名称:dnt3_src,代码行数:31,代码来源:likesetting.aspx.cs
示例12: SaveTopic_Click
/// <summary>
/// 保存信息
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void SaveTopic_Click(object sender, EventArgs e)
{
#region 保存信息
string tidlist = DNTRequest.GetString("forumtopicstatus");
//当未选择主题时,则清除所有选择
if (tidlist == "")
{
if (File.Exists(configPath))
{
XmlDocumentExtender doc = new XmlDocumentExtender();
doc.Load(configPath);
doc.RemoveNodeAndChildNode("/Aggregationinfo/Data/Hottopiclist");
doc.RemoveNodeAndChildNode("/Aggregationinfo/Forum/Hottopiclist");
doc.Save(configPath);
Discuz.Cache.DNTCache.GetCacheService().RemoveObject("/Aggregation/Hottopiclist");
}
Response.Redirect("aggregation_forumhottopic.aspx");
return;
}
else
{
//得到所选择帖子信息
Posts.WriteAggregationHotTopicsData(tidlist, configPath,
"/Aggregationinfo/Data/Hottopiclist",
"/Aggregationinfo/Forum/Hottopiclist");
Discuz.Cache.DNTCache.GetCacheService().RemoveObject("/Aggregation/Hottopiclist");
Response.Redirect("aggregation_edithottopic.aspx");
}
#endregion
}
开发者ID:wenysky,项目名称:dnt31-lite,代码行数:35,代码来源:aggregation_forumhottopic.aspx.cs
示例13: BindData
public void BindData()
{
#region 绑定数据
DataGrid1.AllowCustomPaging = false;
DataGrid1.DataKeyField = "menuid";
DataGrid1.TableHeaderName = "我的菜单列表";
DataSet dsSrc = new DataSet();
XmlDocumentExtender xmldocument = new XmlDocumentExtender();
xmldocument.Load(configPath);
XmlNode node = xmldocument.SelectSingleNode("/menuset");
if (node == null ||node.ChildNodes.Count == 0)
return;
XmlNodeReader rdr = new XmlNodeReader(node);
dsSrc.ReadXml(rdr);
dsSrc.Tables[0].Columns.Add("menuid");
int i = 0;
foreach (DataRow dr in dsSrc.Tables[0].Rows)
{
dr["menuid"] = i.ToString();
i++;
}
DataGrid1.DataSource = dsSrc.Tables[0];
DataGrid1.DataBind();
#endregion
}
开发者ID:khaliyo,项目名称:DiscuzNT,代码行数:27,代码来源:forum_mymenumanage.aspx.cs
示例14: LoadInfo
private void LoadInfo()
{
string fids = "";
XmlDocumentExtender doc = new XmlDocumentExtender();
doc.Load(configPath);
XmlNode fidlist = doc.SelectSingleNode("/Aggregationinfo/Aggregationpage/Website/Website_forumrecomend/fidlist");
if (fidlist == null)
{
return;
}
fids = fidlist.InnerText;
string strJson = "";
Discuz.Common.Generic.List<ForumInfo> lists = Discuz.Forum.Forums.GetForumList();
foreach (string fid in fids.Split(','))
{
foreach (ForumInfo foruminfo in lists)
{
if (foruminfo.Fid.ToString() == fid)
{
strJson += "{'fid':'" + foruminfo.Fid + "','forumtitle':'" + foruminfo.Name + "'},";
break;
}
}
}
if (strJson != "")
{
strJson = strJson.TrimEnd(',');
}
strJson = "<script type='text/javascript'>\r\nvar fidlist = [" + strJson + "];\r\nfor(var i = 0 ; i < fidlist.length ; i++)\r\n{\r\nvar no = new Option();\r\nno.value = fidlist[i]['fid'];\r\nno.text = fidlist[i]['forumtitle'];\r\nForm1.list2.options[Form1.list2.options.length] = no;\r\n}\r\n</script>";
base.RegisterStartupScript("", strJson);
}
开发者ID:Vinna,项目名称:DeepInSummer,代码行数:32,代码来源:aggregation_recommendforums.aspx.cs
示例15: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
att.Columns.Add("typeid");
att.Columns.Add("typename");
att.Columns.Add("extname");
XmlDocumentExtender doc = new XmlDocumentExtender();
doc.Load(AppDomain.CurrentDomain.BaseDirectory + "config/myattachment.config");
XmlNodeList attachtype = doc.SelectNodes("/MyAttachmentsTypeConfigInfo/attachtypes/AttachmentType");
foreach (XmlNode node in attachtype)
{
DataRow dr = att.NewRow();
dr["typeid"] = node["TypeId"].InnerText;
dr["typename"] = node["TypeName"].InnerText;
dr["extname"] = node["ExtName"].InnerText != "" ? node["ExtName"].InnerText : "无绑定类型";
att.Rows.Add(dr);
}
dt = DatabaseProvider.GetInstance().GetAttachTypes();
string typeid = DNTRequest.GetString("typeid");
if (!Page.IsPostBack)
{
BindData();
string attlist = ""; //得到已绑定的附件列表
if (att != null)
{
foreach (DataRow dr in att.Rows)
{
attlist += dr["extname"].ToString() + ",";
}
attlist = attlist.TrimEnd(',');
}
attachextensions.AddTableData(dt);
foreach (string atttype in attlist.Split(','))
{
for (int i = 0; i < attachextensions.Items.Count; i++)
{
if (atttype == attachextensions.Items[i].Text)
{
attachextensions.Items[i].Enabled = false;
break;
}
}
}
string script = "var atttype = \r\n{";
if (att != null)
{
foreach (DataRow dr in att.Rows)
{
script += "\r\n\ttype" + dr["typeid"].ToString() + ":{typename:'" + dr["typename"].ToString() + "',extname:'" + dr["extname"].ToString() + "'},";
}
script = script.TrimEnd(',');
}
script += "\r\n};";
base.RegisterStartupScript("", "<script type='text/javascript'>\r\n" + script + "\r\n</script>");
}
}
开发者ID:ichari,项目名称:ichari,代码行数:57,代码来源:forum_attchemnttypes.aspx.cs
示例16: BindData
public void BindData()
{
string menuId = DNTRequest.GetString("menuid");
string menuTitle = "";
string menuSubMenuList = "";
XmlDocumentExtender doc = new XmlDocumentExtender();
doc.Load(configPath);
XmlNodeList mainMenus = doc.SelectNodes("/dataset/toptabmenu");
foreach (XmlNode menuItem in mainMenus) //查找主菜单信息
{
if (menuItem["id"].InnerText == menuId)
{
menuTitle = menuItem["title"].InnerText;
menuSubMenuList = menuItem["mainmenulist"].InnerText;
break;
}
}
DataGrid1.TableHeaderName = menuTitle + " 菜单项管理";
XmlNodeList subMenus = doc.SelectNodes("/dataset/mainmenu");
DataTable dt = new DataTable();
if (menuSubMenuList == "") //该菜单没有子菜单
{
DataGrid1.DataSource = dt;
DataGrid1.DataBind();
return;
}
dt.Columns.Add("id");
dt.Columns.Add("menuid");
dt.Columns.Add("submenuid");
dt.Columns.Add("menutitle");
dt.Columns.Add("delitem");
foreach (XmlNode subMenuItem in subMenus)
{
if (("," + menuSubMenuList + ",").IndexOf("," + subMenuItem["id"].InnerText + ",") != -1)
{
DataRow dr = dt.NewRow();
dr["id"] = subMenuItem["id"].InnerText;
dr["menuid"] = menuId;
dr["submenuid"] = subMenuItem["menuid"].InnerText;
dr["menutitle"] = subMenuItem["menutitle"].InnerText;
if (FindSubMenuItem(subMenuItem["menuid"].InnerText,doc))
{
dr["delitem"] = "删除";
}
else
{
dr["delitem"] = "<a href='managesubmenu.aspx?mode=del&menuid=" + menuId + "&submenuid=" + subMenuItem["id"].InnerText + "' onclick='return confirm(\"您确认要删除此菜单项吗?\");'>删除</a>";
}
dt.Rows.Add(dr);
}
}
DataGrid1.DataSource = dt;
DataGrid1.DataBind();
}
开发者ID:khaliyo,项目名称:DiscuzNT,代码行数:54,代码来源:managesubmenu.aspx.cs
示例17: Btn_SaveInfo_Click
private void Btn_SaveInfo_Click(object sender, EventArgs e)
{
#region 保存自动提取数据
XmlDocumentExtender doc = new XmlDocumentExtender();
doc.Load(configPath);
XmlNode fidlist = doc.InitializeNode("/Aggregationinfo/Aggregationpage/Website/Website_forumrecomend/fidlist");
fidlist.InnerText = DNTRequest.GetString("rst");
doc.Save(configPath);
AggregationFacade.BaseAggregation.ClearAllDataBind();
Response.Redirect("aggregation_recommendtopic.aspx");
#endregion
}
开发者ID:Vinna,项目名称:DeepInSummer,代码行数:12,代码来源:aggregation_recommendforums.aspx.cs
示例18: LoadInfo
private void LoadInfo()
{
string fids = "";
XmlDocumentExtender doc = new XmlDocumentExtender();
doc.Load(configPath);
fids = doc.SelectSingleNode("/Aggregationinfo/Aggregationpage/Website/Website_forumrecomend/fidlist").InnerText;
XmlNodeList forumrecomendtopic = doc.SelectNodes("/Aggregationinfo/Aggregationpage/Website/Website_forumrecomendtopiclist/Website_forumrecomendtopic");
List<ForumInfo> lists = Discuz.Forum.Forums.GetForumList();
DataTable forumdata = new DataTable();
forumdata.Columns.Add("fid");
forumdata.Columns.Add("name");
forumdata.Columns.Add("tid");
forumdata.Columns.Add("title");
forumdata.Columns.Add("img");
foreach (string fid in fids.Split(','))
{
foreach (ForumInfo foruminfo in lists)
{
if (foruminfo.Fid.ToString() == fid) //在板块信息中找到当前选择的板块
{
DataRow dr = forumdata.NewRow();
dr["fid"] = fid;
dr["name"] = foruminfo.Name;
dr["tid"] = "";
dr["title"] = "";
dr["img"] = "";
forumdata.Rows.Add(dr);
break;
}
}
}
foreach (XmlNode topic in forumrecomendtopic)
{
foreach (DataRow dr in forumdata.Rows)
{
if (topic["fid"].InnerText == dr["fid"].ToString())
{
dr["tid"] = topic["tid"].InnerText;
dr["title"] = topic["title"].InnerText;
dr["img"] = topic["img"].InnerText;
break;
}
}
}
DataGrid1.TableHeaderName = "推荐版块图片选择";
DataGrid1.DataKeyField = "fid";
DataGrid1.DataSource = forumdata;
DataGrid1.DataBind();
}
开发者ID:ZeroneBit,项目名称:dnt3_src,代码行数:52,代码来源:aggregation_recommendtopic.aspx.cs
示例19: LoadWebSiteConfig
private void LoadWebSiteConfig()
{
#region 绑定自动推荐相册
//装载配置文件
XmlDocumentExtender doc = new XmlDocumentExtender();
doc.Load(configPath);
XmlNode albumconfig = doc.SelectSingleNode("/Aggregationinfo/Aggregationpage/Albumindex/Albumconfig");
focusphotoshowtype.SelectedIndex = Convert.ToInt32(doc.GetSingleNodeValue(albumconfig, "Focusphotoshowtype"));
focusphotodays.Text = doc.GetSingleNodeValue(albumconfig, "Focusphotodays");
focusphotocount.Text = doc.GetSingleNodeValue(albumconfig, "Focusphotocount");
recommendalbumtype.SelectedIndex = Convert.ToInt32(doc.GetSingleNodeValue(albumconfig, "Focusalbumshowtype"));
focusalbumdays.Text = doc.GetSingleNodeValue(albumconfig, "Focusalbumdays");
focusalbumcount.Text = doc.GetSingleNodeValue(albumconfig, "Focusalbumcount");
weekhot.Text = doc.GetSingleNodeValue(albumconfig, "Weekhot");
#endregion
}
开发者ID:khaliyo,项目名称:DiscuzNT,代码行数:16,代码来源:autoalbums.aspx.cs
示例20: addmenu_Click
private void addmenu_Click(Object sender, EventArgs e)
{
#region 插入菜单
if ((atext.Text.Trim() != "") && (ahref.Text.Trim() != ""))
{
XmlDocumentExtender doc = new XmlDocumentExtender();
doc.Load(configPath);
int lastmenuorder = 0;
if (doc.SelectSingleNode("/menuset").ChildNodes.Count != 0)
{
lastmenuorder = int.Parse(doc.SelectSingleNode("/menuset").LastChild["menuorder"].InnerText);
}
lastmenuorder++;
XmlElement menunode = doc.CreateElement("menuitem");
doc.AppendChildElementByNameValue(ref menunode, "menuorder", lastmenuorder.ToString());
doc.AppendChildElementByNameValue(ref menunode, "text", atext.Text.Trim());
doc.AppendChildElementByNameValue(ref menunode, "href", ahref.Text.Trim());
doc.AppendChildElementByNameValue(ref menunode, "onclick", aonclick.Text.Trim(),true);
doc.AppendChildElementByNameValue(ref menunode, "target", atarget.Text.Trim());
doc.CreateNode("/menuset").AppendChild(menunode);
doc.Save(configPath);
CreateJsFile();
try
{
BindData();
ResetForm();
base.RegisterStartupScript("PAGE", "window.location.href='forum_mymenumanage.aspx';");
return;
}
catch
{
base.RegisterStartupScript("", "<script>alert('无法更新XML文件');window.location.href='forum_mymenumanage.aspx';</script>");
return;
}
}
else
{
base.RegisterStartupScript("", "<script>alert('链接文字和链接地址是必须输入的,如果无链接地址请输入\"#\".');window.location.href='forum_mymenumanage.aspx';</script>");
return;
}
#endregion
}
开发者ID:khaliyo,项目名称:DiscuzNT,代码行数:46,代码来源:forum_mymenumanage.aspx.cs
注:本文中的Discuz.Common.Xml.XmlDocumentExtender类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论