110,568
社区成员
发帖
与我相关
我的任务
分享
public static bool UploadFile(string sourcepath, string destpath)
{
bool flag = false;
WebClient client = new WebClient();
client.Credentials = new NetworkCredential("test", "123");
if (File.Exists(sourcepath))
{
client.UploadFile(destpath, "PUT", sourcepath);
flag = true;
client.Dispose();
}
return flag;
}