SVN r1124

SVN-Revision: r1124
This commit is contained in:
cyf
2026-02-25 06:51:07 +00:00
parent fcf7cf8d16
commit c7b4bbb05f
2 changed files with 55 additions and 23 deletions
+48
View File
@@ -89,6 +89,54 @@ namespace Lskj.Util
return path;
}
}
/// <summary>
/// 图片扩展框图片下载路径(LabelImageEdit,每次进入程序会清空)
/// </summary>
public static string ImageDownloadPath
{
get
{
string path = AbsolutelyPath + "TempFiles\\ImageFile/";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
return path;
}
}
public static void ClearFilesInDirectory(string targetDir)
{
// 校验目录是否存在
if (!Directory.Exists(targetDir))
{
return;
}
try
{
// 删除所有文件
foreach (string filePath in Directory.GetFiles(targetDir))
{
File.SetAttributes(filePath, FileAttributes.Normal);
File.Delete(filePath);
}
// 删除所有子文件夹(及其内容)
foreach (string subDir in Directory.GetDirectories(targetDir))
{
Directory.Delete(subDir, recursive: true); // 递归删除子文件夹
}
}
catch (Exception ex)
{
}
}
/// <summary>
/// 获取打印文件路径
/// </summary>