init commit all code

This commit is contained in:
路 范
2021-12-20 17:17:49 +08:00
parent 66d48149a6
commit f60ad763ed
1325 changed files with 1744918 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Getf.Service.Transfer.Client.WinService.Helpers
{
public class LogHelper
{
log4net.ILog MLog;
public LogHelper()
{
MLog = log4net.LogManager.GetLogger("Getf.Transfer.Client");
}
public void Debug(string msg)
{
MLog.Debug(msg);
}
public void Error(string msg)
{
MLog.Error(msg);
}
public void Error(Exception exception)
{
MLog.Error(exception.Message, exception);
}
public void Info(string msg)
{
MLog.Info(msg);
}
public void Warn(string msg)
{
MLog.Warn(msg);
}
}
}

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
namespace Getf.Service.Transfer.Client.WinService.Helpers
{
public static class Md5Helper
{
public static string Md5(string str)
{
MD5 md5 = MD5.Create();
byte[] data = Encoding.UTF8.GetBytes(str);
data = md5.ComputeHash(data);
StringBuilder sb = new StringBuilder();
for (int i = 0; i < data.Length; i++)
{
sb.Append(data[i].ToString("x2"));
}
return sb.ToString();
}
}
}

View File

@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Getf.Service.Transfer.Client.WinService.Helpers
{
public static class TypeHelper
{
public static DateTime ToDateTime(long timeStamp)
{
System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1)); // 当地时区
DateTime dt = startTime.AddSeconds(timeStamp);
return dt;
}
public static long GetTimeStamp()
{
System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1, 0, 0, 0, 0));
long t = (long)(DateTime.Now - startTime).TotalSeconds;
return t;
}
}
}