protected void GetVistorCount()
{
try
{
string path = @Server.MapPath("App_Data/VisitorCount.txt");
string text = System.IO.File.ReadAllText(path);
int number = Convert.ToInt32(text);
new FileInfo(path).Attributes = FileAttributes.Normal;
System.IO.File.WriteAllText(path,Convert.ToString(number+1));
labVisitor.Text = number.ToString();
}catch( Exception e)
{
}
}
C# 读取记事本文件
最新推荐文章于 2024-05-31 16:18:54 发布