调用方法为:System.IO.File.Copy(filePath, fileEnd);
filePath =\\192.168.1.253\File\3b7c338f-e9a1-497a-be78-8f82b68b5f6c\3b7c338f-e9a1-497a-be78-8f82b68b5f6c.docx
fileEnd = \\192.168.1.253\WebDAV\但是报文件名、目录名或卷标语法不正确。共享已经打开,copy操作的时候报的错麻烦各位大哥解释下。谢谢
filePath =\\192.168.1.253\File\3b7c338f-e9a1-497a-be78-8f82b68b5f6c\3b7c338f-e9a1-497a-be78-8f82b68b5f6c.docx
fileEnd = \\192.168.1.253\WebDAV\但是报文件名、目录名或卷标语法不正确。共享已经打开,copy操作的时候报的错麻烦各位大哥解释下。谢谢
filePath = @"\\192.168.1.253\File\3b7c338f-e9a1-497a-be78-8f82b68b5f6c\3b7c338f-e9a1-497a-be78-8f82b68b5f6c.docx";
fileEnd = @"\\192.168.1.253\WebDAV\";
fileEnd = \\192.168.1.253\WebDAV\
System.IO.File.File.Copy(filePath , fileEnd );
试试
{
filePathA = this.fei.PostedFile.FileName;//获取文件全部路径
string fileName = this.fei.FileName;
string path = System.IO.Path.GetDirectoryName(filePathA);
filePathB = path + "\\1" + fileName;//重新设置文件名
File.Copy(filePathA, filePathB);
}这是我拷贝的代码!
A = @"C:\a.txt";
B = @"D:\b.txt";
File.Copy(A, B);