怎么去统计一篇文章被浏览的次数 和调文章字体的大小
解决方案 »
- 关于打印
- word 页眉页脚的设置
- [求助] Forms验证,怎样才算验证通过?我验证通过后,怎么又再次重定向回来了?
- GridView里面的值保存到另一个界面显示,怎么获取他的行列
- treeview问题
- 使用IE Web Controls的treeView时发生的运行时间错误
- ASP.Net(AJAX)传中文值问题
- 从excel表中用asp.net程序倒入到sql中出现的问题,就是数值类型的以字体串方式导入不进去,其余的都成功,不知是什么原因?
- VS2003能不能打开05开发的解决方案?
- 看看!!!如此倒分的行为!!!坚决反对!!
- 如何页面跳转时母板页中滚动条位置不变?
- Updatecommand更新结果返回影响值>0,但为什么数据还是没改变?
在page_load事件中,加个update 更新数据库中次数字段
通过字段的值在某个值范围内,用css来控制字体大小和颜色
function ContentSize(size)
{
var obj=document.getElementById("BodyLabel");
obj.style.fontSize=size+"px";
}
{
//string msg = "程序启动: " + DateTime.Now.ToString() + " \n" ;
//LogObject.WriteLogFile(msg);
int count = 0;
System.IO.StreamReader srd;
//获取文件路径
string file_path = Server.MapPath("~/num.txt");
srd = System.IO.File.OpenText(file_path);
while (srd.Peek() != -1)
{
string str = srd.ReadLine();
count = int.Parse(str);
}
srd.Close();
object obj = count;
Application["Counter"] = obj;
} void Application_End(object sender, EventArgs e)
{
//string msg = "程序关闭: " + DateTime.Now.ToString() + " \n";
//LogObject.WriteLogFile(msg);
}
void Application_Error(object sender, EventArgs e)
{
} void Session_Start(object sender, EventArgs e)
{
Session["SiteId"] = 1;
Session["username"] = null;
// Code that runs when a new session is started
UtilSerpent.SecurityHelper helper = UtilSerpent.SecurityHelper.NewInstance();
helper.StartProcessRequest(); Application.Lock();
//数据累加
int stat = 0;
stat = (int)Application["Counter"];
stat += 1;
object obj = stat;
Application["Counter"] = obj;
//写入文件
string file_path = Server.MapPath("~/num.txt");
System.IO.StreamWriter srw = new System.IO.StreamWriter(file_path, false);
srw.WriteLine(stat);
srw.Close();
Application.UnLock();
}这是我做的,大概这样就可以的