public bool getDownloadImage(string downURL, string filePathName) { // 이미지 다운로드 WebClient myWebClient = new WebClient(); byte[] data; string fileExtention; string saveFilePath; Uri downURI = getUrlForPunyCode(downURL); try { data = myWebClient.DownloadData(downURI); fileExtention = getImageFileType(data); saveFilePath = filePathName + fileExtention; File.WriteAllBytes(saveFilePath, data); //Debug.WriteLine(fileExtention); if (!(fileExtention == ".unknow.txt")) { mainForm.picBoxUpdate(saveFilePath); // 화면 표시 return(true); } else { File.Delete(saveFilePath); return(false); } } catch (Exception e) { log.Debug(downURI.ToString()); log.Debug(e.ToString()); return(false); } }