C#转换集合类型为html源码输出

把代码过程中经常用的内容做个珍藏,如下资料是关于C#转换集合类型为html输出的代码。
public static string ToHTML(Hashtable hashtable) {
string tmp = "";
IDictionaryEnumerator myEnumerator = hashtable.GetEnumerator();
while ( myEnumerator.MoveNext() ) {
tmp += "<br />" + myEnumerator.Key+", "+ myEnumerator.Value;
}
return tmp;
}
public static string ToHTML(ArrayList arrayList) {
foreach ( Object o in arrayList ) {
tmp.Append("<br />" + o);
}
return tmp.ToString();
}

猜你喜欢

转载自blog.51cto.com/14152780/2342463
今日推荐