본문 바로가기

.NET/C# Basic

Visual Studio c# 전처리문 빌드 조건, 개발 운영 빌드 다르게 하고 싶을때 전처리기 팁 여러 사이트를 돌아다니면서 개발자들이 단순히 개발 커넥션 운영커넥션을 다르게 주석 처리로 운영하것을 많이 보았다.비주얼 스튜디오에서 #if 전처리문을 사용하여 구성관리자에 따라서 빌드를 다르게 구성할수있다.   기본적인 Debug Release 외에 DEV PROD를 생성하여 조건에 맞는 빌드를 하고 싶을때비주얼 스튜디오 개발 운영 커넥션 설정   1. 비주얼 스튜디오 구성관리자를 선택  2.새로 만들기 선택  3. 새솔루션 구성 이름 설정복사 만들기  4. 프로젝트 빌드 속성에서 조건부 컴파일 기호 입력 5. 코드 블럭 설정하여 커넥션 다르게 하기6. 이제 구성관리자만 바꾸고 테스트 하자 더보기
IIS HTTPS 세팅하기 및 C# 사설 SSL 인증서 호출 사용하기 OPENSSL 사용하기 1. OPEN SSL 다운로드 Win32/Win64 OpenSSL Installer for Windows - Shining Light Productions (slproweb.com) Win32/Win64 OpenSSL Installer for Windows - Shining Light Productions Minimum system requirements: Windows XP or later 32MB RAM 200MHz CPU 30MB hard drive space Recommended system requirements: Windows XP or later 128MB RAM 500MHz CPU 300MB hard drive space September 9, 2021 - OpenSSL 3.0 is ava.. 더보기
C# CallerMemberNameAttribute Class 소개 https://msdn.microsoft.com/en-us/library/system.runtime.compilerservices.callermembernameattribute(v=vs.110).aspx Available since 4.5 public void DoProcessing() { TraceMessage("Something happened."); } public void TraceMessage(string message, [System.Runtime.CompilerServices.CallerMemberName] string memberName = "", [System.Runtime.CompilerServices.CallerFilePath] string sourceFilePath = "", [Sy.. 더보기
C# Custom Sort Null 널값이 제일 아래로 IComparer IComparable IComparable 및 IComparer 인터페이스 Visual C#에서 사용 하는 방법refer: http://support.microsoft.com/kb/320727/ko static void Main(string[] args) { // Create an arary of car objects. car[] arrayOfCars = new car[8] { new car("Ford",1992), new car("Fiat",1988), new car("Buick",1932), new car("Ford",1932), new car("Dodge",1999), new car(string.Empty,1990 ), new car("sexy",null ), new car("Honda",1977) }; // Write.. 더보기
DLL Ressource 에서 BitmapImage 불러오기 Method 1. 외부 DLL Ressource 리플렉터 => 2. 코드/// /// name : GetDllToBitmapImageResource /// desc : BitmapImage load of resource /// author : 전광식 /// create Date : 2013-01-10 오후 7:56:23 /// update date : 2013-01-10 오후 7:56:23 , 수정개요 /// /// AssemblyName /// resourceUri /// public BitmapImage GetDllToBitmapImageResource(string assemblyName, string resourceUri) { Assembly assembly = Assembly.LoadFrom(System.En.. 더보기
Visual Studio 2005의 원격 디버깅 설정(http://www.hoonsbara.com/) Visual Studio 2005의 원격 디버깅 설정 이 항목은 다음 언어에 적용됩니다. Visual Studio Edition Visual Basic C# C++ J# Web Dev Express 아니요 아니요 아니요 아니요 아니요 Standard 아니요 아니요 아니요 아니요 아니요 Pro/Team 예 예 예 예 예 Visual Studio 2005에서는 원격 디버깅을 매우 간단하게 설정할 수 있습니다. T-SQL 디버깅을 제외한 모든 원격 디버깅 시나리오에 원격 디버깅 모니터(msvsmon.exe)가 사용됩니다. 이전에 일부 디버깅 시나리오에 필요했던 Machine Debug Manager(mdm.exe)는 이제 사용되지 않습니다. 또한 msvsmon.exe에서 기존의 명령줄 인터페이스 대신 그래픽 .. 더보기
[C#] String.Format 을 이용한 문자정렬 왼쪽 오른쪽 가운데 | String alignment Left Right Center 기초를 튼튼히 하면 삽질을 줄일수 있어요! You based foundation when the shoveling to reduce. Result : Code : static void Main(string[] args) { Console.WriteLine("123456789012345678901234567890123456789012");// 총길이 42칸 Console.WriteLine(String.Format("{0,42}", "test")); //우측정렬 Console.WriteLine(String.Format("{0,-42}", "te13123123st")); //좌측정렬 Console.WriteLine(String.Format("{0}", "1").PadLeft(42 - (21 - ("1".Len.. 더보기
[C#] char[] + char[] = char[]?? | char[] Merge char[] c2 = { (char)0x1B, (char)0x21 }; char[] c2_2 = " 영 수 증 ".ToCharArray(); char[] c2_3 = { (char)0x1B, (char)'!', (char)0x1 }; IEnumerable ieC2 = c2.ToArray(); IEnumerable ieC2_2 = c2_2.ToArray(); IEnumerable ieC2_3 = c2_3.ToArray(); ieC2 = ieC2.Concat(ieC2_2); ieC2 = ieC2.Concat(ieC2_3); foreach (char item in ieC2) { label1.Text += item; } code of http://faram.tistory.com/ from 더보기