初始化

This commit is contained in:
2025-11-20 15:56:30 +08:00
commit ab6e620f8e
154 changed files with 29677 additions and 0 deletions

37
BLWWS/Common.cs Normal file
View File

@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Web;
namespace BLWWS
{
public class Common
{
public static string MD5Encrypt(string str)
{
MD5CryptoServiceProvider md5Hasher = new MD5CryptoServiceProvider();
byte[] hashedDataBytes;
hashedDataBytes = md5Hasher.ComputeHash(Encoding.UTF8.GetBytes(str));
StringBuilder tmp = new StringBuilder();
foreach (byte i in hashedDataBytes)
{
tmp.Append(i.ToString("x2"));
}
return tmp.ToString();
}
public static long GetCurrentTimeStamp(DateTime dt)
{
TimeSpan ts = dt - new DateTime(1970, 1, 1, 8, 0, 0, DateTimeKind.Local);
long current_timestamp = Convert.ToInt64(ts.TotalSeconds);
return current_timestamp;
}
public static DateTime GetCurrentDateTime(long timestampseconds)
{
DateTime epoch = new DateTime(1970, 1, 1, 8, 0, 0, DateTimeKind.Local);
DateTime utcTime = epoch.AddSeconds(timestampseconds);
return utcTime;
}
}
}