[C#] Color Table

.AliceBlue
240,248,255
.LightSalmon
255,160,122
.AntiqueWhite
250,235,215
.LightSeaGreen
32,178,170
.Aqua
0,255,255
.LightSkyBlue
135,206,250
.Aquamarine
127,255,212
.LightSlateGray
119,136,153
.Azure
240,255,255
.LightSteelBlue
176,196,222
.Beige
245,245,220
.LightYellow
255,255,224
.Bisque
255,228,196
.Lime
0,255,0
.Black
0,0,0
.LimeGreen
50,205,50
.BlanchedAlmond
255,255,205
.Linen
250,240,230
.Blue
0,0,255
.Magenta
255,0,255
.BlueViolet
138,43,226
.Maroon
128,0,0
.Brown
165,42,42
.MediumAquamarine
102,205,170
.BurlyWood
222,184,135
.MediumBlue
0,0,205
.CadetBlue
95,158,160
.MediumOrchid
186,85,211
.Chartreuse
127,255,0
.MediumPurple
147,112,219
.Chocolate
210,105,30
.MediumSeaGreen
60,179,113
.Coral
255,127,80
.MediumSlateBlue
123,104,238
.CornflowerBlue
100,149,237
.MediumSpringGreen
0,250,154
.Cornsilk
255,248,220
.MediumTurquoise
72,209,204
.Crimson
220,20,60
.MediumVioletRed
199,21,112
.Cyan
0,255,255
.MidnightBlue
25,25,112
.DarkBlue
0,0,139
.MintCream
245,255,250
.DarkCyan
0,139,139
.MistyRose
255,228,225
.DarkGoldenrod
184,134,11
.Moccasin
255,228,181
.DarkGray
169,169,169
.NavajoWhite
255,222,173
.DarkGreen
0,100,0
.Navy
0,0,128
.DarkKhaki
189,183,107
.OldLace
253,245,230
.DarkMagena
139,0,139
.Olive
128,128,0
.DarkOliveGreen
85,107,47
.OliveDrab
107,142,45
.DarkOrange
255,140,0
.Orange
255,165,0
.DarkOrchid
153,50,204
.OrangeRed
255,69,0
.DarkRed
139,0,0
.Orchid
218,112,214
.DarkSalmon
233,150,122
.PaleGoldenrod
238,232,170
.DarkSeaGreen
143,188,143
.PaleGreen
152,251,152
.DarkSlateBlue
72,61,139
.PaleTurquoise
175,238,238
.DarkSlateGray
40,79,79
.PaleVioletRed
219,112,147
.DarkTurquoise
0,206,209
.PapayaWhip
255,239,213
.DarkViolet
148,0,211
.PeachPuff
255,218,155
.DeepPink
255,20,147
.Peru
205,133,63
.DeepSkyBlue
0,191,255
.Pink
255,192,203
.DimGray
105,105,105
.Plum
221,160,221
.DodgerBlue
30,144,255
.PowderBlue
176,224,230
.Firebrick
178,34,34
.Purple
128,0,128
.FloralWhite
255,250,240
.Red
255,0,0
.ForestGreen
34,139,34
.RosyBrown
188,143,143
.Fuschia
255,0,255
.RoyalBlue
65,105,225
.Gainsboro
220,220,220
.SaddleBrown
139,69,19
.GhostWhite
248,248,255
.Salmon
250,128,114
.Gold
255,215,0
.SandyBrown
244,164,96
.Goldenrod
218,165,32
.SeaGreen
46,139,87
.Gray
128,128,128
.Seashell
255,245,238
.Green
0,128,0
.Sienna
160,82,45
.GreenYellow
173,255,47
.Silver
192,192,192
.Honeydew
240,255,240
.SkyBlue
135,206,235
.HotPink
255,105,180
.SlateBlue
106,90,205
.IndianRed
205,92,92
.SlateGray
112,128,144
.Indigo
75,0,130
.Snow
255,250,250
.Ivory
255,240,240
.SpringGreen
0,255,127
.Khaki
240,230,140
.SteelBlue
70,130,180
.Lavender
230,230,250
.Tan
210,180,140
.LavenderBlush
255,240,245
.Teal
0,128,128
.LawnGreen
124,252,0
.Thistle
216,191,216
.LemonChiffon
255,250,205
.Tomato
253,99,71
.LightBlue
173,216,230
.Turquoise
64,224,208
.LightCoral
240,128,128
.Violet
238,130,238
.LightCyan
224,255,255
.Wheat
245,222,179
.LightGoldenrodYellow
250,250,210
.White
255,255,255
.LightGreen
144,238,144
.WhiteSmoke
245,245,245
.LightGray
211,211,211
.Yellow
255,255,0
.LightPink
255,182,193
.YellowGreen
154,205,50

나의일/.NET 2010/06/25 10:23

[C#] ListView DoubleBuffered 속성설정

ListView나 일반 컨트롤들의 non-public methods인 DoubleBuffered 속성을 Reflection을 이용해서 설정하는 방법

public static void
SetDoubleBuffered(Control control)
{
  // set instance non-public property with name "DoubleBuffered" to true
  typeof(Control).InvokeMember("DoubleBuffered",
      BindingFlags.SetProperty | BindingFlags.Instance | BindingFlags.NonPublic,
      null, control, new object[] { true });
}
나의일/.NET 2010/05/06 18:13

[C#] MDI Form Icon 버그

MID로 개발할때 Child Form의 FormBorderStyle 속성이 Sizable이고 WindowState가 Maximized 일경우 아이콘이 VS 디폴트 아이콘으로 나타나는 현상이 있다.
VS 버그 같은데..아직 해결이 안되었나 보다.
해결방법은..

자식폼의 FormBorderStyle 속성을 FixedDialog해두고
아래 이벤트를 정의하면 된다.

private void MDIChild_SizeChanged(object sender, EventArgs e)
        {
            if (WindowState == FormWindowState.Maximized)
                if (FormBorderStyle != FormBorderStyle.Sizable)
                    FormBorderStyle = FormBorderStyle.Sizable;
        }

나의일/.NET 2010/01/28 10:20

[C#] Excel 현재 시트의 전체 데이터 범위 선택

Excel.ApplicationClass excel = new Excel.ApplicationClass();
excel.Application.Workbooks.Add(true);

Excel.Range range = GetDocPropRange(excel);
range.Font.Size = 10;
range.Columns.AutoFit();  

private Excel.Range GetDocPropRange(Excel.ApplicationClass ThisApplication)
{
      Excel.Worksheet ws = (Excel.Worksheet)ThisApplication.Worksheets[1];
      Excel.Range range = ws.get_Range("A1", Type.Missing);
      range = range.get_End(Excel.XlDirection.xlToRight);
      range = range.get_End(Excel.XlDirection.xlDown);           

      // 현재 시트의 데이터 전체를 커버하도록 range
      range = ws.get_Range("A1", range);

      return range;
}

나의일/.NET 2010/01/19 10:26

[C#] 윈도 종료시 Tray 프로세스 종료

private void frmMain_FormClosing(object sender, FormClosingEventArgs e)
{
            if (e.CloseReason == CloseReason.UserClosing)
            {
                      e.Cancel = true;
                      this.Visible = false;
            }
           else if (e.CloseReason == CloseReason.WindowsShutDown)
           {
                     // 윈도 종료시 종료처리 코드
            }
}
나의일/.NET 2010/01/13 19:51

[C#] 파라미터가 존재하는 인터넷 창 열기

System.Diagnostics.ProcessStartInfo pro = new System.Diagnostics.ProcessStartInfo(“iexplore.exe”, “http://www.microsoft.com/downloads/details.aspx?displaylang=ko&FamilyID=10cc340b-f857-4a14-83f5-25634c3bf043”);

System.Diagnostics.Process.Start(pro);

나의일/.NET 2010/01/13 19:42

방법: 16진수 문자열 변환(C# 프로그래밍 가이드)

이 예제에서는 string에 있는 각 문자의 16진수 값을 출력합니다. 먼저 string을 문자 배열로 구문 분석합니다. 그런 다음 각 문자에 대해 ToInt32(Char)를 호출하여 해당 숫자 값을 가져옵니다. 마지막으로 이 숫자를 16진수 형식으로 string에 나타냅니다.


C#
string input = "Hello World!";
char[] values = input.ToCharArray();
foreach (char c in values)
{
    // Get the integral value of the character.
    int value = Convert.ToInt32(c);
    // Convert the decimal value to a hexadecimal value in string form.
    string hex = String.Format("{0:X}", value);
    Console.WriteLine("Hexadecimal value of {0} is {1}", c, hex);
}

Hexadecimal value of H is 48
Hexadecimal value of e is 65
Hexadecimal value of l is 6C
Hexadecimal value of l is 6C
Hexadecimal value of o is 6F
Hexadecimal value of   is 20
Hexadecimal value of W is 57
Hexadecimal value of o is 6F
Hexadecimal value of r is 72
Hexadecimal value of l is 6C
Hexadecimal value of d is 64
Hexadecimal value of ! is 21

이 예제에서는 16진수 값의 string을 구문 분석하고 각 16진수 값에 해당하는 문자를 출력합니다. 먼저 Split(array<Char>[]()[]) 메서드를 호출하여 각 16진수 값을 배열의 개별 string으로 가져옵니다. 그런 다음 ToInt32(String, Int32)를 호출하여 16진수 값을 int로 표현되는 10진수로 변환합니다. 이 예제에서는 문자 코드에 해당하는 문자를 가져오는 두 가지 방법을 보여 줍니다. 첫 번째 방법에서는 정수 인수에 해당하는 문자를 string으로 반환하는 ConvertFromUtf32(Int32)를 사용합니다. 두 번째 방법에서는 intchar로 명시적으로 캐스팅합니다.

string hexValues = "48 65 6C 6C 6F 20 57 6F 72 6C 64 21";
string[] hexValuesSplit = hexValues.Split(' ');
foreach (String hex in hexValuesSplit)
{
    // Convert the number expressed in base-16 to an integer.
    int value = Convert.ToInt32(hex, 16);
    // Get the character corresponding to the integral value.
    string stringValue = Char.ConvertFromUtf32(value);
    char charValue = (char)value;
    Console.WriteLine("hexadecimal value = {0}, int value = {1}, char value = {2} or {3}", hex, value, stringValue, charValue);
}

hexadecimal value = 48, int value = 72, char value = H or H
hexadecimal value = 65, int value = 101, char value = e or e
hexadecimal value = 6C, int value = 108, char value = l or l
hexadecimal value = 6C, int value = 108, char value = l or l
hexadecimal value = 6F, int value = 111, char value = o or o
hexadecimal value = 20, int value = 32, char value =   or
hexadecimal value = 57, int value = 87, char value = W or W
hexadecimal value = 6F, int value = 111, char value = o or o
hexadecimal value = 72, int value = 114, char value = r or r
hexadecimal value = 6C, int value = 108, char value = l or l
hexadecimal value = 64, int value = 100, char value = d or d
hexadecimal value = 21, int value = 33, char value = ! or !

이 예제에서는 Parse(String, NumberStyles) 메서드를 호출하여 16진수 string을 정수로 변환하는 다른 방법을 보여 줍니다.

string hexString = "8E2";
int num = Int32.Parse(hexString, System.Globalization.NumberStyles.HexNumber);
Console.WriteLine(num);



출처: http://msdn.microsoft.com/ko-kr/library/bb311038.aspx
나의일/.NET 2008/08/01 16:16

[c#] String.Format 예제

// This code example demonstrates the String.Format() method.
// Formatting for this example uses the "en-US" culture.

using System;
class Sample
{
    enum Color {Yellow = 1, Blue, Green};
    static DateTime thisDate = DateTime.Now;

    public static void Main()
    {
// Store the output of the String.Format method in a string.
    string s = "";

    Console.Clear();

// Format a negative integer or floating-point number in various ways.
    Console.WriteLine("Standard Numeric Format Specifiers");
    s = String.Format(
        "(C) Currency: . . . . . . . . {0:C}\n" +
        "(D) Decimal:. . . . . . . . . {0:D}\n" +
        "(E) Scientific: . . . . . . . {1:E}\n" +
        "(F) Fixed point:. . . . . . . {1:F}\n" +
        "(G) General:. . . . . . . . . {0:G}\n" +
        "    (default):. . . . . . . . {0} (default = 'G')\n" +
        "(N) Number: . . . . . . . . . {0:N}\n" +
        "(P) Percent:. . . . . . . . . {1:P}\n" +
        "(R) Round-trip: . . . . . . . {1:R}\n" +
        "(X) Hexadecimal:. . . . . . . {0:X}\n",
        -123, -123.45f);
    Console.WriteLine(s);

// Format the current date in various ways.
    Console.WriteLine("Standard DateTime Format Specifiers");
    s = String.Format(
        "(d) Short date: . . . . . . . {0:d}\n" +
        "(D) Long date:. . . . . . . . {0:D}\n" +
        "(t) Short time: . . . . . . . {0:t}\n" +
        "(T) Long time:. . . . . . . . {0:T}\n" +
        "(f) Full date/short time: . . {0:f}\n" +
        "(F) Full date/long time:. . . {0:F}\n" +
        "(g) General date/short time:. {0:g}\n" +
        "(G) General date/long time: . {0:G}\n" +
        "    (default):. . . . . . . . {0} (default = 'G')\n" +
        "(M) Month:. . . . . . . . . . {0:M}\n" +
        "(R) RFC1123:. . . . . . . . . {0:R}\n" +
        "(s) Sortable: . . . . . . . . {0:s}\n" +
        "(u) Universal sortable: . . . {0:u} (invariant)\n" +
        "(U) Universal sortable: . . . {0:U}\n" +
        "(Y) Year: . . . . . . . . . . {0:Y}\n",
        thisDate);
    Console.WriteLine(s);

// Format a Color enumeration value in various ways.
    Console.WriteLine("Standard Enumeration Format Specifiers");
    s = String.Format(
        "(G) General:. . . . . . . . . {0:G}\n" +
        "    (default):. . . . . . . . {0} (default = 'G')\n" +
        "(F) Flags:. . . . . . . . . . {0:F} (flags or integer)\n" +
        "(D) Decimal number: . . . . . {0:D}\n" +
        "(X) Hexadecimal:. . . . . . . {0:X}\n",
        Color.Green);      
    Console.WriteLine(s);
    }
}
/*
This code example produces the following results:

Standard Numeric Format Specifiers
(C) Currency: . . . . . . . . ($123.00)
(D) Decimal:. . . . . . . . . -123
(E) Scientific: . . . . . . . -1.234500E+002
(F) Fixed point:. . . . . . . -123.45
(G) General:. . . . . . . . . -123
    (default):. . . . . . . . -123 (default = 'G')
(N) Number: . . . . . . . . . -123.00
(P) Percent:. . . . . . . . . -12,345.00 %
(R) Round-trip: . . . . . . . -123.45
(X) Hexadecimal:. . . . . . . FFFFFF85

Standard DateTime Format Specifiers
(d) Short date: . . . . . . . 6/26/2004
(D) Long date:. . . . . . . . Saturday, June 26, 2004
(t) Short time: . . . . . . . 8:11 PM
(T) Long time:. . . . . . . . 8:11:04 PM
(f) Full date/short time: . . Saturday, June 26, 2004 8:11 PM
(F) Full date/long time:. . . Saturday, June 26, 2004 8:11:04 PM
(g) General date/short time:. 6/26/2004 8:11 PM
(G) General date/long time: . 6/26/2004 8:11:04 PM
    (default):. . . . . . . . 6/26/2004 8:11:04 PM (default = 'G')
(M) Month:. . . . . . . . . . June 26
(R) RFC1123:. . . . . . . . . Sat, 26 Jun 2004 20:11:04 GMT
(s) Sortable: . . . . . . . . 2004-06-26T20:11:04
(u) Universal sortable: . . . 2004-06-26 20:11:04Z (invariant)
(U) Universal sortable: . . . Sunday, June 27, 2004 3:11:04 AM
(Y) Year: . . . . . . . . . . June, 2004

Standard Enumeration Format Specifiers
(G) General:. . . . . . . . . Green
    (default):. . . . . . . . Green (default = 'G')
(F) Flags:. . . . . . . . . . Green (flags or integer)
(D) Decimal number: . . . . . 3
(X) Hexadecimal:. . . . . . . 00000003*/

출처: http://msdn.microsoft.com/ko-kr/library/1ksz8yb7.aspx

나의일/.NET 2008/07/22 14:23

Visual Studio 2005 - 스마트 장치 프로젝트 형식 선택

Visual C# 및 Visual Basic

템플릿 이름 지원되는 장치 설명

장치 응용 프로그램

Pocket PC 2003, Windows CE 5.0

.NET Compact Framework 2.0 Windows Forms 응용 프로그램을 만들기 위한 프로젝트

컨트롤 라이브러리

Pocket PC 2003, Windows CE 5.0

.NET Compact Framework 2.0 컨트롤을 만들기 위한 프로젝트

클래스 라이브러리

Pocket PC 2003, Windows CE 5.0

.NET Compact Framework 2.0 클래스 라이브러리(DLL)를 만들기 위한 프로젝트

콘솔 응용 프로그램

Pocket PC 2003, Windows CE 5.0

.NET Compact Framework 2.0 비GUI 응용 프로그램을 만들기 위한 프로젝트

빈 프로젝트

Pocket PC 2003, Windows CE 5.0

.NET Compact Framework 2.0 응용 프로그램을 만들기 위한 빈 프로젝트

장치 응용 프로그램(1.0)

Pocket PC 2003, Smartphone 2003

.NET Compact Framework 1.0 Windows Forms 응용 프로그램을 만들기 위한 프로젝트

클래스 라이브러리(1.0)

Pocket PC 2003, Smartphone 2003

.NET Compact Framework 1.0 클래스 라이브러리(DLL)를 만들기 위한 프로젝트

콘솔 응용 프로그램(1.0)

Pocket PC 2003, Smartphone 2003

.NET Compact Framework 1.0 비GUI 응용 프로그램을 만들기 위한 프로젝트

빈 프로젝트(1.0)

Pocket PC 2003, Smartphone 2003

.NET Compact Framework 1.0 응용 프로그램을 만들기 위한 빈 프로젝트

Visual C++

템플릿 이름 지원되는 장치 설명

ATL 스마트 장치 프로젝트

Pocket PC 2003, Smartphone 2003, Windows CE 5.0

ATL(Active Template Library)을 사용하여 응용 프로그램을 만들기 위한 프로젝트

MFC 스마트 장치 프로젝트

Pocket PC 2003, Smartphone 2003, Windows CE 5.0

MFC 라이브러리를 사용하여 응용 프로그램을 만들기 위한 프로젝트

MFC 스마트 장치 ActiveX 컨트롤

Pocket PC 2003, Smartphone 2003, Windows CE 5.0

MFC 라이브러리를 사용하여 ActiveX 컨트롤을 만들기 위한 프로젝트

MFC 스마트 장치 DLL

Pocket PC 2003, Smartphone 2003, Windows CE 5.0

MFC 라이브러리를 사용하여 DLL을 만들기 위한 프로젝트

Win32 프로젝트

Pocket PC 2003, Smartphone 2003, Windows CE 5.0

Win32 응용 프로그램을 만들기 위한 프로젝트

기타 프로젝트 형식

템플릿 이름 지원되는 장치 주석

스마트 장치 CAB 프로젝트

Pocket PC 2003, Smartphone 2003, Windows CE 5.0

스마트 장치 응용 프로그램을 배포하는 CAB 파일을 만들기 위한 프로젝트

나의일/.NET 2008/05/09 11:21

IIS에서 ASP.NET 2.0 웹 서비스 확장이 안보일때..

전제 : Windows Server 2003 (IIS 6.0)
현상 : IIS에서 웹 서비스 확장을 눌러보면 ASP.NET 2.0 이 안보인다
원인 : .Net Framework 2.0이 설치된 이후에 IIS가 깔린 경우 IIS에서는 .NET Framework 2.0을 인지하지 못함
해결책 :

C:\WINDOWS\Microsoft.NET\Framework\v.2.0.50727\aspnet_regiis -i

나의일/.NET 2008/01/17 16:09
Powerd by Tistory, designed by criuce
rss