C# 通用应用程序发布检查工具-软件自动更新程序(二)

9 篇文章 0 订阅
6 篇文章 0 订阅
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;

namespace AppReleaseCheckTool.Models
{
    public class FolderInfoModel
    {
        public string FolderName
        {
            get;
            set;
        }

        public string FolderPath
        {
            get;
            set;
        }

        public FolderInfoModel ParentFolder
        {
            get;
            set;
        }

        public List<FolderInfoModel> ChildFolder
        {
            get;
            set;
        }

        public List<FileInfoModel> FileList
        {
            get;
            set;
        }

        public DateTime CreateTime
        {
            get;
            set;
        }

        public bool IsFilter
        {
            get;
            set;
        }

        public XElement GetModelXml()
        {
            XElement xml = new XElement("FolderInfo",
                new XAttribute("FolderName", this.FolderName),
                new XAttribute("FolderPath", this.FolderPath),
                new XAttribute("CreateTime", this.CreateTime.ToString()));
            return xml;
        }



    }
}


 

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;

namespace AppReleaseCheckTool.Models
{
    public class FileInfoModel
    {
        private string _filename = string.Empty;
        public string FileName
        {
            get
            {
                return _filename;
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                {
                    _filename = value;
                    if (FileExt.ToLower() == ".dll" || FileExt.ToLower() == ".exe")
                    {
                        FileVersionInfo fileVersionInfo = FileVersionInfo.GetVersionInfo(FilePath + "\\" + value);
                        _versin = fileVersionInfo.ProductVersion;
                        _productmajorpart = fileVersionInfo.ProductMajorPart;
                        _company = fileVersionInfo.CompanyName;
                    }
                }   
            }
        }

        public string FilePath
        {
            get;
            set;
        }

        public string RelativePath
        {
            get;
            set;
        }

        public string FileExt
        {
            get;
            set;
        }
        public long FileSize
        {
            get;
            set;
        }

        

        public DateTime CreateTime
        {
            get;
            set;
        }

        public DateTime ModifyTime
        {
            get;
            set;
        }
        private string _versin = string.Empty;
        public string Version
        {
            get
            {
                return _versin;
            }
        }

        private string _company = string.Empty;
        public string Company
        {
            get
            {
                return _company;
            }
        }

        private int _productmajorpart =0;
        public int ProductMajorPart
        {
            get
            {
                return _productmajorpart;
            }
        }

        public bool IsFilter
        {
            get;
            set;
        }

         public FolderInfoModel ParentFolder
        {
            get;
            set;
        }

         public XElement GetModelXml()
         {
             XElement xml = new XElement("FileInfo",
                 new XAttribute("FileName", this.FileName),
                 new XAttribute("FilePath", this.RelativePath),
                 new XAttribute("CreateTime", this.CreateTime.ToString()),
                 new XAttribute("ModifyTime", this.ModifyTime.ToString()),
                 new XAttribute("Version", this.Version),
                 new XAttribute("FileSize", this.FileSize));
             return xml;
         }


    }
}


 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值