using System.IO;private bool IsFileLocked(string path){ FileStream stream = null; try { stream = new FileStream(path, FileMode.Open, FileAccess.ReadWrite, FileShare.None); } catch { return true; } finally { if (stream != null) { stream.Close(); } } return false;}前まではファイルが変更出来るか?で未使用なのか判断していた。
0 件のコメント:
コメントを投稿