c# 读取office 2003 文件文本内容
来源:百度知道 编辑:UC知道 时间:2024/05/07 10:59:21
c# 读取office 2003 文件文本内容
是office 2003 文件,.doc文件
2楼的方法对.doc文件没用,doc文件不是这样取值的
是office 2003 文件,.doc文件
2楼的方法对.doc文件没用,doc文件不是这样取值的
using System.IO;
string text = "";
using (StreamReader reader = new StreamReader("D:\\a.doc"))
{
string line = reader.ReadToEnd();
}
using System.IO;
private string readTxt(string txtPath)
{
string content = "";
using (StreamReader sr = File.OpenText(txtPath)
{
string input = "";
while ((input = sr.ReadLine()) != null)
{
content += input;
}
sr.Close();
}
return content;
}
不能用IO流读取吗???