You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using demo.ClassHelper;
|
|
|
|
|
using demo.ClassHelper.FileOperate;
|
|
|
|
|
|
|
|
|
|
namespace demo.Recode
|
|
|
|
|
{
|
|
|
|
|
class CycleTime:FileBase
|
|
|
|
|
{
|
|
|
|
|
private static CycleTime cycleTime = new CycleTime();
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 创建一个静态实例
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static CycleTime Instance
|
|
|
|
|
{
|
|
|
|
|
get { return cycleTime; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public CycleTime()
|
|
|
|
|
{
|
|
|
|
|
StrFileName = DateTime.Now.ToString("yyyyMMdd") + ".txt";
|
|
|
|
|
StrDirPath = @"d:" +
|
|
|
|
|
"\\Recode\\CycleTime\\";
|
|
|
|
|
StrFilePath = StrDirPath + StrFileName;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void WriteMsg(string strValue)
|
|
|
|
|
{
|
|
|
|
|
//如果文件夹不存在则创建
|
|
|
|
|
if (!IsDirExist())
|
|
|
|
|
{
|
|
|
|
|
CreateDir();
|
|
|
|
|
}
|
|
|
|
|
string strMotoLogFileValue = DateTime.Now.ToString() + " " + strValue;
|
|
|
|
|
WriteFile(strMotoLogFileValue, true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|