1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ClassLibrary1
{
public class Class1
{
StreamWriter F;
public Class1(string path)
{
this.F = new StreamWriter(path);
}
public void Log1(string str1, string str2)
{
int ttl = str1.Length + str2.Length + 3;
Console.WriteLine("".PadLeft(ttl, '-'));
Console.WriteLine(str2 + " : " + str1);
Console.WriteLine("".PadLeft(ttl, '-'));
}
public void log2(string str1, string str2)
{
int ttl = str1.Length + str2.Length + 3;
Console.WriteLine("".PadLeft(ttl, '='));
Console.WriteLine(str2 + " : " + str1);
Console.WriteLine("".PadLeft(ttl, '='));
}
public void log3(string str1, string str2)
{
F.WriteLine(str2 + " : " + str1);
}
public void log4(string str1, string str2)
{
String strDate = System.DateTime.Now.ToString("yyyy.MM.dd HH:mm:ss >");
F.WriteLine(strDate + str2 + " : " + str1);
}
~Class1()
{
F.Close();
}
}
} |
Partager