2

我有:

using (System.Net.WebClient client = new System.Net.WebClient())
           {          
               client.Credentials = new System.Net.NetworkCredential(usuario, senha);
                DirectoryInfo diretorio2 = new DirectoryInfo(@"C:\");
               FileInfo[] Arquivos2 = diretorio2.GetFiles("*.*");
               foreach (FileInfo fileinfo2 in Arquivos2)
               {
               client.UploadFile("ftp://" + ftp + "/" + dir + fileinfo2.Name, @"C:\" + fileinfo2.Name);
               }

我的这段代码有一些问题,也许是防火墙......我需要设置一个超时来显示一个带有问题原因的消息框,在这种情况下我该如何配置超时?

4

0 回答 0