• 大小: 320KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-05-13
  • 语言: C#
  • 标签: 倒计时  日期倒数  

资源简介

自己写的桌面倒计时软件,bug贼多,供大家参考吧。自己感觉用着还行,倒计时点重要的节点什么的。使用说明就没有了,自己看源码吧,代码也不多

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp2
{
    public partial class Display : Form
    {
        public Display()
        {
            InitializeComponent();
        }
        public struct Dis_LA
        {
            public string Text;
            public int Year;
            public int Mon;
            public int Day;
            public int Hour;
            public int Min;
            public string Date;
            public string Labe_text;
        }
        public static Dis_LA[] dis_la = new Dis_LA[5];
        public int Sum_LA = 0;

        private void Display_Load(object sender EventArgs e)
        {
            Rectangle rect = new Rectangle();
            rect = Screen.GetWorkingArea(this);            
            //读取配置文件到dis_la
            {
                dis_la[0].Text = Properties.Settings.Default.目标1;
                dis_la[1].Text = Properties.Settings.Default.目标2;
                dis_la[2].Text = Properties.Settings.Default.目标3;
                dis_la[3].Text = Properties.Settings.Default.目标4;
                dis_la[4].Text = Properties.Settings.Default.目标5;
                dis_la[0].Date = Properties.Settings.Default.时间1;
                dis_la[1].Date = Properties.Settings.Default.时间2;
                dis_la[2].Date = Properties.Settings.Default.时间3;
                dis_la[3].Date = Properties.Settings.Default.时间4;
                dis_la[4].Date = Properties.Settings.Default.时间5;
                for (int i = 0; i < 5; i++)
                {
                    DateTime date=Convert.ToDateTime(dis_la[i].Date);
                    dis_la[i].Year = date.Year;
                    dis_la[i].Mon = date.Month;
                    dis_la[i].Day = date.Day;
                    dis_la[i].Hour = date.Hour;
                    dis_la[i].Min = date.Minute;                    
                }
            }

            //遍历dis_la 
            string Labe_name;
            for (int i = 0; i < 5; i++)
            {
                Dis_LA dis = dis_la[i];
                Labe_name = “labe_“ + Sum_LA;
                //如果Text为-1则不创建新控件
                if (dis_la[i].Text != “-1“)
                {
                    Label LB_text = new Label
                    {
                        Text = dis.Labe_text
                        Size = new Size(458 40)
                        Name = Labe_name
                        Left = 0
                        Top = (Sum_LA) * 45
                        Font = new Font(“微软雅黑“ 18 Fontstyle.Bold)
                        ForeColor = Color.Blue
                    };
                    this.Height = (i) * 45 + 45;
                    this.Controls.Add(LB_text);
                    Sum_LA++;
                }
     

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-04-16 14:19  WindowsFormsApp2\
     目录           0  2018-04-16 02:07  WindowsFormsApp2\WindowsFormsApp2\
     目录           0  2018-04-16 02:07  WindowsFormsApp2\WindowsFormsApp2\.vs\
     目录           0  2018-04-16 02:07  WindowsFormsApp2\WindowsFormsApp2\.vs\WindowsFormsApp2\
     目录           0  2018-04-16 02:07  WindowsFormsApp2\WindowsFormsApp2\.vs\WindowsFormsApp2\v15\
     文件       84480  2018-04-16 23:40  WindowsFormsApp2\WindowsFormsApp2\.vs\WindowsFormsApp2\v15\.suo
     目录           0  2018-04-16 02:07  WindowsFormsApp2\WindowsFormsApp2\.vs\WindowsFormsApp2\v15\Server\
     目录           0  2018-04-16 23:40  WindowsFormsApp2\WindowsFormsApp2\.vs\WindowsFormsApp2\v15\Server\sqlite3\
     文件           0  2018-04-16 02:07  WindowsFormsApp2\WindowsFormsApp2\.vs\WindowsFormsApp2\v15\Server\sqlite3\db.lock
     文件      647168  2018-04-16 23:40  WindowsFormsApp2\WindowsFormsApp2\.vs\WindowsFormsApp2\v15\Server\sqlite3\storage.ide
     目录           0  2018-04-16 23:40  WindowsFormsApp2\WindowsFormsApp2\WindowsFormsApp2\
     文件        1975  2018-04-16 22:56  WindowsFormsApp2\WindowsFormsApp2\WindowsFormsApp2.sln
     文件        2738  2018-04-16 22:50  WindowsFormsApp2\WindowsFormsApp2\WindowsFormsApp2\App.config
     目录           0  2018-04-16 02:13  WindowsFormsApp2\WindowsFormsApp2\WindowsFormsApp2\bin\
     目录           0  2018-04-16 22:27  WindowsFormsApp2\WindowsFormsApp2\WindowsFormsApp2\bin\Debug\
     文件      226816  2018-04-16 23:37  WindowsFormsApp2\WindowsFormsApp2\WindowsFormsApp2\bin\Debug\WindowsFormsApp2.exe
     文件        2738  2018-04-16 22:50  WindowsFormsApp2\WindowsFormsApp2\WindowsFormsApp2\bin\Debug\WindowsFormsApp2.exe.config
     文件       42496  2018-04-16 23:37  WindowsFormsApp2\WindowsFormsApp2\WindowsFormsApp2\bin\Debug\WindowsFormsApp2.pdb
     目录           0  2018-04-16 02:13  WindowsFormsApp2\WindowsFormsApp2\WindowsFormsApp2\bin\Release\
     文件        5373  2018-04-16 22:27  WindowsFormsApp2\WindowsFormsApp2\WindowsFormsApp2\daojishi.csproj
     文件         479  2018-04-16 11:59  WindowsFormsApp2\WindowsFormsApp2\WindowsFormsApp2\daojishi.csproj.user
     文件        1644  2018-04-16 22:23  WindowsFormsApp2\WindowsFormsApp2\WindowsFormsApp2\daojishi_TemporaryKey.pfx
     文件        4837  2018-04-16 23:36  WindowsFormsApp2\WindowsFormsApp2\WindowsFormsApp2\Display.cs
     文件        2450  2018-04-16 23:26  WindowsFormsApp2\WindowsFormsApp2\WindowsFormsApp2\Display.Designer.cs
     文件        6206  2018-04-16 23:31  WindowsFormsApp2\WindowsFormsApp2\WindowsFormsApp2\Display.resx
     目录           0  2018-04-16 02:30  WindowsFormsApp2\WindowsFormsApp2\WindowsFormsApp2\ico\
     文件       67646  2018-04-16 02:29  WindowsFormsApp2\WindowsFormsApp2\WindowsFormsApp2\ico\round_clock_128px_1159611_easyicon.net.ico
     目录           0  2018-04-16 02:07  WindowsFormsApp2\WindowsFormsApp2\WindowsFormsApp2\obj\
     目录           0  2018-04-16 23:37  WindowsFormsApp2\WindowsFormsApp2\WindowsFormsApp2\obj\Debug\
     文件          42  2018-04-16 22:27  WindowsFormsApp2\WindowsFormsApp2\WindowsFormsApp2\obj\Debug\daojishi.csproj.CoreCompileInputs.cache
     文件        3504  2018-04-16 23:22  WindowsFormsApp2\WindowsFormsApp2\WindowsFormsApp2\obj\Debug\daojishi.csproj.FileListAbsolute.txt
............此处省略30个文件信息

评论

共有 条评论