日期:2014-05-17 浏览次数:20740 次
StreamReader fread = new StreamReader(Server.MapPath("count.txt"), System.Text.Encoding.Default);
string oldString = fread.ReadToEnd().Trim();
string newString = "0";
fread.Close();
fread.Dispose();
if (!string.IsNullOrEmpty(oldString))
{
newString = (Convert.ToInt64(oldString) + 1).ToString();
}
StreamWriter sw = new StreamWriter(Server.MapPath("count.txt"), false, System.Text.Encoding.Default);
sw.Write(newString);
sw.Close();
sw.Dispose();