开源一个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);
相关文档:
如何运用 Form 表单认证
ASP.NET 的安全认证,共有“Windows”“Form”“Passport”“None”四种验证模式。“Windows”与“None”没有起到保护的作用,不推荐使用;“Passport”我又没用过,唉……所以我只好讲讲“Form”认 ......
1、直接在前台调用 javascript 函数
很简单,在 head 元素之间加入 script 元素,将 type 元素设置为 " text/javascript "
如:
<head runat="server">
<script type="text/javascript" >
function ShowName(str)
{
alert("您的名字为:("+str+")");
}
</script>
<title> ......
一、上传图片:
将图片存储在image文件夹中,然后把图片的路径存在数据库里,这样用的时候从数据库中搜索出路径然后绑定在前台页面的<image/>标签中,就能显示我们想要的图片。
前台代码:
商品图片:<asp:FileUpload ID="ImageUpload" runat="server" />
<asp:Label ID="TipF ......
<mce:script language=javascript><!--
//注册命名空间
Type.registerNamespace("Demo");
Demo.Message=function(content,publishTime)
{
this._content = content;
this._publishTime = publishTime;
}
Dem ......