1.用文件流判断 using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; namespace ConsoleApp1 { class Program { public static bool isFileLocke…
Conditional Logic on Files # 判断文件是否存在及文件类型 -a file exists. #文件存在 -b file exists and is a block special file. #文件存在,并且是块设备 -c file exists and is a character special file. ##文件存在,并且是字符设备 -d file exists and is a directory. #文件存在,并且是目录 -e file exists (ju…
C# 判断文件有没占用 using System; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; namespace AdminTools { public static class FileTools { [DllImport("kernel32.dll")] private static extern…