标签:
void writeData(string str,string file)
{
string parth = Application.dataPath;
StreamWriter streamWriter;
FileInfo fi = new FileInfo(parth+file);
if (!fi.Exists)
streamWriter = fi.CreateText();
else
streamWriter = fi.AppendText();
streamWriter.WriteLine(str);
streamWriter.Close();
streamWriter.Dispose();
}
ArrayList loadfile(string path,string name)
{
StreamReader sr = null;
try{
sr = File.OpenText(name);
}catch{}
string line;
ArrayList arra = new ArrayList();
while((line = sr.ReadLine())!= null)
{
arra.Add(line);
}
sr.Close();
sr.Dispose();
return arra;
}
标签:
原文地址:http://www.cnblogs.com/943711466qq/p/4377168.html