通过身份验证将文件从pc复制到服务器 [英] Copy file from pc to server with authentication
本文介绍了通过身份验证将文件从pc复制到服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
想要将文件从PC复制到服务器<用户名,密码>,
当我编写以下代码并运行它时抛出异常不支持给定路径的格式,任何帮助
if(File.Exists(SrcFileName))
{
DestFileName =\\ administrator:123456@10.10.2.24 \\ d $ \\document\\documents\\photo $ \\testcopy.bmp;
DestFileName =\\\\10.10.2.24 / administrator:123456 \\\\ $ \\document \\documents\\photo $ \\ testcopy。 BMP;
if(File.Exists(DestFileName))
MessageBox.Show(已存在于目标中);
else
File.Copy(SrcFileName,DestFileName,true);
}
解决方案
\\document\\documents\\photo
\\testcopy.bmp;
DestFileName =\\\\10.10.2.24 / administrator:123456 \\\\
< BLOCKQUOTE> \\document\\documents\\photo
wanna to copy file from pc to server <username,password>,
when i wrote the follwing code and run it exception was thrown "The given path's format is not supported" ,any help
if (File.Exists(SrcFileName)) { DestFileName = "\\administrator:123456@10.10.2.24\\d$\\document\\documents\\photo$\\testcopy.bmp"; DestFileName = "\\\\10.10.2.24/administrator:123456\\d$\\document\\documents\\photo$\\testcopy.bmp"; if (File.Exists(DestFileName)) MessageBox.Show("already exists in destination"); else File.Copy(SrcFileName, DestFileName, true); }
解决方案
\\document\\documents\\photo
\\testcopy.bmp"; DestFileName = "\\\\10.10.2.24/administrator:123456\\d
\\document\\documents\\photo
这篇关于通过身份验证将文件从pc复制到服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文