咨询 VS2005的 问题

我用VS2005写了小程序,用于整理一个服务器上的数据(某些符合要求的批次信息)到本地。程序以前跑了很正常,近期公司更换源文件数据的服务器后(服务器名称和IP地址都没改),就经常报错(换回以前的服务器就正常),报如下的错误,哪个帮忙看看呢,是啥毛病呢?

未处理 System.IO.IOException
Message="没有更多文件。\r\n"
Source="mscorlib"
StackTrace:
在 System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
在 System.IO.Directory.InternalGetFileDirectoryNames(String path, String userPathOriginal, String searchPattern, Boolean includeFiles, Boolean includeDirs, SearchOption searchOption)
在 System.IO.DirectoryInfo.GetFiles(String searchPattern, SearchOption searchOption)
在 AutoFtpCp2Cust.App.CopyCp2Local() 位置 D:\运行程序\M\AutoFtpCp2Cust\App.cs:行号 213
在 AutoFtpCp2Cust.App.Start() 位置 D:\运行程序\M\AutoFtpCp2Cust\App.cs:行号 62
在 AutoFtpCp2Cust.Program.Main(String[] args) 位置 D:\运行程序\M\AutoFtpCp2Cust\Program.cs:行号 11
在 System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
在 System.Threading.ThreadHelper.ThreadStart()

缺了什么文件,maybeFullPath看看这个参数的路径是什么。

看下是否读写权限的问题

看一下是否给予的读写权限,或者它是否在沙箱中运行

程序环境搭建不全,或者版本不对,重点排查这块

谢谢大家。今天去找公司大佬帮忙,已解决。和楼上的说的差不多,就是文件没找到,空着了,没法跑下去。两个服务器系统版本略有差异,查找文件时,老的服务器不用判空后操作,新服务器就必须判空操作,否则就报错了。