본문 바로가기

분류 전체보기

(86)
[C#] MSSQL Delete [C#] MSSQL Delete mssql 프로시저 Delete 사용법입니다. public async Task DeleteContents(AdvertiserModel model) { try { using (SqlConnection con = new SqlConnection(Startup.DBConnectionString)) { SqlCommand cmd = new SqlCommand("Delete_AdvertiserInfo", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(DBCommon.MakeParam("@ID", model.ID)); cmd.Parameters.Add(DBCommon.MakeParam("@UserID"..
[C#] MSSQL Insert [C#] MSSQL Insert public async Task InsertContents(AdvertiserModel model) { try { using (SqlConnection con = new SqlConnection(Startup.DBConnectionString)) { SqlCommand cmd = new SqlCommand("INSERT_AdvertiserInfo", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(DBCommon.MakeParam("@CorporateRegistrationNumber", model.CorporateRegistrationNumber)); cmd.Parameters.Add(DBCo..
[C#] Mail 보내기 - Gmail [C#] Mail 보내기 - Gmail public class CSmtp { /// /// multiple recipients 일때 "," 로 여러개 사용 가능 ("xxx.yyy@yyy.com,xxx.yyy@yyy.com,xxx.yyy@yyy.com") /// /// /// public static void SendEmail(string toAddress, List filePaths, string emailSubject) { SmtpClient smtp = null; MailMessage message = null; Attachment attachment = null; string fromAddress = "@gmail.com"; string fromPassword = ""; try { smtp = ne..
[WPF] NotifyIcon 등록 후 자동 숨김 [WPF] NotifyIcon 등록 후 자동 숨김 1. 참조에 System.Drawing 추가하기 2. 아이콘 추가 (icon은 Content로 등록 후 아이콘 이미지 속성에서 "새 버전이면 복사"로 변경) #region NotifyIcon && ContextMenu private void SetNotifyIcon() { System.Windows.Forms.NotifyIcon ni = new System.Windows.Forms.NotifyIcon(); ni.Icon = new System.Drawing.Icon("App-Launcher-icon.ico"); System.Windows.Forms.ContextMenu contextMenu = new System.Windows.Forms.ContextMe..
C# 날짜관련 / 달력관련 C# 날짜관련 / 달력관련 https://pjm187.tistory.com/22 C# 날짜관련 달력관련 // 오늘 날짜를 가져오는 방법: (3월 8일 목요일) DateTime today = DateTime.Today; // 1일 날짜를 가져오는 방법: (3월 1일 목요일) DateTime first_day = today.AddDays(1 - today.Day); // 첫번째 주의 일요일.. pjm187.tistory.com // 오늘 날짜를 가져오는 방법: (3월 8일 목요일) DateTime today = DateTime.Today; // 1일 날짜를 가져오는 방법: (3월 1일 목요일) DateTime first_day = today.AddDays(1 - today.Day); // 첫번째 주의 일요일..
C# 달력관련 클래스 C# 달력관련 클래스 using System; using System.Collections.Generic; namespace Calrendar.Utils { public class CalendarInfo { public int Month { get; set; } /// /// 달력 1일 이전의 빈 공간 데이터까지 가지고 있음 /// public List DayListUI = new List(); /// /// 기본 숫자(일)만 표현 /// public List DayList = new List(); } public class CalendarDayInfo { /// /// 1일 이전의 빈 공간은 NULL /// public int? Day { get; set; } public DayOfWeek DayOfW..
C# 절전모드 / 최대 절전모드 절전모드 / 최대 절전모드 [DllImport("Powrprof.dll", CharSet=CharSet.Auto, ExactSpelling=true)] public static extern bool SetSuspendState(bool hiberate, bool forceCritical, bool disableWakeEvent); // Hibernate SetSuspendState(true, true, true); // Standby SetSuspendState(false, true, true);
C# 키보드 인풋 키보드 인풋 public class Keyboard { public static void Send(ScanCodeShort a) { INPUT[] Inputs = new INPUT[1]; INPUT Input = new INPUT(); Input.type = 1; // 1 = Keyboard Input Input.U.ki.wScan = a; Input.U.ki.dwFlags = KEYEVENTF.SCANCODE; Inputs[0] = Input; SendInput(1, Inputs, INPUT.Size); } /// /// Declaration of external SendInput method /// [DllImport("user32.dll")] internal static extern uint Sen..