Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
Error.cs
Package: UDS1.1_51aspx.rar [view]
Upload User: cha0314
Upload Date: 2014-03-02
Package Size: 12522k
Code Size: 1k
Category:
CSharp
Development Platform:
C#
- using System;
- using System.Diagnostics;
- using System.IO;
- namespace UDS.Components
- {
- /// <summary>
- /// 错误处理函数,用于记录错误日志
- /// </summary>
- public class Error {
- //记录错误日志位置
- private const string FILE_NAME = "c:\udslog.txt";
- /// <summary>
- /// 记录日志至文本文件
- /// </summary>
- /// <param name="message">记录的内容</param>
- public static void Log(string message) {
- if(File.Exists(FILE_NAME))
- {
- StreamWriter sr = File.AppendText(FILE_NAME);
- sr.WriteLine ("n");
- sr.WriteLine (DateTime.Now.ToString()+message);
- sr.Close();
- }
- else
- {
- StreamWriter sr = File.CreateText(FILE_NAME);
- sr.Close();
- }
- }
- }
- }