FileWatch

private void initWatcher() { string EqpDirPath = @"C:\TEST\"; FileSystemWatcher watcher = new FileSystemWatcher(); //1. FileSystemWatcher 생성자 호출 watcher.Path = EqpDirPath; //2. 감시할 폴더 설정(디렉토리) // 3. 감시할 항목들 설정 (파일 생성, 크기, 이름., 마지막 접근 변경등..) watcher.NotifyFilter = NotifyFilters.FileName | NotifyFilters.DirectoryName | NotifyFilters.Size | NotifyFilters.LastAccess | NotifyFilters.CreationTime | NotifyFilters.LastWrite; //감시할 파일 유형 선택 예) *.*…

HTTPS를 HTTP로 리디렉션하는 방법

SSL 보안서버 인증서가 적용된 상태에서 HTTPS를 HTTP로 리디렉션하고 싶은 경우, 다음 코드를 .htaccess 파일에 추가하면 됩니다. RewriteCond %{HTTPS} on RewriteEngine On RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} 위의 코드가 잘 작동하지 않으면, 다음 코드를 시도해볼 수 있습니다. Options +FollowSymLinks RewriteEngine On RewriteCond %{ENV:HTTPS} on RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] .conf 파일을 사용하는 경우: ServerName domain.com RewriteEngine On RewriteCond %{HTTPS}…

AWS 로 이전중….완료!

일단 AWS로 하나 하나 이전중입니다. 기존 서버도 좋지만 AWS에 이제 보금자리를 마련하력고 합니다. 뭔가 할려고 하면은 기존에는 많은 부분이 막혀서 제대로 하지를 못해서..... AWS에 서비스중 하나로 이전을 하였습니다. 이곳에서 이제 마지막 보급자리를 마련하지 않을까 싶습니다. 한달 넘게 테스트를 해보니 한국에서 싼편인 서버호스팅보다도 성능이 준수하고 사용하기에 편해서 다른곳으로 눈길이 전혀 가지 않을것 같아서 입니다. 이런것도 몇년이…

[C#] [Build] 빌드시 EXE 에 DLL 포함 시키기

[C#] [Build] 빌드시 EXE 에 DLL 포함 시키기
VS에서 빌드시에 참조 리소스등 DLL등을 별도로 포함을 해야 하는데, 보기보다 이작업이 상당히 귀찮은 작업니다. 물론 인스톨러를 사용하면은 간단하지만 단일 파일로 배포를 할 경우에 여러가지 파일이 있으면 사람들이 싫어 하는 편입니다. 그래서 EXE파일을 빌드 할 경우에 리소소를 포함 시켜서 배포를 하면은 사용하는 사람도 편하고 배포 하는 사람도 편하다는 생각에 기록을 남깁니다. nuget에서 Costura.Fody를 검색하신후에 설치하시면 자동으로…

왜? 접속하시는지요?

이 블로그는 정말 개인적으로 기록할 글을 남기기 때문에 공개되는 형태가 아닙니다.   그런데 접속을 하는 이유는 블로그를 무단으로 이용하려는 목적이 다분히 있다고 생각이 듭니다.   정보가 있는것도 아니고, 무언가를 전달하지도 않기에 방문의 목적이 뚜렷히 증가할 이유가 없는 부분이라서 방문의 이유를 도저히 생각을 할수가 없습니다.   검색봇이 오는것이야 막지 않지만 접속에 대해서 대부분 차단을 위주로 할것이고…

[C#] WinForm 시스템 메뉴에 나만의 메뉴 추가하기

using System; using System.Windows.Forms; using System.Runtime.InteropServices; namespace CaptionTimetableSupporet { public partial class MainForm : Form { // P/Invoke constants private const int WM_SYSCOMMAND = 0x112; private const int MF_STRING = 0x0; private const int MF_SEPARATOR = 0x800; // P/Invoke declarations [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] private static extern IntPtr GetSystemMenu(IntPtr hWnd, bool bRevert);…

[C#] Environment 를 통해 시스템 정보, OS 버전알아오기

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace WindowsFormsApplication2 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { // 현재 작업 디렉터리의 정규화된 경로를 가져오거나 설정합니다. txtWindowCode.Text += "@ 디렉토리 경로 : "…

[C#] 윈도우 OS 정보 얻기

OperatingSystem os = System.Environment.OSVersion; Console.WriteLine("플랫폼 : " + os.Platform); Console.WriteLine("서비스팩 : " + os.ServicePack); Console.WriteLine("버전 : " + os.Version); Console.WriteLine("버전 : " + os.Version); Console.WriteLine("버전 문자열 : " + os.VersionString); Console.WriteLine("CLR버전 : " + System.Environment.Version); Console.ReadLine(); // 콘솔에서 확인할수 있도록 잠시 멈춤 사용자의 정보를 획득해야 될 일이 있을 경우에 위 기능을 사용해서 처리 할 수…

[C/C++] 시간표시

#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <time.h> int main() { time_t timer; struct tm* t; timer = time(NULL); // 현재 시각을 초 단위로 얻기 t = localtime(&timer); // 초 단위의 시간을 분리하여 구조체에 넣기 printf("%d", t->tm_year + 1900); //현재 년 printf("%d", t->tm_mon + 1); //현재 월 printf("%d", t->tm_mday); //현재 일 printf("%d:", t->tm_hour); //현재 시 printf("%d:", t->tm_min);…

[C#] Picturebox를 투명하게

LicenseLabel.Parent = pictureBox1; LicenseLabel.BackColor = Color.Transparent; LicenseLabel.BringToFront(); LicenseLabel.BackColor = Color.Transparent; LicenseLabel.Width = this.Width; LicenseLabel.Left = 0; LicenseLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; LicenseLabel.Parent = pictureBox1;