⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 filechangeinfo.cs

📁 代码模版 codtemplate
💻 CS
字号:
using System;
using System.IO;

namespace CodeTemplate
{
	internal class FileChangeInfo
	{
		public FileChangeInfo(String filePath)
		{
			m_filePath = filePath;
			m_timestamp = DateTime.MinValue;
		}

		public String FilePath
		{
			get { return m_filePath; }
		}

		public Boolean Changed
		{
			get { return m_timestamp < this.LastWriteTime; }
		}

		private DateTime LastWriteTime
		{
			get 
			{
				try
				{
					FileInfo fi = new FileInfo(this.FilePath);
					return fi.LastWriteTime;
				}

				catch(Exception)
				{
					return DateTime.MinValue;
				}
			}
		}

		public void Refresh()
		{
			m_timestamp = this.LastWriteTime;
		}

		private String m_filePath;
		private DateTime m_timestamp;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -