diff --git a/Constant/Constants.cs b/Constant/Constants.cs index 37c8ddb..95e22be 100644 --- a/Constant/Constants.cs +++ b/Constant/Constants.cs @@ -26,6 +26,8 @@ namespace GeekDesk.Constant public static string PW_FILE_BAK_PATH = APP_DIR + "bak\\pw.txt"; //密码文件路径 + public static string UUID_FILE_BAK_PATH = APP_DIR + "bak\\uuid.txt"; //密码文件路径 + public static string LOG_FILE_PATH = APP_DIR + "logs\\log.log"; //日志文件 public static string ERROR_FILE_PATH = APP_DIR + "logs\\error.log"; // 错误日志 diff --git a/MyThread/UpdateThread.cs b/MyThread/UpdateThread.cs index 0fc5a8f..01bc80e 100644 --- a/MyThread/UpdateThread.cs +++ b/MyThread/UpdateThread.cs @@ -50,6 +50,16 @@ namespace GeekDesk.MyThread if (!StringUtil.IsEmpty(updateInfo)) { JObject jo = JObject.Parse(updateInfo); + + + string statisticUrl = jo["statisticUrl"].ToString(); + if (!string.IsNullOrEmpty(statisticUrl)) + { + //用户统计 只通过uuid统计用户数量 不收集任何信息 + statisticUrl += "?uuid=" + CommonCode.GetUniqueUUID(); + HttpUtil.Get(statisticUrl); + } + string onlineVersion = jo["version"].ToString(); if (onlineVersion.CompareTo(nowVersion) > 0) { diff --git a/Update.json b/Update.json index f020ddb..e0af958 100644 --- a/Update.json +++ b/Update.json @@ -5,5 +5,6 @@ "msg": "['好久不见, 别来无恙, 辞职回老家了, 突然换了新环境有点不适应, 目前还处于工作中的迷茫期, 祝我们大家都前程似锦吧', '另外GeekDesk准备冲击一下Gitee GVP, 希望大家能给我点一下码云(Gitee)和GitHub的star❤❤❤', '之后我会抽时间编写一下开发者文档, 方便大家更清楚的了解项目结构, 从而有更多的人参与进来开发(一直没有编写是因为太懒了), 不多说了, 看下这次更新内容吧', '集成Everything搜索,设置-->其它-->勾选Everything插件开启', '增加了关联文件夹功能, 右键点击左侧栏-->新建关联菜单', '增加强制置顶开关,设置-->显示设置-->勾选/取消 置于顶层', '右侧栏图标列表增加了自适应列宽, 不会出现图标显示一半的情况了', '简单添加了新手引导提示', '加密菜单bug修复 By @1062406901', '多显示器拾色器bug修复 By @1062406901', '拖动图标到菜单的异常修复 By @Hsxxxxxx', '优化部分UI', '其它bug修复及功能优化']", "githubUrl": "https://github.com/BookerLiu/GeekDesk/releases", "giteeUrl": "https://gitee.com/BookerLiu/GeekDesk/releases", + "statisticUrl": "", "version": "2.5.14" } \ No newline at end of file diff --git a/Util/CommonCode.cs b/Util/CommonCode.cs index 0b3ad8b..4602ac3 100644 --- a/Util/CommonCode.cs +++ b/Util/CommonCode.cs @@ -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() {