本文整理汇总了C#中CLogger.Log方法的典型用法代码示例。如果您正苦于以下问题:C# CLogger.Log方法的具体用法?C# CLogger.Log怎么用?C# CLogger.Log使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CLogger
的用法示例。
在下文中一共展示了CLogger.Log方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Log
public static void Log(CLogger logger, LogType logType, LogLevel logLevel, string header, string message, LogType defaultLogType)
{
try {
if (logger != null) {
logger.Log(logType, logLevel, header + " : " + message);
return;
}
} catch {
}
Log(logger, logType, logLevel, header, message);
}
示例2: virusFound
static void virusFound(ref CustomBase.Rec r, String line)
{
int file = 0;
String[] arr = new String[100];
arr = line.Split(',');
for (int i = 1; i < arr.Length; i++)
{
//
string[] temp = new String[100];
string[] temp2 = new String[100];
Boolean b;
b = arr[i].Contains("Event time");
if (b == false)
{
//tüm par için
temp = arr[i].Split(':');
// temp kontrolü : olmayan satýrlar için
if (temp.Length > 1)
{
Allocate2(ref r, temp[0], temp[1].TrimEnd());
if (temp[0] == "Occurrences")
{
file = i;
}
}
}
else if (b == true)
{
//dateandtime için sadece
//2009-03-09 09:00:00
temp2 = SpaceSplit(arr[i], false);
String date = temp2[2].Trim().Replace('-', '/') + " " + temp2[3].Trim();
DateTime dt = Convert.ToDateTime(date);
r.Datetime = dt.AddMinutes(zone).ToString("yyyy/MM/dd HH:mm:ss");
CLogger L2 = new CLogger();
L2.Log(LogType.FILE, LogLevel.DEBUG, "date" + date);
}
}
//virus file
r.CustomStr10 = arr[file + 1];
}
示例3: dateandtime
static String dateandtime(String w3, String w4, String w5)
{
//String dType = arr[3] + " " + arr[4] + " " + arr[5];
String mounth, day, year, time;
day = w4;
time = w5;
year = DateTime.Now.Year.ToString();
switch (w3)
{
case "Jan":
mounth = "01";
break;
case "Feb":
mounth = "02";
break;
case "Mar":
mounth = "03";
break;
case "Apr":
mounth = "04";
break;
case "May":
mounth = "05";
break;
case "Jun":
mounth = "06";
break;
case "Jul":
mounth = "07";
break;
case "Aug":
mounth = "08";
break;
case "Sep":
mounth = "09";
break;
case "Oct":
mounth = "10";
break;
case "Nov":
mounth = "11";
break;
case "Dec":
mounth = "12";
break;
default:
mounth = DateTime.Now.Month.ToString();
break;
}
String dType = mounth + "/" + day + "/" + year + " " + time;
Boolean dtError = false;
DateTime dt = DateTime.MinValue;
try
{
dt = Convert.ToDateTime(dType);
}
catch
{
dtError = true;
}
if (dtError)
{
try
{
dType = day + "/" + mounth + "/" + year + " " + time;
dt = Convert.ToDateTime(dType);
}
catch
{
return "";
}
}
dType = dt.AddMinutes(zone).ToString("yyyy/MM/dd HH:mm:ss");
CLogger L2 = new CLogger();
L2.Log(LogType.FILE, LogLevel.DEBUG, "date" + dType);
return dType;
}
示例4: GetName
/// <summary>
/// The method converts SID string (user, group) into object name.
/// Bu fonksiyon 06.08.2012 tarihinde Hazine Müsteþarlýðýnda bulunan sistemdeki
/// SID(Security Id)'leri anlamlý olan name'e translate etmek amacý ile Onur Sarýkaya tarafýndan eklenmiþtir.
/// </summary>
/// <param name="name">SID string.</param>
/// <returns>Object name in form domain\object_name.</returns>
public static String GetName(CLogger L, string sid)
{
try
{
return new System.Security.Principal.SecurityIdentifier(sid).Translate(
typeof(System.Security.Principal.NTAccount)).ToString();
}
catch (Exception exception)
{
if (L != null)
L.Log(LogType.FILE, LogLevel.ERROR, "Error on GetName: " + exception.Message);
//WriteMessage("GetName Error: " + exception.Message);
return sid;
}
}