我现在想读取资源文件temp.doc并且在bin目录下生成“临时文件.doc”文件,我用stringreader一直是乱码,查了下资料说是要用Microsoft.Office.Interop.Word,我看了下其好像没用方法是从文件流里读取文件
问题补充:
我的代码
using (StreamReader sr = new StreamReader(this.GetType().Assembly.
GetManifestResourceStream(this.GetType(), "EmailTemplate." + fileName), Encoding.Default))
{
string content = sr.ReadToEnd();
using (StreamWriter sw = new StreamWriter(file.Create(), Encoding.GetEncoding("gb2312")))
{
sw.Write(content);
}
}