1.读取txt文件代码:
///<summary>
///读取txt文件
///</summary>
public void ReadTextContent()
{
string Path = @"E:\PDF\123.txt";
string strTxt = "";
StreamReader sr = new StreamReader(Path, Encoding.Default);
string content;
while ((content = sr.ReadLine()) != null)
{
strTxt += content.ToString();
}
int i1 = strTxt.IndexOf("<RetPDFStr>") + 11;
int i2 = strTxt.IndexOf("</RetPDFStr>");
int i3 = i2 - i1;
strTxt = strTxt.Substring(i1, i3);
}