C# 判断文件是否被占用的三种方法 using System.IO; using System.Runtime.InteropServices; [DllImport("kernel32.dll")] public static extern IntPtr _lopen(string lpPathName, int iReadWrite); [DllImport("kernel32.dll")] public static extern bool CloseHand
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