//读取txt文件的内容
public static string GettfCount(string strfile)
{
string strout;
strout = "";
if (!File.Exists(System.Web.HttpContext.Current.Server.MapPath(strfile)))
{
strout = "文件出错!联系管理员";
}
else
{
StreamReader sr = new StreamReader(System.Web.HttpContext.Current.Server.MapPath(strfile), System.Text.Encoding.Default);
String input = sr.ReadToEnd();
sr.Close();
strout = input;
}
return strout;
}
//重写
public static void addTFCount(string strfile,string value)
{
string path = System.Web.HttpContext.Current.Server.MapPath(strfile);
FileStream fs = new FileStream (path,FileMode.OpenOrCreate,FileAccess.Write);
StreamWriter m_streamWriter = new StreamWriter(fs, System.Text.Encoding.GetEncoding("utf-8"));
m_streamWriter.Write(value);
m_streamWriter.Flush();
m_streamWriter.Close();
}