💩 添加用户统计代码

This commit is contained in:
BookerLiu
2023-04-19 22:19:44 +08:00
parent 08424b0db0
commit 9485b801b6
4 changed files with 48 additions and 0 deletions

View File

@@ -130,6 +130,41 @@ namespace GeekDesk.Util
}
}
private static string GeneraterUUID()
{
try
{
if (!File.Exists(Constants.UUID_FILE_BAK_PATH) || string.IsNullOrEmpty(GetUniqueUUID()))
{
using (StreamWriter sw = new StreamWriter(Constants.UUID_FILE_BAK_PATH))
{
string uuid = Guid.NewGuid().ToString() + "-" + Constants.MY_UUID;
sw.Write(uuid);
return uuid;
}
}
} catch (Exception) { }
return "ERROR_UUID_GeneraterUUID_" + Constants.MY_UUID;
}
public static string GetUniqueUUID()
{
try
{
if (File.Exists(Constants.UUID_FILE_BAK_PATH))
{
using (StreamReader reader = new StreamReader(Constants.UUID_FILE_BAK_PATH))
{
return reader.ReadToEnd().Trim();
}
} else
{
return GeneraterUUID();
}
} catch(Exception) { }
return "ERROR_UUID_GetUniqueUUID_" + Constants.MY_UUID;
}
public static void BakAppData()
{