Common/ListBuilder.cs
(开头部分) 8KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
/**********************************************
* 类作用: 链接辅助类
* 建立人: abaal
* 建立时间: 2008-09-03
* Copyright (C) 2007-2008 abaal
* All rights reserved
* http://blog.csdn.net/abaal888
***********************************************/
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.Data;
namespace Svnhost.Common
{
/* 使用方式
ListBuilder lb1=new ListBuilder("ul");
lb1.SetTemplate("<a href=\"{#url}\" target=\"_blank\"><strong>{#sortName}</strong></a>\r\n{#lb2}");
ListBuilder lb2=new ListBuilder("ul");
lb2.SetTemplate("<a href=\""+url+"?tid={#id}"+"\" target=\"_blank\">{#title}</a> <span class='date'>[{#date}]</span>");
lb2.BindData(dt2);
或者
lb1.AddTemplateData("sortName",dr["sortName"].ToString());
lb1.AddTemplateData("url",url+"#sid."+dr["id"].ToString()+"/page.1/");
lb1.AddTemplateData("lb2",lb2.ToString());
lb1.EndTemplateData();
lSitemap.Text=lb1.ToString();
*/
public class ListBuilder
{
protected string type = "dl";
protected StringBuilder sb = new StringBuilder();
protected string template = string.Empty;
protected System.Collections.Specialized.NameValueCollection nvc = new System.Collections.Specialized.NameValueCollection();
/// <summary>
/// 构造函数
/// </summary>
/// <param name="_type">列表类型,可选"ul","dl",默认"ul"</param>
/// <param name="className"></param>
public ListBuilder(string _type, string className)
{
if (_type != string.Empty) type = _type;
if (className != string.Empty) className = " class='" + className + "'";
sb.Append("<" + type + className + ">");
}
/// <summary>
/// 以ul构造列表
/// </summary>
public ListBuilder()
{
sb.Append("<dl>");
}
/// <summary>
/// 构造函数
/// </summary>
/// <param name="_type">列表类型,可选"ul","dl",默认"ul"</param>
public ListBuilder(string _type)
后面还有 212 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。