Commands/frmCheckForUpdate.cs

(开头部分) 7KB

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

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using ImageGlass.Feature;
using System.IO;
using System.Threading;
using System.Diagnostics;

namespace igcmd
{
    public partial class frmCheckForUpdate : Form
    {
        public frmCheckForUpdate()
        {
            InitializeComponent();
        }
        private void btnClose_Click(object sender, EventArgs e)
        {
            if (File.Exists("C:\\ImageGlass-Update.txt")) File.Delete("C:\\ImageGlass-Update.txt");
            Application.Exit();
        }


        private void frmMain_Load(object sender, EventArgs e)
        {
            ThemeConfig.RenderTheme r = new ThemeConfig.RenderTheme();
            r.ApplyTheme(lv);

            lblStatus.Text = "Connecting to server, please wait...";
            Thread t = new Thread(new ThreadStart(CheckForUpdate));
            t.Priority = ThreadPriority.BelowNormal;
            t.IsBackground = true;
            t.Start();
        }
            

        //download failed
        void d_FileDownloadFailed(Exception ex)
        {
            lblStatus.Text = "Can not connect to server";
            picStatus.Image = igcmd.Properties.Resources._del_2;
            lv.Enabled = false;
        }

        //download complete
        void d_FileDownloadComplete()
        {
            if (File.Exists("C:\\ImageGlass-Update.txt"))
            {
                FileVersionInfo f;
                StreamReader r = new StreamReader("C:\\ImageGlass-Update.txt");
                List<string> ds = new List<string>();
                int c = 0;//dem so luong can update

                while (!r.EndOfStream)
                {
后面还有 148 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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