我有一个CSV文件,我抓住了&将其转换为Stream。我需要一种方法来修改标头而不将流转换为字符串。有办法吗?
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream resStream = response.GetResponseStream();
//need to update stream here & continue with the CSV reader
using (CsvReader csv = new CsvReader(new StreamReader(resStream), true))
{
//other code
}
答案 0 :(得分:1)
从StreamReader派生自己的类并覆盖用于读取它的函数,插入正确的行为。