判断服务器上的文件是否存在

public bool FileExist(string RemoteFileName)
    {
        string[] fileList = GetFileList("*.*");
        if (fileList != null)
        {
            foreach (string str in fileList)
            {
                if (str.Trim() == RemoteFileName.Trim())
                {
                    return true;
                }
            }
        }
        return false;
    }

posted @ 2017-07-17 16:27  逝者永生  阅读(534)  评论(0编辑  收藏  举报