728x90
반응형
728x170
using System;
using System.Reflection;
string filePath = @"D:\TestProject\TestProject\bin\Debug\TestProject.exe";
Assembly assembly = Assembly.LoadFrom(filePath);
PortableExecutableKinds kind;
ImageFileMachine machine;
assembly.ManifestModule.GetPEKind(out kind, out machine);
Console.WriteLine($"{kind} : {machine}");
플랫폼 대상 | kind | machine |
Any CPU | ILOnly | I386 |
x86 | ILOnly, Required32Bit | I386 |
X64 | ILOnly, PE32Plus | AMD64 |
※ 닷넷 프레임워크와 UWP 파일은 식별 가능하나 닷넷 코어 파일은 예외가 발생한다.
728x90
반응형
그리드형(광고전용)
'C# > Common' 카테고리의 다른 글
[C#/COMMON] SmtpClient 클래스 : DeliveryMethod/PickupDirectoryLocation 속성을 사용해 EML 파일 저장하기 (0) | 2021.08.06 |
---|---|
[C#/COMMON] MailMessage 클래스 : EML 파일 저장하기 (0) | 2021.08.06 |
[C#/COMMON] 실수 확장(double extension) 기능 사용하기 (0) | 2021.07.17 |
[C#/COMMON] AssemblyName 클래스 : ProcessorArchitecture 속성을 사용해 플랫폼 프로세서 구하기 (0) | 2021.07.06 |
[C#/COMMON] Assembly 클래스 : GetModules 메소드를 사용해 모듈 정보 구하기 (0) | 2021.07.06 |
[C#/COMMON] Assembly 클래스 : ManifestModule 속성을 사용해 메니페스트 모듈의 플랫폼 대상 구하기 (0) | 2021.07.06 |
[C#/COMMON] TargetFrameworkAttribute 클래스 : 닷넷 프레임워크 파일 여부 구하기 (0) | 2021.07.06 |
[C#/COMMON] PE(Portabl Executable) 파일 버전 구하기 (0) | 2021.07.06 |
[C#/COMMON] CancellationTokenSource 클래스 : 지정 시간 이후 취소하는 토큰 소스 생성하기 (0) | 2021.06.26 |
[C#/COMMON] HttpClient 클래스 : 다운로드 중 에러 발생으로 재시도시 지연 시간 늘리기 (0) | 2021.06.26 |
[C#/COMMON] 누겟 설치 : System.Collections.Immutable (0) | 2021.06.26 |
댓글을 달아 주세요