ZengCode.Com (The Thai Php Framework)  


Home   Download   Manual   About us    

Facebook   


MAIN MENU
เขียนโปรแกรมบน iPhone ด้วย MonoTouch
News
Php Tips
Ubuntu
Spring+Strut+Hibernate
Android Programming
Design Pattern By PHP
C# Design Pattern
Linux Quick Tips
C# Tips & Technique
C# using Linq น่าใช้จริงๆ
Java & JavaScript Tips
MAVEN
Database & SQL
ZengCode Framework Guide
Mac OSx
Zeng Code Code
Programming
IPhone (Tips and Trick)

Download เอกสารที่น่าสนใจ

     มี DLL สำหรับเขียน Log มาฝากครับ   (2010-02-16)

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using ZCLogger;

namespace TestSolution
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Logger.writeLog = true;  //default is true    true= write log file , false = not write log file
            Logger.debugMode = true; //default is flase   true=write debug log, false = not write debug log
           

            Logger.loggerPath = "C://Logs";
            Logger.PutLog("Info", 0, "test info");
            Logger.PutLog("Info", 100, "test info");
            Logger.PutLog("Info", 2, "test info");

            Logger.PutLog("Exception", 0, "test Exception");
            Logger.PutLog("Exception", 100, "test Exception");
            Logger.PutLog("Exception", 2, "test Exception");

            Logger.PutLog("SQL", 0, "Test SQL LOG");
            Logger.PutLog("SQL", 100, "Test SQL LOG");
            Logger.PutLog("SQL", 2, "Test SQL LOG");
            Logger.PutLog("sql", 2, "Test SQL LOG");

            Logger.PutLog("Debug", 0, "Test Debug LOG");
            Logger.PutLog("Debug", 0, "Test Debug LOG");
            Logger.PutLog("Debug", 0, "Test Debug LOG");
        }
    }
}

ผมพัฒนาด้วย C# นะครับเขียนแบบง่าย ๆ ไม่อยากใช้ของใคร อ่ะ
parameter ตัวแรกคือ Log type เพิ่มเติมได้จำนวนไม่จำกัดนะครับ(case insensitive)  Log จะเขียนชื่อไฟล์ดังตัวอย่างนี้เช่น

Logger.PutLog("SQL", 2, "Test SQL LOG");
Logger.PutLog("sql", 2, "Test SQL LOG");

======> yyyy-MM-dd_SQL.log  เป็นต้น

Download DLL CLICK


Comment

Online Poker  (14 ตุลาคม 2553)   
IP : 95.168.183.233
I always motivated by you your opinion and way of thinking again thanks for this nice post. - Joe


ZengCode  (19 กุมภาพันธ์ 2553)   
IP : 58.137.188.243

Logger.loggerPath = "C://Logs";
            Logger.PutLog("Info" 0 "test info");
            Logger.PutLog("Info" 100 "test info");
            Logger.PutLog("Info" 2 "test info");

            Logger.PutLog("Exception" 0 "test Exception");
            Logger.PutLog("Exception" 100 "test Exception");
            Logger.PutLog("Exception" 2 "test Exception");

            Logger.PutLog("SQL" 0 "Test SQL LOG");
            Logger.PutLog("SQL" 100 "Test SQL LOG");
            Logger.PutLog("SQL" 2 "Test SQL LOG");
            Logger.PutLog("sql" 2 "Test SQL LOG");

            Logger.PutLog("Debug" 0 "Test Debug LOG ภาษาไทยได้ไหมเนี้ย เห่อๆๆๆๆๆๆ");
            Logger.PutLog("Debug" 0 "Test Debug LOG");
            Logger.PutLog("Debug" 0 "Test Debug LOG");


Name
Comment
Security CodeCAPTCHA Image

web hit counter

This page took 0.084526 seconds to load.