But how could you live and have no story to tell!
访问统计 original graphics

public static bool IsFileInUse(string fileName)
    {
        bool inUse = true;

        FileStream fs = null;
        try
        {

            fs = new FileStream(fileName, FileMode.Open, FileAccess.Read,

            FileShare.None);

            inUse = false;
        }
        catch
        {

        }
        finally
        {
            if (fs != null)

                fs.Close();
        }
        return inUse;//true表示正在使用,false没有使用
    }

posted on 2009-10-13 17:10  nextsoft  阅读(1798)  评论(0编辑  收藏  举报