private bool DownloadTiffFile(DbModule.SEND_REQUEST_DTL p_dtlReq, out string p_downTiffFullName) { p_downTiffFullName = ""; bool ret = false; for (int cnt = 0; cnt < 3; cnt++) { try { string localPath = string.Format("{0}\\tiff", System.Windows.Forms.Application.StartupPath); if (!Directory.Exists(localPath)) { Directory.CreateDirectory(localPath); } int idx = p_dtlReq.strTiffPath.LastIndexOf("\\"); if (idx < 0) { continue; } string fileName = p_dtlReq.strTiffPath.Substring(idx + 1); string localFileFullName = string.Format("{0}\\{1}", localPath, fileName); string srcTiffFullName = String.Format("{0}\\{1}", Config.FINISHED_TIF_PATH, p_dtlReq.strTiffPath); LogMessage(String.Format("TIF파일 다운로드({0}회) : {1} > {2}", cnt + 1, srcTiffFullName, localFileFullName)); if (!File.Exists(srcTiffFullName)) { LogError(String.Format("TIF파일 존재하지 않습니다. TIF파일 : {0}", srcTiffFullName)); continue; } File.Copy(srcTiffFullName, localFileFullName, true); p_downTiffFullName = localFileFullName; ret = true; break; } catch (Exception ex) { LogError(String.Format("TIF파일을 다운로드중 다음과 같은 오류가 발생하였습니다 {0}", ex.Message)); ret = false; continue; } } return(ret); }
private bool GetTiffFileNames(DbModule.SEND_REQUEST_DTL p_dtlReq, string p_localTiffFullName) { try { FileInfo fInfo = new FileInfo(p_localTiffFullName); p_dtlReq.strTiffName = fInfo.Name; p_dtlReq.strTiffFullName = fInfo.FullName; return(true); } catch { return(false); } }
private bool GetTiffFileNames(DbModule.SEND_REQUEST_DTL p_dtlReq) { string strTiffFullName = ""; strTiffFullName = String.Format("{0}\\{1}", Config.FINISHED_TIF_PATH, p_dtlReq.strTiffPath); if (!File.Exists(strTiffFullName)) { return(false); } try { FileInfo fInfo = new FileInfo(strTiffFullName); p_dtlReq.strTiffName = fInfo.Name; p_dtlReq.strTiffFullName = strTiffFullName; return(true); } catch { return(false); } }