C# log Helper
using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using System.Web; namespace Common
{
public class LogHelper : System.Web.UI.Page
{
private static HttpContext myContext = HttpContext.Current;
/// <summary>
/// 写日志
/// </summary>
/// <param name="Path"></param>
/// <param name="InfoStr"></param>
public static void WriteLog(string InfoStr)
{
System.IO.StreamWriter sw = new System.IO.StreamWriter(myContext.Server.MapPath("/log/cps_log" + DateTime.Now.ToString("yyyyMMdd") + ".txt"), true, System.Text.Encoding.UTF8);
sw.WriteLine(DateTime.Now);
sw.WriteLine(InfoStr);
sw.WriteLine("");
sw.Close();
sw.Dispose();
}
}
}
C# log Helper的更多相关文章
- 对象key值排序,以key值(数字)大小顺序遍历属性,helper._sort()
var helper = { _sort:function(data){ //{“20141216”:{},“20141217”:{}}按大小排序, var arr1 = [],arr2=[]; fo ...
- javascript设计模式-抽象工厂模式
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- javascript设计模式-生成器模式(Builder)
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- javascript设计模式-迭代器模式(Iterator)
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- javascript设计模式--中介者模式(Mediator)
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- javascript设计模式--状态模式(State)
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- Handlebars的基本用法
使用Handlebars,你可以轻松创建语义化模板,Mustache模板和Handlebars是兼容的,所以你可以将Mustache导入Handlebars以使用 Handlebars 强大的功能. ...
- thu-learn-lib 开发小记(转)
原创:https://harrychen.xyz/2019/02/09/thu-learn-lib/ 今天是大年初五,原本计划出门玩,但是天气比较糟糕就放弃了.想到第一篇博客里面预告了要给thu-le ...
- log4net修改数据库连接字符串和写自定义信息
最近项目需要用log4net来写日志,因为整个平台式在sharepoint上,我们需要记录具体是哪个子站点发生的日志,因此需要再原来的log表里面添加一个自定义信息列.由于平台的安全性要求,我们需要对 ...
随机推荐
- PowerShell3.0中,所有的命令
Get-Command * >> cmd.txt CommandType Name ModuleName ----------- ---- ---------- Alias % -> ...
- Check whether a given Binary Tree is Complete or not 解答
Question A complete binary tree is a binary tree in which every level, except possibly the last, is ...
- apacheOfbiz
一.ofbiz 用自身数据库安装 1. 由 binary 安装: 由 binary 安装非常简单, 以下是安装方法: 下载ofbiz-2.0-beta1-complete.tar.gz, 注意不是of ...
- [转载]C宏定义的小结
FROM:http://blog.csdn.net/sunboy_2050/article/details/6103530 实现代码实例 程序代码: #include <stdio.h> ...
- Linux查看系统信息
系统 # uname -a # 查看内核/操作系统/CPU信息 # head -n 1 /etc/issue # 查看操作系统版本 # cat /proc/cpuinfo # 查看CPU信息 # ho ...
- 格而知之16:我所理解的Block(3)
23.在前文中的例子中,Block结构体里的isa指针还没有详细讲解,这个指针都被置向了_NSConcreteStackBlock,它标识了Block的类型. 其实除了_NSConcreteStack ...
- RelativeLayout经常使用属性介绍
以下介绍一下RelativeLayout用到的一些重要的属性: 第一类:属性值为true或false android:layout_centerHrizontal ...
- [置顶] 创建GitHub技术博客全攻略
[置顶] 创建GitHub技术博客全攻略 分类: GitHub2014-07-12 13:10 19710人阅读 评论(21) 收藏 举报 githubio技术博客网站生成 说明: 首先,你需要注册一 ...
- DataList、Repeater、GridView中的Checkbox取值问题
先看页面代码 <asp:DataList id="DataList1" runat="server" Width="100%" Rep ...
- iOS开发 ~应用程序设计理念:视图控制器(UIViewController)、视图(UIView)
应用程序设计理念:视图控制器(UIViewController).视图(UIView) 利用视图控制器(底层)管理视图(外观),一对一 1.视图的作用:负责显示的外观 2.视图控制器的作用:创建界面. ...