开源一个ASP.NET记录**.LOG的类
using System;
using System.Collections.Generic;
using System.Text;
namespace PublicClass
{
public static class Log
{
public static void WriteLine(string line)
{
try
{
System.Diagnostics.Debug.Assert((line != null), " public static void WriteLine(string line) line 不能为空!");
line = String.Format("#############{0}################## \r\n{{\r\n {1} \r\n}}\r\n", DateTime.Now.ToString(), line);
line += "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r\n\r\n\r\n";
line = "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r\n" + line;
lock (line)
{
//增加每一天记录一个Log文件
string FileName = string.Format("~/Sys_Log/{0}.log", DateTime.Now.ToString("yyyy-MM-dd"));
string FilePath=System.Web.HttpContext.Current.Request.MapPath(FileName);
相关文档:
在Web编程过程中,存在着很多安全隐患。比如在以前的ASP版本中,Cookie为访问者和编程者都提供了方便,并没有提供加密的功能。打开IE浏览器,选择“工具”菜单里的“Internet选项”,然后在弹出的对话框里单击“设置”按钮,选择“查看文件”按钮,在弹出的窗口中,就会显示硬盘里 ......
<%=%>绑定CS文件中的变量,有值的属性,或者有返回值的方法,
<%#%>一般式放在数据控件中绑定数据源表中的字段
<%=%><%#%>区别:
前者 是在页面之中使用.属于一段代码.有=号的就相当于response.write()这功能.和asp一样.
后者 是在页面中的服务器数据控件中绑定数据源的字段 ......
如果你已经有较多的面向对象开发经验,跳过以下这两步:
第一步 掌握一门.NET面向对象语言,C#或VB.NET 我强烈反对在没系统学过一门面向对象(OO)语言的前提下去学ASP.NET。 ASP.NET是一个全面向对象的技术,不懂OO,那绝对学不下去!
第二步 对.NET Framework类库有一定的了解 可以通过开发Windows Fo ......
OnClientClick="this.disabled=true;this.form.submit();" UseSubmitBehavior="False"在按钮属性中加入这段代码
this.btnSubmit.Attributes["onclick"] = this.GetPostBackEventReference(this.btnSubmit) + ";this.disabled=true;";
如果是提交是一个Button,可以使用javascript,设置为en ......