### RaUI V4.0.2606.0401 - *.[新增]QuickWeb新增支持重试次数。 - *.[新增]RySetting类新增支持json格式设置存储和获取。 - *.[新增]RySetting类新增支持读取设置到内存,然后按配置名称读取。 - *.[新增]新增SuperFileSearch类,文件查找。 - *.[新增]QuickWeb新增CurPageUrl属性。 - *.[新增]HardWare新增支持获取显示器信息。 - *.[新增]HardWare新增GetWMI函数。 - *.[改进]QuickWeb类的UA从IE改为Edge。 - *.[改进]Hosts类IP与域名分隔符从\t改为三个空格。 - *.[改进]RyImage的CropOrFill函数,如果输入的长宽比例与原图一致,则返回原图的副本而不是原图。 - *.[改进]RySoft类的CompareVer函数支持特殊格式的版本号。 - *.[改进]QuickWeb的ConvertUrl函数新增支持自动从CurPageUrl获取。 - *.[改进]DateDiff函数对时间差异小于等于10秒的,自动加上毫秒数据。 - *.[修复]修复ObjectListView控件的AspectGetter方法可能调用null对象的问题。 - *.[修复]修复日期选择控件在获取节假日数据时,会因为节假日文件夹无法访问而报错的问题。 - *.[修复]修复某些情况下剪切板权限问题导致ObjectListView控件报错。 - *.[修复]修复RyImage的CropOrFill函数图片比例不一致时,也是返回原图副本的BUG。 ### Itrycn_Project2 V1.0.2606.0401 - *.[改进]将公共调用,无需新增内容的部分代码,改到Public文件夹下
92 lines
2.9 KiB
C#
92 lines
2.9 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Data.SqlTypes;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Xml.Linq;
|
|
using static System.Net.WebRequestMethods;
|
|
|
|
namespace Itrycn_Project2
|
|
{
|
|
public class MyFileSystemInfo
|
|
{
|
|
public MyFileSystemInfo(FileSystemInfo fileSystemInfo,string name)
|
|
{
|
|
if (fileSystemInfo == null) throw new ArgumentNullException("fileSystemInfo");
|
|
ReLoad(fileSystemInfo,name);
|
|
}
|
|
public void ReLoad()
|
|
{
|
|
ReLoad(FullName);
|
|
}
|
|
public void ReLoad(string path)
|
|
{
|
|
if(System.IO.File.Exists(path))
|
|
{
|
|
ReLoad(new FileInfo(path), "");
|
|
}
|
|
else if (System.IO.Directory.Exists(path))
|
|
{
|
|
ReLoad(new DirectoryInfo(path), "");
|
|
}
|
|
}
|
|
public void ReLoad(FileSystemInfo fileSystemInfo)
|
|
{
|
|
ReLoad(fileSystemInfo, "");
|
|
}
|
|
public void ReLoad(FileSystemInfo fileSystemInfo, string name)
|
|
{
|
|
var info = fileSystemInfo;
|
|
if (name.Length == 0)
|
|
{
|
|
this.Name = info.Name;
|
|
}
|
|
else { this.Name = name; }
|
|
Extension = info.Extension;
|
|
LastWriteTime = info.LastWriteTime;
|
|
CreationTime = info.CreationTime;
|
|
FullName = info.FullName;
|
|
Attributes = info.Attributes;
|
|
AsDirectory = info as DirectoryInfo;
|
|
AsFile = info as FileInfo;
|
|
IsDirectory = this.AsDirectory != null;
|
|
Length = IsDirectory ? -1 : AsFile.Length;
|
|
}
|
|
public bool IsDirectory { get;private set; }
|
|
|
|
public DirectoryInfo AsDirectory { get; private set; }
|
|
public FileInfo AsFile { get; private set; }
|
|
|
|
public string Name{get; set;} = "";
|
|
|
|
public string Extension { get; private set; } = "";
|
|
public DateTime LastWriteTime { get; private set; }
|
|
public DateTime CreationTime { get; private set; }
|
|
public string FullName { get; private set; } = "";
|
|
|
|
public FileAttributes Attributes { get;private set; }
|
|
|
|
public long Length { get; private set; } = 0;
|
|
|
|
public IEnumerable GetFileSystemInfos()
|
|
{
|
|
ArrayList children = new ArrayList();
|
|
if (this.IsDirectory)
|
|
{
|
|
if (this.AsDirectory.Exists) {
|
|
foreach (var x in this.AsDirectory.GetDirectories()) {
|
|
children.Add(new MyFileSystemInfo(x, ""));
|
|
}
|
|
foreach (var x in this.AsDirectory.GetFiles()) {
|
|
children.Add(new MyFileSystemInfo(x, ""));
|
|
}
|
|
}
|
|
}
|
|
return children;
|
|
}
|
|
}
|
|
}
|