C#71 [C# .NET] 잘못 된 Token 형식의 PDF 문서 읽기 시도 Nuget Package 관리자 콘솔을 이용 하여 PdfSharp , PdfiumViewer package를 설치 진행 한 후에 잘못 된 형식의 PDF 문서의 PageCount 를 확인 시도 진행 해보았습니다. PdfSharp의 경우 , PdfSharp Package 만 설치하여도 동작하는데는 크게 어려움이 없었으나PdfiumViewer의 경우 , PdfiumViewer Package와 , PdfiumViewer.Native Packge를 설치 해줘야 오류가 발생하지 않습니다( 해당 native의 경우 Application이 x86 입니다. , x64 전용 native Library가 따로 존재 합니다. ) using System;using PdfSharpDocument = PdfSharp.Pdf.Pd.. 2025. 5. 28. [WPF] Enum Type 을 ComboBox에 ItemSource로 바인딩 예제 (1). ComboBox에 정의할 Enum을 바인딩 합니다. public enum FaxTransMethodType { [Description("즉시 전송")] Immediately, [Description("예약 전송")] Reservation } (2). Converter를 작성 합니다.using GmSFaxAgentWpf.RestApis;using System;using System.Collections.Generic;using System.ComponentModel;using System.Globalization;using System.Reflection;using System.Windows.Data;namespace GmSFaxA.. 2024. 9. 16. [C#] Interop 한 Excel API 가 정상적으로 종료 되지 않을 때 처리 방안 [C#] Interop 한 Excel API 가 정상적으로 종료 되지 않을 때 처리 방안 WorkBook , WorkBooks 에 대하여 Close 메서드를 호출 하고ExcelApp를 Quit 메서드를 호출 , Marshal.FinalReleaseComObject 를 호출 하여도 EXCEL.exe가 종료되지 않았습니다 . 도저히 방법이 없어 , GetWindowThreadProcessId WinAPI를 이용하여 PID를 획득한 후 Process를 Kill 처리 하였습니다. [DllImport("user32.dll")]public static extern Int32 GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);IntPtr ptr = new .. 2024. 9. 3. [C#] Singletone Instance 생성을 이용한 Log File Write 처리 예제 입니다. [C#] Singletone Instance 생성을 이용한 Log File Write 처리 예제 입니다.using System;using System.Collections.Generic;using System.Diagnostics;using System.IO;using System.Linq;using System.Reflection;using System.Text;using System.Threading.Tasks; namespace GmSFaxAgentWpf.Commons{ public class CommonUtils { private static readonly Lazy commonUtils = new Lazy(() => new CommonUtils()); priv.. 2024. 8. 5. 이전 1 2 3 4 ··· 18 다음