日期:2014-05-17 浏览次数:20688 次
string str = "#0||1.txt||0.00 KB||~/Upload/FileUpload20121007073636062.txt||file-0#0||2.txt||0.00 KB||~/Upload/FileUpload20121007073640375.txt||file-1"; var query = str.Split('#', StringSplitOptions.RemoveEmptyEntries).Select(x => x.Split(new string[] { "||" }, StringSplitOptions.RemoveEmptyEntries)).Select(x => new { filename = x[1], size = x[2], path = x[3], fileid = x[4] }); foreach (var item in query) { Response.WriteLine(item.filename); Response.WriteLine(item.size); ... }