I have a simple C # program that copies files from one network share to another. The program simply ran the error "Semaphore timeout expired." I have never seen this before, and I'm a little confused as to what it is.
The code is pretty simple: (srcPath and destPath are read from the configuration settings)
DirectoryInfo di = new DirectoryInfo(srcPath); try { FileInfo[] files = di.GetFiles(); foreach (FileInfo fi in files) { if(!(fi.Name.Contains("_desc"))) { File.Copy(fi.FullName, destPath + fi.Name, true); } } } catch (Exception xx) { SendMail(xx.Message, xx.StackTrace); } finally { }
Tim source share