excel/Autoupdate/AutoUpdateHelper.cs
(开头部分) 1KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Net;
public static class AutoUpdateHelper
{
public static AutoUpdateConfig GetConfig()
{
try
{
System.IO.Directory.CreateDirectory(AppDomain.CurrentDomain.BaseDirectory);
//if (!File.Exists(AppDomain.CurrentDomain.BaseDirectory + @"AutoUpdateConfig.json"))
//{
// //如果配置文件不存在 直接从服务器下载
// using (var wc = new WebClient())
// {
// wc.DownloadFile(new Uri("https://98888888.gitee.io/smalltools/excel/Finpublish/AutoUpdateConfig.json"), "AutoUpdateConfig.json");
// //wc.DownloadFileCompleted += Wc_DownloadFileCompleted;
// }
//}
}
finally {
}
var json = File.ReadAllText(AppDomain.CurrentDomain.BaseDirectory + @"AutoUpdateConfig.json");
return Newtonsoft.Json.JsonConvert.DeserializeObject<AutoUpdateConfig>(json);
}
private static void Wc_DownloadFileCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
{
var a = 1;
}
public static AutoUpdateConfig GetConfig(string url)
{
using (var wc = new WebClient())
{
return Newtonsoft.Json.JsonConvert.DeserializeObject<AutoUpdateConfig>(wc.DownloadString(new Uri(url)));
}
}
}
public class AutoUpdateConfig
{
/// <summary>
///
/// </summary>
public string Version { get; set; }
/// <summary>
///
/// </summary>
后面还有 14 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
