Update/Program.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Windows;
using System.Windows.Forms;
using Update.Common.Class;
using Update.UI.Main.Windows;

namespace Update
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            AppDomain.CurrentDomain.AssemblyResolve += (sender, arga) =>
            {
                String projectName = Assembly.GetExecutingAssembly().GetName().Name.ToString();
                using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(projectName + ".ICSharpCode.SharpZipLib.dll"))
                {
                    Byte[] b = new Byte[stream.Length];
                    stream.Read(b, 0, b.Length);
                    return Assembly.Load(b);
                }
            };

            
            App app = new App();
            app.InitializeComponent();
            args = new string[] { "update;http://www.elow.online:8080/version/" };
            //args = new string[] { "update;http://www.elow.online:8080/version/" };
            if (args == null || args.Length == 0 || string.IsNullOrEmpty(args[0]))
            {
                Main_Windows_SetupProcess windows = new Main_Windows_SetupProcess();
                app.MainWindow = windows;
                windows.Show();
            }
            else
            {
                


                ///传递来的参数是一个 字符串 update;http://url 的结构
                ///下面判定如果不是这个结构的都认为错误关闭更新程序
                List<string> list = args[0].Split(';').ToList();
                if(list == null || list.Count!=2||list[0]!="update")
                {
                    System.Windows.Application.Current.Shutdown();
                }
                //获取读取更新信息的url地址
                Global.VersionUrl = list[1];

                Main_Windows_SetupProcess windows = new Main_Windows_SetupProcess();
                app.MainWindow = windows;
                windows.Show();
            }

            app.Run();
后面还有 4 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。