public byte[] Read() { try { IOAid io = new IOAid(cerName); zBytes = io.ReadByteText(); } catch { } return ZBytes; }
/// <summary> /// /// </summary> /// <param name="text"></param> /// <returns></returns> public bool TxtWeekLog(string text) { try { IOAid io = new IOAid(); io.FilePath = path + "Log"; if (io.CreateDirectory(io.FilePath)) { DateTime dtnow = DateTime.Now; io.FileName = GetWeekOfYear().ToString(); io.FileFullPath = io.FilePath + "\\" + io.FileName; io.CreateFile(io.FileFullPath, false); string headDes = io.FileName + dtnow.Hour.ToString() + dtnow.Minute.ToString() + dtnow.Second.ToString() + dtnow.Millisecond.ToString(); io.AppendLineText(headDes + "······" + text); zBool = true; } } catch { } return ZBool; }
/// <summary> /// /// </summary> /// <param name="text"></param> /// <returns></returns> public bool TxtSeasonLog(string text) { try { IOAid io = new IOAid(); io.FilePath = path + "Log"; if (io.CreateDirectory(io.FilePath)) { DateTime dtnow = DateTime.Now; switch (dtnow.Month) { case 1: io.FileName = "spring"; break; case 2: io.FileName = "spring"; break; case 3: io.FileName = "spring"; break; case 4: io.FileName = "summer"; break; case 5: io.FileName = "summer"; break; case 6: io.FileName = "summer"; break; case 7: io.FileName = "autumn"; break; case 8: io.FileName = "autumn"; break; case 9: io.FileName = "autumn"; break; case 10: io.FileName = "winter"; break; case 11: io.FileName = "winter"; break; case 12: io.FileName = "winter"; break; } io.FileFullPath = io.FilePath + "\\" + io.FileName; io.CreateFile(io.FileFullPath, false); string headDes = io.FileName + dtnow.Hour.ToString() + dtnow.Minute.ToString() + dtnow.Second.ToString() + dtnow.Millisecond.ToString(); io.AppendLineText(headDes + "······" + text); zBool = true; } } catch { } return ZBool; }
/// <summary> /// /// </summary> public LogAid() { IOAid io = new IOAid(); path = io.GetRootPath(); }
public bool CreateXML(string file, string name) { try { xmlFile = file; IOAid io = new IOAid(); io.CreateFile(xmlFile, true); xe = xd.CreateElement(name); xd.AppendChild(xe); zBool = true; } catch { } return ZBool; }