我正在尝试使用c#http模块从网页中删除数据。我只想要原始文本和图片。我该如何剥去其他所有东西?
private static Regex reg = new Regex(@"<img src=\t????????");
public override void Write(byte[] buffer, int offset, int count)
{
byte[] data = new byte[count];
Buffer.BlockCopy(buffer, offset, data, 0, count);
string html = System.Text.Encoding.Default.GetString(buffer);
html = reg.Replace(html, string.Empty);
byte[] outdata = System.Text.Encoding.Default.GetBytes(html);
_sink.Write(outdata, 0, outdata.GetLength(0));
}