标签:
public List<string> ReadtxtInfo()
{
FileStream fs = new FileStream(System.Web.HttpContext.Current.Server.MapPath("/") + @"/AllowList.txt", FileMode.Open);
StreamReader m_streamReader = new StreamReader(fs);
m_streamReader.BaseStream.Seek(0, SeekOrigin.Begin);
List<string> Arrar1 = new List<string>();
string strLine = m_streamReader.ReadLine();
do
{
string[] split = strLine.Split(‘=‘);
string a = split[1];
Arrar1.Add(a);
strLine = m_streamReader.ReadLine();
} while (strLine != null && strLine != "");
m_streamReader.Close();
m_streamReader.Dispose();
fs.Close();
fs.Dispose();
return Arrar1;
}
标签:
原文地址:http://www.cnblogs.com/zxk3113/p/5231958.html