如何使用Webclient捕获任何错误?
|
我正在尝试使用WebClient捕获连接问题。例如,无法访问,超时等。下面的代码不起作用,好像没有错误。
WebClient wc = new WebClient();
try
{
wc.UploadFileAsync(new Uri(@\"ftp://tabletijam/FileServer/upload.bin\"), Directory.GetCurrentDirectory() + @\"\\crypto.bin\");
}
catch (System.Exception ex)
{
MessageBox.Show(ex.ToString());
}
没有找到相关结果
已邀请:
2 个回复
粟痢凰副
泪琉踞檄
使用此代码,但与您的方案有关