/// <summary> /// 异步检查版本号 /// </summary> /// <param name="plugin">要执行检查的插件</param> public static void Check(DMPlugin plugin) { new System.Threading.Thread(() => { try { var versionChecker = new VersionChecker("SendDanmaku"); if (versionChecker.FetchInfo()) { if (versionChecker.hasNewVersion(plugin.PluginVer)) { plugin.Log("插件有新版本了!最新版本:" + versionChecker.Version + ",当前版本" + plugin.PluginVer + ",更新时间:" + versionChecker.UpdateTime.ToString("yyyy.MM.dd") + "\r\n" + "下载地址:" + versionChecker.WebPageUrl); } } else { plugin.Log("版本检查失败:" + versionChecker.lastException.Message); } } catch (Exception) { }// 以防万一 }) { Name = "VersionChecker", IsBackground = true }.Start(); }
public SendDanmakuMain() { if (self == null) { self = this; } else { throw new InvalidOperationException(); } this.PluginName = "弹幕发送"; this.PluginDesc = "使用弹幕姬快速发送弹幕"; this.PluginAuth = "宅急送队长"; this.PluginCont = "私信15253直播间主播或弹幕姬群内私聊"; this.PluginVer = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(3); VersionChecker.Check(this); }