본문 바로가기

C# 65

C# Image TIFF 장수 확인 (페이지 카운트) /// /// TIF 이미지의 페이지 개수 (페이지 카운트)를 확인한다. /// /// /// public int GetTiffFrameCount(string imgFullPath) { int count = 0; using (System.Drawing.Image img = Image.FromFile(imgFullPath)) { count = img.GetFrameCount(FrameDimension.Page); } return count; } 2016. 3. 15.
C# 현재 실행중인 자기 자신의 파일명 정보 얻기 예제 Reflection 클래스를 이용하여 얻는 방법을 찾았습니다. using System; using System.Collections.Generic; using System.Linq; using System.Text; // using System.Reflection; using System.IO; namespace ConsoleUnitTest { class Program { static void Main(string[] args) { //전체 경로 Console.WriteLine(Assembly.GetEntryAssembly().Location); // 파일명 만 얻어오기 Console.WriteLine(Path.GetFileName(Assembly.GetEntryAssembly().Location)); .. 2016. 3. 7.
C# Winform EXE 실행시 관리자 모드로 실행 본인이 찾은 방법으로 해결이 안될 수 있습니다 죄송합니다 -_-;; 1. 프로젝트 새 항목 추가 - app.menifest 2. app.menifest 내용 변경 로 변경 하였습니다. 2016. 3. 7.
EntityFrameWork ExecuteStoreQuery<>를 이용해 스칼라 형식으로 리턴 받기 가끔 lambda 식이나 linq식이 아닌 Command를 그대로 호출이 필요할 때 사용하면 유용할 것 같습니다. object 형식을 리턴형식 string으로 형변환 하여 결과값을 받습니다. string result = string.Empty; result = Db.ExecuteStoreQuery("SELECT dbo.UFN_GetOneResult(@Param1,@Param2)" , new System.Data.SqlClient.SqlParameter("Param1", param1) , new System.Data.SqlClient.SqlParameter("Param2", param2)).FirstOrDefault(); 2016. 2. 24.