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();
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章