전체 글 (105) 썸네일형 리스트형 Thread [C#] C# 1.0 Style Thread with ThreadStart // C# 1.0 Style Threadusing System;using System.Threading; namespace ThreadSample{ class Program { static void Main(string[] args) { // C# 1.0 Style Thread uses ThreadStart ThreadStart ts = new ThreadStart(Work); Thread t1 = new Thread(ts); t1.Start(); for (int count = 0; count < Repetitions; count++) { Console.Write('@'); } } static void Work() { for (int count = 0; count < Repetitions; count++.. [SQL Server] Enable TCP/IP Protocol & Port Enable SQL Server TCP/IP ProtocolOpen SQL Server Configuration ManagerExpand "SQL Server Network Configuration" and click on "Protocols for MSSQLSERVER"Right click on "TCP/IP" and choose "Enable"Click on "SQL Server Services"Right click on "SQL Server (MSSQLSERVER)" and choose "Restart" Enable TCP/IP Port for SQL Servernetsh advfirewall firewall add rule name=SQLPort dir=in protocol=TCP action=a.. [Visual Studio] Dynamic/Static Library Setup Example using MySQL Connector/C++ Building Connector/C++ Applications on Windows with Microsoft Visual Studio Directory Structure From https://dev.mysql.com/downloads/connector/cpp/8.0.htmlDownload mysql-connector-c++-8.0.11-windows-x86-64bit.zip fileExtract to $(SolutionDir)connector folder $(SolutionDir)CppConnector$(SolutionDir)connector\include$(SolutionDir)connector\lib64\vs14 Visual Studio Change the build configuration fr.. [C++] Dynamic Memory Allocation - TCHAR *myString // Dynamic Memory Allocation : TCHAR *myString #include #include #include #include int _tmain(){ TCHAR *myString; myString = new TCHAR[8]; //_stprintf(myString, _T("%s"), _T("1234567")); wsprintf(myString, _T("%s"), _T("1234567")); _tprintf(_T("String : %s \n"), myString); _tprintf(_T("Length : %d \n"), _tcslen(myString)); delete[] myString; return 0;} [C#] Composite Format String & Interpolated String 아래는 Composite Format String의 간단한 예제이다.string name = "John"; int age = 20; string gender = "male"; string phone = "012-3456-7890"; Console.WriteLine("First = {0}, Second = {1}, Third = {2}, Fourth = {3}", name, age, gender, phone);이 예제를 보면 {0} {1} {2} {3} 에 무엇이 대입될 것인지 하나씩 찾아보아야 Console.WriteLine 출력문이 이해가 된다. Console.WriteLine 출력문을 Interpolated String으로 바꾸면 아래와 같이 된다.Console.WriteLine($"First = {.. [C#] iterating enum type enum type을 iteration하려면 어떻게 해야할까? 예를 들어서 아래와 같이 일주일의 요일이 담긴 emun type인 Days가 있다고 하자.enum Days { Sun, Mon, Tue, Wed, Thu, Fri, Sat }; Days를 iteration하여 아래와 같이 출력하려고 한다. Sun Mon Tue Wed Thu Fri Sat어떻게 해야할까? Enum.GetValues()를 이용하여, 아래와 같이 해주면 된다.Type type = typeof(Days); Array array = Enum.GetValues(type); foreach (var value in array) { Console.WriteLine(value); } Environment.SpecialFolder enum typ.. [Sandboxie] Detect Registry Changes 2 Registry Editor 사용 예제 Sandboxie > Default Box > Delete Contents Sandboxie > Default Box > Run Windows Explorer 시작 > 실행 > regedit (레지스트리 편집기 실행) 레지스트리 편집기 (regedit) > 보기 (View) > 새로 고침 (Refresh)HKEY_USERS > Sandboxie_UserName_DefaultBox Right-Click > 내보내기 (Export) > RegHive1.reg 파일로 저장 Sandboxie에서 실행한 Windows Explorer로 프로그램 설치, 실행, 등록 레지스트리 편집기 (regedit) > 보기 (View) > 새로 고침 (Refresh)HKEY_USERS > .. [Sandboxie] Detect Registry Changes 1 프로그램을 설치한 후, 레지스트리 변경 내용을 알고자 할 때 사용할 수 있는 방법이다. Sandboxie > Default Box > Delete Contents Sandboxie > Default Box > Run From Start Menu > Cancel c:\Sandbox\%USERNAME%\DefaultBox\RegHive 파일을 RegHive1 파일로 d:\work 폴더에 저장 Sandboxie > Default Box > Run Any Program > 프로그램 설치, 실행, 등록 c:\Sandbox\%USERNAME%\DefaultBox\RegHive 파일을 RegHive2 파일로 d:\work 폴더에 저장 d:\work 폴더에서 아래 명령을 실행 reg LOAD HKEY_USERS\San.. 이전 1 2 3 4 5 6 7 ··· 14 다음