목록Programming (67)
분노의 챔질
private string GetDayOfWeek(DateTime dateTime) { var d = dateTime.DayOfWeek; string ret = string.Empty; switch (d) { case DayOfWeek.Friday: ret = "金"; break; case DayOfWeek.Monday: ret = "月"; break; case DayOfWeek.Saturday: ret = "土"; break; case DayOfWeek.Sunday: ret = "日"; break; case DayOfWeek.Thursday: ret = "木"; break; case DayOfWeek.Tuesday: ret = "火"; break; case DayOfWeek.Wednesday: ret ..
declare @StartDate datetime = '2010-01-25', @EndDate datetime = '2010-02-05' select GETDATE() select dateadd(day, 10, @StartDate), dateadd(day, -10, @StartDate) select datediff(day, @StartDate, @EndDate), datediff(month, @StartDate, @EndDate) select datepart(year,@StartDate), datepart(month,@StartDate) ,datepart(day,@StartDate) select year(@StartDate), month(@StartDate), day(@StartDate) GETDATE(..
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.IO; namespace CPUUsage { public partial class Form2 : Form { public Form2() { InitializeComponent(); DriveInfo[] drv = DriveInfo.GetDrives(); int y = 20; foreach (DriveInfo d in drv) { if (d.DriveType ..
using System; using System.Windows.Forms; using System.Diagnostics; using System.Threading; using System.IO; using System.Drawing; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Linq; using System.Text; using System.Management; namespace CPUUsage { public partial class Form1 : Form { private Thread addDataRunner; public delegate void AddDataDelegat..
dbo.EnumerationMaster dbo.Enumerations [EnumID] [nvarchar](4) NOT NULL [EnumName] [nvarchar](100) NULL [ColumnName] [nvarchar](60) NULL [EnumID] [nvarchar](4) NOT NULL [ElementID] [int] NOT NULL [ElementName] [nvarchar](255) NOT NULL [Status] [bit] NOT NULL 함수 create function [dbo].[uf_GetElementName](@EnumID nvarchar(4), @ElementID int) returns nvarchar(100) as begin return (select ElementName ..
KeyDown 이벤트에 작성한다. this.txtMemo.KeyDown += (sender, e) => { if (e.Modifiers == Keys.Control && e.KeyCode == Keys.V) { var clipboard = Clipboard.GetData(DataFormats.Text).ToString(); this.txtMemo.Text = clipboard; } }; 텍스트가 아닌 다른 데이터라면 DataFormats.Text을 데이터에 맞는 포멧으로 바꾸어주고 그에 따른 나머지 코딩부분은 각자 알아서~ ㅡ.ㅡ
상단의 간단한 텍스트버튼에디트(?) 암튼 참고로 DevExpress의 ButtonEdit를 흉내낸것이다. 프로젝트(UserControls)를 한개 만들고 사용자정의컨트롤을 하나 만들자. 이름은 ButtonEdit.cs 로 하였다.. 텍스트박스한개, 라벨한개 추가해서 대충 디자인하고. 텍스트박스 Name : txtEdit Anchor : Top, Left, Right BorderStyle : FixedSingle 라벨 Name : lblButton Anchor : Top, Right AutoSize : False BorderStyle : FixedSingle 디자인이 끝났으면 코딩을 해야쥐 ButtonEdit.cs 코드 using System; using System.Collections.Generic; ..
자신의 IP주소 알아내기 - 방법1 using System.Management; 사용 System.Management 참조추가 string ip = string.Empty; ManagementObjectSearcher query = new ManagementObjectSearcher("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled='TRUE'"); ManagementObjectCollection queryCol = query.Get(); foreach (ManagementObject mo in queryCol) { string[] address = (string[])mo["IPAddress"]; foreach (string ipaddre..