在我的列表框的文件中有我想要复制文件这些指定的路径,例如 c:\ 或任何路径,但错误是(值不能是空参数名称路径)错误如何复制指定的路径我写这个代码
string source, fileToCopy, target;
string sourcefolder1;
string destinationfolder;
DirectoryInfo di = new DirectoryInfo(destinationfolder);
FileInfo[] annfiles;
foreach (string s in listBox1.Items)
{
fileToCopy = s;
source = Path.Combine(sourcefolder1, fileToCopy);
target = Path.Combine(destinationfolder, fileToCopy);
File.Copy(source, target);
annFiles = di.GetFiles();
}