If I run my program and strUploadIP doens't exits in my network my whole application is stuck
FileInfo toUpload = new FileInfo(strFile);
FtpWebRequest req = (FtpWebRequest)WebRequest.Create(@"ftp://" + **strUploadIP** + @"/" + strUser);
req.Method = WebRequestMethods.Ftp.MakeDirectory;
req.Credentials = new NetworkCredential(strUusername, strUpassword);
try
{
using (var resp = (FtpWebResponse)req.GetResponse())
{
Console.WriteLine(resp.StatusCode);
}
}
how can I get to try catch this or something?