利用正规表达式,读取Discuz帖子中的附件,思路如下:
var rg = new Regex(@"(?<=\[attach\]).*?(?=\[/attach\])");
var mMatchCollection = rg.Matches(mContent);
for (var j = 0; j < mMatchCollection.Count; j++)
{
var sSql = "select attachment from cdb_attachments where aid="+mMatchCollection[j].Value;
}