<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title>As time goes by</title>
		<link>http://six605.tistory.com/</link>
		<description>기적은 없다. 기술만 있을 뿐.</description>
		<language>ko</language>
		<pubDate>Mon, 20 Feb 2012 17:13:10 +0900</pubDate>
		<generator>Tistory 1.1 (http://www.tistory.com/)</generator>
		<managingEditor>six605</managingEditor>
		<image>
		<title>As time goes by</title>
		<url><![CDATA[http://cfile1.uf.tistory.com/image/1547024B4D3A2EB62B02D5]]></url>
		<link>http://six605.tistory.com/</link>
		<description>기적은 없다. 기술만 있을 뿐.</description>
		</image>
		<item>
			<title>DateTime Format, CultureInfo format</title>
			<link>http://six605.tistory.com/556</link>
			<description>&lt;br /&gt;
DateTime 타입의 인스턴스로 시간값을 가지고 있을 때 ToString() 메소드를 이용해서 시간값을 여러가지 타입으로 출력할 수 있다. 월, 요일 값들을 일일이 변환해 주지 않아도 되는 편리함이 있다. 여기서 한 가지 더! 시간값을 지역 언어 설정값에 따라 지역 월, 요일 값들을 지역화 해서 출력해 주며 또한 년, 월, 일 출력 순서 또한 알맞게 변환해서 출력해 준다. 다국어 프로그래밍에 참조하면 시간을 많이 절약할 수 있을 것 같다.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;syntax&quot; style=&quot;color: rgb(0, 0, 0); line-height: normal; text-align: left; &quot;&gt;&lt;span class=&quot;lang&quot;&gt;[C#]
&lt;/span&gt;&lt;b&gt;public virtual &lt;/b&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.string&quot; style=&quot;color: rgb(150, 11, 180); text-decoration: none; &quot;&gt;string&lt;/a&gt;&lt;b&gt; ToString(&lt;/b&gt;
&lt;b&gt; &lt;/b&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.string&quot; style=&quot;color: rgb(150, 11, 180); text-decoration: none; &quot;&gt;string&lt;/a&gt;&lt;b&gt; &lt;/b&gt;&lt;i&gt;format&lt;/i&gt;&lt;b&gt;,&lt;/b&gt;
&lt;b&gt; &lt;/b&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.iformatprovider&quot; style=&quot;color: rgb(150, 11, 180); text-decoration: none; &quot;&gt;IFormatProvider&lt;/a&gt;&lt;b&gt; &lt;/b&gt;&lt;i&gt;provider&lt;/i&gt;
&lt;b&gt;);&lt;/b&gt;&lt;/pre&gt;&lt;br /&gt;
format 매개변수에 출력 포멧을 설정해주고, provider 매개변수에 지역 설정을 주면 된다. MSDN의 예제를 보면 다음과 같이 다양한 포멧으로 출력 가능하다.&lt;br /&gt;
&lt;pre class=&quot;code&quot; style=&quot;color: rgb(0, 0, 0); line-height: normal; text-align: left; &quot;&gt;/** Output.
   *
   * d :08/17/2000
   * D :Thursday, August 17, 2000
   * f :Thursday, August 17, 2000 16:32
   * F :Thursday, August 17, 2000 16:32:32
   * g :08/17/2000 16:32
   * G :08/17/2000 16:32:32
   * m :August 17
   * r :Thu, 17 Aug 2000 23:32:32 GMT
   * s :2000-08-17T16:32:32
   * t :16:32
   * T :16:32:32
   * u :2000-08-17 23:32:32Z
   * U :Thursday, August 17, 2000 23:32:32
   * y :August, 2000
   * dddd, MMMM dd yyyy :Thursday, August 17 2000
   * ddd, MMM d &quot;&#039;&quot;yy :Thu, Aug 17 &#039;00
   * dddd, MMMM dd :Thursday, August 17
   * M/yy :8/00
   * dd-MM-yy :17-08-00
   */&lt;/pre&gt;대단하다.&lt;br /&gt;
&lt;br /&gt;
자세한 설명은 MSDN 참조 :&amp;nbsp;
&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/Aa326722&quot;&gt;http://msdn.microsoft.com/en-us/library/Aa326722&lt;/a&gt;&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
만약 스페인어에 해당하는 정보로 출력하자면 Provider 매개변수에 스페인어 CultureInfo 인스턴를 넘겨주면 된다.&lt;br /&gt;
Label1.Text = Now.ToString(&quot;D&quot;, New System.Globalization.CultureInfo(&quot;es-ES&quot;))&lt;br /&gt;
&lt;br /&gt;대단하다.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;div class=&quot;entry-ccl&quot; style=&quot;clear: both; text-align: right; margin-bottom: 10px&quot;&gt;
	&lt;img id=&quot;ccl-icon-556-0&quot; class=&quot;entry-ccl-by&quot; src=&quot;http://i1.daumcdn.net/cfs.tistory/v/0/static/admin/editor/ccl_black01.png&quot; alt=&quot;저작자 표시&quot;/&gt;
	&lt;img id=&quot;ccl-icon-556-1&quot; class=&quot;entry-ccl-nc&quot; src=&quot;http://i1.daumcdn.net/cfs.tistory/v/0/static/admin/editor/ccl_black02.png&quot; alt=&quot;비영리&quot;/&gt;
	&lt;img id=&quot;ccl-icon-556-2&quot; class=&quot;entry-ccl-nd&quot; src=&quot;http://i1.daumcdn.net/cfs.tistory/v/0/static/admin/editor/ccl_black03.png&quot; alt=&quot;변경 금지&quot;/&gt;
	&lt;!--
	&lt;rdf:RDF xmlns=&quot;http://web.resource.org/cc/&quot; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot;&gt;
		&lt;Work rdf:about=&quot;&quot;&gt;
			&lt;license rdf:resource=&quot;http://creativecommons.org/licenses/by-nc-nd/2.0/kr/&quot; /&gt;
		&lt;/Work&gt;
		&lt;License rdf:about=&quot;http://creativecommons.org/licenses/by-nc-nd/&quot;&gt;
			&lt;permits rdf:resource=&quot;http://web.resource.org/cc/Reproduction&quot;/&gt;
			&lt;permits rdf:resource=&quot;http://web.resource.org/cc/Distribution&quot;/&gt;
			&lt;requires rdf:resource=&quot;http://web.resource.org/cc/Notice&quot;/&gt;
			&lt;requires rdf:resource=&quot;http://web.resource.org/cc/Attribution&quot;/&gt;
			&lt;prohibits rdf:resource=&quot;http://web.resource.org/cc/CommercialUse&quot;/&gt;
		&lt;/License&gt;
	&lt;/rdf:RDF&gt;
	--&gt;
&lt;/div&gt;
</description>
			<category>C#</category>
			<author>six605</author>
			<guid>http://six605.tistory.com/556</guid>
			<comments>http://six605.tistory.com/556#entry556comment</comments>
			<pubDate>Tue, 14 Feb 2012 17:20:21 +0900</pubDate>
		</item>
		<item>
			<title>Nullable 타입의 기본사용, Boxing, Operator</title>
			<link>http://six605.tistory.com/554</link>
			<description>Visual Studio 2008 C# Sample 을 보다가 Nullable 타입에 대한 예제가 있어 테스트 하며 정리해 보았다.&lt;br /&gt;
cf)&amp;nbsp;
&lt;a href=&quot;http://code.msdn.microsoft.com/Visual-Studio-2008-C-d295cdba&quot;&gt;http://code.msdn.microsoft.com/Visual-Studio-2008-C-d295cdba&lt;/a&gt;&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: 11pt; &quot;&gt;■ 기본적인 사용법&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;txc-textbox&quot; style=&quot;border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(231, 253, 181); border-right-color: rgb(231, 253, 181); border-bottom-color: rgb(231, 253, 181); border-left-color: rgb(231, 253, 181); background-color: rgb(231, 253, 181); padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; &quot;&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; class Program&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; static void Main(string[] args)&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DisplayValue(1);&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DisplayValue(null);&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // num.Value throws an InvalidOperationException if num.HasValue is false&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; static void DisplayValue(int? num)&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (num.HasValue == true)&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;num = &quot; + num);&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;num = null&quot;);&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;value = {0}&quot;, num.Value);&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; catch (InvalidOperationException e)&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(e.Message);&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;/div&gt;
HasValue 프로퍼티의 사용 방법과 nullable 타입이 null 값을 갖고 있을때 Value 프로퍼티를 사용하면 예외가 발생한다.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: 11pt; &quot;&gt;■ Boxing&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;txc-textbox&quot; style=&quot;border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(231, 253, 181); border-right-color: rgb(231, 253, 181); border-bottom-color: rgb(231, 253, 181); border-left-color: rgb(231, 253, 181); background-color: rgb(231, 253, 181); padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; &quot;&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; class Program&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; static void Main(string[] args)&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // null 값을 갖는 Nullable 타입의 박싱&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int? a;&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; object oa;&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a = null;&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // oa값에 null 값이 할당됨. boxing 일어나지 않음.&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; oa = a;&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;Testing &#039;a&#039; and &#039;boxed a&#039; for null...&quot;);&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Nullable 타입 변수는 null 값과 비교할 수 있다.&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (a == null)&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;\t a == null&quot;);&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // 박스된 nullable 변수는 null 값과 비교할 수 있다.&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // nullable 값을 박싱할 때, HasValue 값이 false 값을 갖는다면&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // 참조값을 null로 설정하기 때문이다.&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (oa == null)&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;\t oa == null&quot;);&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Nullable 타입의 언박싱&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;Unboxing a nullable type...&quot;);&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int? b = 10;&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; object ob = b;&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // 박스된 nullable 타입을 언박스 시킬 수 있다.&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int? unBoxedB = (int?)ob;&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;\t b = {0}, unBoxedB = {1}&quot;, b, unBoxedB);&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // 박스된 nullable 타입의 값이 null 이라면 언박스 된 값도 null 이 된다.&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int? unBoxedA = (int?)oa;&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (oa == null &amp;amp;&amp;amp; unBoxedA == null)&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;\t a and unBoxedA are null&quot;);&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // 박싱된 nullable 타입을 nullable이 아닌 타입에 언박싱 시킬 수 없다.&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;Attempting to unbox into non-nullable type...&quot;);&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int unBoxedA2 = (int)oa;&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; catch (Exception e)&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;\t {0}&quot;, e.Message);&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style=&quot;margin:0&quot;&gt;&lt;div class=&quot;imageblock&quot; style=&quot;display:inline;&quot;&gt;&lt;img src=&quot;http://cfile26.uf.tistory.com/image/181F5D354F17B9DD1EC723&quot; alt=&quot;&quot; filemime=&quot;image/jpeg&quot; filename=&quot;1.png&quot; height=&quot;161&quot; width=&quot;483&quot;/&gt;&lt;/div&gt;&lt;/p&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: 11pt; &quot;&gt;■ ?? 연산자의 사용&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;txc-textbox&quot; style=&quot;border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(231, 253, 181); border-right-color: rgb(231, 253, 181); border-bottom-color: rgb(231, 253, 181); border-left-color: rgb(231, 253, 181); background-color: rgb(231, 253, 181); padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; &quot;&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; class Program&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; static void Main(string[] args)&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // ?? 연산자의 사용&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // 예제에서 x의 값이 null 이 아니면 x를 리턴, null 이면 -1을 리턴한다.&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int? x = null;&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int y = x ?? -1;&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;y == &quot; + y);&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Nullable Int 타입의 값을 Int 타입에 저장하는 방법&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // default 키워드는 해당 타입의 기본값을 리턴한다.&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int i = GetNullableInt() ?? default(int);&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;i == &quot; + i);&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // ?? 연산자는 참조 타입에 대해서도 사용할 수 있다.&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string s = GetStringValue();&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;s = {0}&quot;, s ?? &quot;null&quot;);&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; static int? GetNullableInt()&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return null;&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; static string GetStringValue()&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return null;&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style=&quot;margin:0&quot;&gt;&lt;div class=&quot;imageblock&quot; style=&quot;display:inline;&quot;&gt;&lt;img src=&quot;http://cfile23.uf.tistory.com/image/1535B7344F17BA07281DE6&quot; alt=&quot;&quot; filemime=&quot;image/jpeg&quot; filename=&quot;2.png&quot; height=&quot;80&quot; width=&quot;216&quot;/&gt;&lt;/div&gt;&lt;/p&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: 11pt; &quot;&gt;&lt;span style=&quot;font-size: 11pt; &quot;&gt;■&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt; &quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt; &quot;&gt;Demo source&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;p style=&quot;margin:0&quot;&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;a href=&quot;http://six605.tistory.com/attachment/cfile24.uf@147F35474F17BA59223573.zip&quot;&gt;&lt;img src=&quot;http://i1.daumcdn.net/cfs.tistory/v/0/blog/image/extension/zip.gif&quot; alt=&quot;&quot; style=&quot;vertical-align: middle;&quot; /&gt; NullableBasicDemo.zip&lt;/a&gt;&lt;/div&gt;&lt;/p&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
cf)&lt;br /&gt;
&lt;a href=&quot;http://six605.tistory.com/376&quot; target=&quot;_blank&quot; title=&quot;[http://six605.tistory.com/376]로 이동합니다.&quot;&gt;Nullable 형식 사용(C# 프로그래밍 가이드)&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
@&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;div class=&quot;entry-ccl&quot; style=&quot;clear: both; text-align: right; margin-bottom: 10px&quot;&gt;
	&lt;img id=&quot;ccl-icon-554-0&quot; class=&quot;entry-ccl-by&quot; src=&quot;http://i1.daumcdn.net/cfs.tistory/v/0/static/admin/editor/ccl_black01.png&quot; alt=&quot;저작자 표시&quot;/&gt;
	&lt;img id=&quot;ccl-icon-554-1&quot; class=&quot;entry-ccl-nc&quot; src=&quot;http://i1.daumcdn.net/cfs.tistory/v/0/static/admin/editor/ccl_black02.png&quot; alt=&quot;비영리&quot;/&gt;
	&lt;img id=&quot;ccl-icon-554-2&quot; class=&quot;entry-ccl-nd&quot; src=&quot;http://i1.daumcdn.net/cfs.tistory/v/0/static/admin/editor/ccl_black03.png&quot; alt=&quot;변경 금지&quot;/&gt;
	&lt;!--
	&lt;rdf:RDF xmlns=&quot;http://web.resource.org/cc/&quot; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot;&gt;
		&lt;Work rdf:about=&quot;&quot;&gt;
			&lt;license rdf:resource=&quot;http://creativecommons.org/licenses/by-nc-nd/2.0/kr/&quot; /&gt;
		&lt;/Work&gt;
		&lt;License rdf:about=&quot;http://creativecommons.org/licenses/by-nc-nd/&quot;&gt;
			&lt;permits rdf:resource=&quot;http://web.resource.org/cc/Reproduction&quot;/&gt;
			&lt;permits rdf:resource=&quot;http://web.resource.org/cc/Distribution&quot;/&gt;
			&lt;requires rdf:resource=&quot;http://web.resource.org/cc/Notice&quot;/&gt;
			&lt;requires rdf:resource=&quot;http://web.resource.org/cc/Attribution&quot;/&gt;
			&lt;prohibits rdf:resource=&quot;http://web.resource.org/cc/CommercialUse&quot;/&gt;
		&lt;/License&gt;
	&lt;/rdf:RDF&gt;
	--&gt;
&lt;/div&gt;
</description>
			<category>C#</category>
			<author>six605</author>
			<guid>http://six605.tistory.com/554</guid>
			<comments>http://six605.tistory.com/554#entry554comment</comments>
			<pubDate>Thu, 19 Jan 2012 15:38:26 +0900</pubDate>
		</item>
		<item>
			<title>About XAML</title>
			<link>http://six605.tistory.com/552</link>
			<description>&lt;br /&gt;
xml이 무엇인지 모르고, xaml이 무엇인지도 모르고 WPF를 한다는건 말도 안되지.&lt;br /&gt;
xaml 코드를 Copy &amp;amp; Paste 만 한다면 끝나는게 아니니까.&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;a href=&quot;http://himskim.egloos.com/1589286&quot; target=&quot;_blank&quot; title=&quot;[http://himskim.egloos.com/1589286]로 이동합니다.&quot;&gt;WPF Deep Dive -2 XAML 이란&lt;/a&gt; - 김명신의 즐거운 하루&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;@&lt;div class=&quot;entry-ccl&quot; style=&quot;clear: both; text-align: right; margin-bottom: 10px&quot;&gt;
	&lt;img id=&quot;ccl-icon-552-0&quot; class=&quot;entry-ccl-by&quot; src=&quot;http://i1.daumcdn.net/cfs.tistory/v/0/static/admin/editor/ccl_black01.png&quot; alt=&quot;저작자 표시&quot;/&gt;
	&lt;img id=&quot;ccl-icon-552-1&quot; class=&quot;entry-ccl-nc&quot; src=&quot;http://i1.daumcdn.net/cfs.tistory/v/0/static/admin/editor/ccl_black02.png&quot; alt=&quot;비영리&quot;/&gt;
	&lt;img id=&quot;ccl-icon-552-2&quot; class=&quot;entry-ccl-nd&quot; src=&quot;http://i1.daumcdn.net/cfs.tistory/v/0/static/admin/editor/ccl_black03.png&quot; alt=&quot;변경 금지&quot;/&gt;
	&lt;!--
	&lt;rdf:RDF xmlns=&quot;http://web.resource.org/cc/&quot; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot;&gt;
		&lt;Work rdf:about=&quot;&quot;&gt;
			&lt;license rdf:resource=&quot;http://creativecommons.org/licenses/by-nc-nd/2.0/kr/&quot; /&gt;
		&lt;/Work&gt;
		&lt;License rdf:about=&quot;http://creativecommons.org/licenses/by-nc-nd/&quot;&gt;
			&lt;permits rdf:resource=&quot;http://web.resource.org/cc/Reproduction&quot;/&gt;
			&lt;permits rdf:resource=&quot;http://web.resource.org/cc/Distribution&quot;/&gt;
			&lt;requires rdf:resource=&quot;http://web.resource.org/cc/Notice&quot;/&gt;
			&lt;requires rdf:resource=&quot;http://web.resource.org/cc/Attribution&quot;/&gt;
			&lt;prohibits rdf:resource=&quot;http://web.resource.org/cc/CommercialUse&quot;/&gt;
		&lt;/License&gt;
	&lt;/rdf:RDF&gt;
	--&gt;
&lt;/div&gt;
</description>
			<category>WPF</category>
			<author>six605</author>
			<guid>http://six605.tistory.com/552</guid>
			<comments>http://six605.tistory.com/552#entry552comment</comments>
			<pubDate>Wed, 18 Jan 2012 10:59:57 +0900</pubDate>
		</item>
		<item>
			<title>[VS2010] InstallShield Limited Edition</title>
			<link>http://six605.tistory.com/551</link>
			<description>&lt;br /&gt;
InstallShield Limited Edition 은 &amp;nbsp;Visual Studio 개발자를 위한 Install Shield 의 무료버전이다.&lt;br /&gt;
제한된 기능을 사용할 수 있으며 모든 기능을 사용하려면 Install Shield 2010 전체 버전으로 업그레이드를 받아야 한다.&amp;nbsp;&lt;br /&gt;
기존 &amp;nbsp;Visual Studio 설치 및 배포 프로젝트를 이용한 배포 도구는 추 후 Visual Studio 에서 지원하지 않을 예정이라고 한다.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: 11pt; &quot;&gt;VS2010에서 제공하는 배포 도구 비교&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;a href=&quot;http://msdn.microsoft.com/ko-kr/library/ee721500.aspx&quot; target=&quot;_blank&quot; title=&quot;[http://msdn.microsoft.com/ko-kr/library/ee721500.aspx]로 이동합니다.&quot;&gt;Windows Installer 배포 도구 선택 - MSDN&lt;/a&gt;&lt;br /&gt;
&lt;p style=&quot;margin:0&quot;&gt;&lt;div class=&quot;imageblock&quot; style=&quot;display:inline;&quot;&gt;&lt;img src=&quot;http://cfile23.uf.tistory.com/image/186568494EF6A4BC2BE2CA&quot; alt=&quot;&quot; filemime=&quot;image/jpeg&quot; filename=&quot;1.png&quot; height=&quot;94&quot; width=&quot;694&quot;/&gt;&lt;/div&gt;&lt;/p&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: 11pt; &quot;&gt;Getting Started with InstallShield Limited Edition for Visual Studio 2010&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
Install Shield 개발사인&amp;nbsp;FLEXERA software 에서 제공하는 메뉴얼. 여기있는 동영상이 참 유용하다.&lt;br /&gt;
&lt;a href=&quot;http://www.flexerasoftware.com/promolanding/10908.htm&quot;&gt;http://www.flexerasoftware.com/promolanding/10908.htm&lt;/a&gt;&amp;nbsp;&lt;br /&gt;
&lt;p style=&quot;margin:0&quot;&gt;&lt;div class=&quot;imageblock&quot; style=&quot;display:inline;&quot;&gt;&lt;img src=&quot;http://cfile23.uf.tistory.com/image/166976494EF6A9F537E7EA&quot; alt=&quot;&quot; filemime=&quot;image/jpeg&quot; filename=&quot;2.png&quot; height=&quot;62&quot; width=&quot;660&quot;/&gt;&lt;/div&gt;&lt;/p&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt; &quot;&gt;InstallShield Limited Edition 설치&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;Visual Studio 2010을 실행하여 새 프로젝트 만들기를 선택하여 대화상자를 불러온다.&lt;br /&gt;
Installed Templates -&amp;gt; Other Project Types -&amp;gt; Setup and Deployment -&amp;gt; InstallShield LE 선택&lt;br /&gt;
Enable InstallShield Limited Edition 템플릿 선택&lt;br /&gt;
&lt;p style=&quot;margin:0&quot;&gt;&lt;p style=&quot;margin:0&quot;&gt;&lt;div class=&quot;imageblock&quot; style=&quot;display:inline;&quot;&gt;&lt;img src=&quot;http://cfile5.uf.tistory.com/image/115BB54F4EF6ABDD0F42BF&quot; alt=&quot;&quot; filemime=&quot;image/jpeg&quot; filename=&quot;3.png&quot; height=&quot;236&quot; width=&quot;497&quot;/&gt;&lt;/div&gt;&lt;/p&gt;
&lt;br /&gt;&lt;br /&gt;
아직 InstallShield LE가 설치되어 있지 않기 때문에 설치 방법에 대한 페이지가 출력된다.&lt;br /&gt;
페이지 하단에 &quot;Step 2:Go to the download web site&quot; 를 클릭한다.&lt;br /&gt;
&lt;p style=&quot;margin:0&quot;&gt;&lt;div class=&quot;imageblock&quot; style=&quot;display:inline;&quot;&gt;&lt;img src=&quot;http://cfile2.uf.tistory.com/image/1122EE494EF6AC2F0D42D0&quot; alt=&quot;&quot; filemime=&quot;image/jpeg&quot; filename=&quot;3.png&quot; height=&quot;241&quot; width=&quot;626&quot;/&gt;&lt;/div&gt;&lt;/p&gt;
&amp;nbsp;&lt;/p&gt;
&lt;br /&gt;하단의 제품 다운로드를 위한 정보를 입력한다. 그런 뒤 Download Now 버튼을 눌러 제품 다운로드!&lt;br /&gt;
Email 주소를 정확히 입력해야 한다. InstallShield LE를 설치하면 쉐어웨어 버전으로 설치되어 몇일간만 사용할 수 있다. Email로 제품키를 받을 수 있으며 이 키를 이용해 인증을 받아야 한다.&lt;br /&gt;
&lt;p style=&quot;margin:0&quot;&gt;&lt;div class=&quot;imageblock&quot; style=&quot;display:inline;&quot;&gt;&lt;img src=&quot;http://cfile30.uf.tistory.com/image/18597A474EF6AC8F10C960&quot; alt=&quot;&quot; filemime=&quot;image/jpeg&quot; filename=&quot;4.png&quot; height=&quot;478&quot; width=&quot;397&quot;/&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
다운로드 받은 설치 파일을 실행하여 InstallShield LE를 설치!&lt;br /&gt;
&lt;p style=&quot;margin:0&quot;&gt;&lt;div class=&quot;imageblock&quot; style=&quot;display:inline;&quot;&gt;&lt;img src=&quot;http://cfile4.uf.tistory.com/image/192C8F3B4EF6ACE837B2D2&quot; alt=&quot;&quot; filemime=&quot;image/jpeg&quot; filename=&quot;4.png&quot; height=&quot;392&quot; width=&quot;514&quot;/&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
Email로 전달받은 제품키를 입력한다.&lt;/p&gt;
&lt;p style=&quot;margin:0&quot;&gt;&lt;div class=&quot;imageblock&quot; style=&quot;display:inline;&quot;&gt;&lt;img src=&quot;http://cfile22.uf.tistory.com/image/177B4E3C4EF6AD6208DAF5&quot; alt=&quot;&quot; filemime=&quot;image/jpeg&quot; filename=&quot;5.png&quot; height=&quot;324&quot; width=&quot;616&quot;/&gt;&lt;/div&gt;&lt;/p&gt;
&lt;br /&gt;&lt;p style=&quot;margin:0&quot;&gt;&lt;div class=&quot;imageblock&quot; style=&quot;display:inline;&quot;&gt;&lt;img src=&quot;http://cfile29.uf.tistory.com/image/152B94344EF6AD881C6588&quot; alt=&quot;&quot; filemime=&quot;image/jpeg&quot; filename=&quot;6.png&quot; height=&quot;324&quot; width=&quot;616&quot;/&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;&lt;p style=&quot;margin:0&quot;&gt;&lt;div class=&quot;imageblock&quot; style=&quot;display:inline;&quot;&gt;&lt;img src=&quot;http://cfile21.uf.tistory.com/image/1666EE374EF6AD9E3065F4&quot; alt=&quot;&quot; filemime=&quot;image/jpeg&quot; filename=&quot;7.png&quot; height=&quot;324&quot; width=&quot;616&quot;/&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;&lt;p style=&quot;margin:0&quot;&gt;&lt;div class=&quot;imageblock&quot; style=&quot;display:inline;&quot;&gt;&lt;img src=&quot;http://cfile26.uf.tistory.com/image/1947CD444EF6ADAE137D95&quot; alt=&quot;&quot; filemime=&quot;image/jpeg&quot; filename=&quot;8.png&quot; height=&quot;324&quot; width=&quot;616&quot;/&gt;&lt;/div&gt;&lt;/p&gt;
&lt;br /&gt;&lt;/p&gt;
&lt;br /&gt;설치 완료 후, 기존 VS2010이 실행되어 있다면 다시 실행시키자.&lt;br /&gt;
InstallShield LE 템플릿을 사용할 수 있다.&lt;br /&gt;
Installed Templates -&amp;gt; Other Project Types -&amp;gt; Setup and Deployment -&amp;gt; InstallShield LE 선택&lt;br /&gt;
Enable InstallShield Limited Edition 템플릿 선택&amp;nbsp;&amp;nbsp;&lt;br /&gt;
&lt;p style=&quot;margin:0&quot;&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;http://cfile7.uf.tistory.com/image/19450A3D4EF6ADBB142B4F&quot; alt=&quot;&quot; filemime=&quot;image/jpeg&quot; filename=&quot;9.png&quot; height=&quot;454&quot; width=&quot;694&quot;/&gt;&lt;/div&gt;&lt;/p&gt;
&lt;br /&gt;&lt;/p&gt;
&lt;br /&gt;&lt;/p&gt;
&lt;br /&gt;&lt;div class=&quot;entry-ccl&quot; style=&quot;clear: both; text-align: right; margin-bottom: 10px&quot;&gt;
	&lt;img id=&quot;ccl-icon-551-0&quot; class=&quot;entry-ccl-by&quot; src=&quot;http://i1.daumcdn.net/cfs.tistory/v/0/static/admin/editor/ccl_black01.png&quot; alt=&quot;저작자 표시&quot;/&gt;
	&lt;img id=&quot;ccl-icon-551-1&quot; class=&quot;entry-ccl-nc&quot; src=&quot;http://i1.daumcdn.net/cfs.tistory/v/0/static/admin/editor/ccl_black02.png&quot; alt=&quot;비영리&quot;/&gt;
	&lt;img id=&quot;ccl-icon-551-2&quot; class=&quot;entry-ccl-nd&quot; src=&quot;http://i1.daumcdn.net/cfs.tistory/v/0/static/admin/editor/ccl_black03.png&quot; alt=&quot;변경 금지&quot;/&gt;
	&lt;!--
	&lt;rdf:RDF xmlns=&quot;http://web.resource.org/cc/&quot; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot;&gt;
		&lt;Work rdf:about=&quot;&quot;&gt;
			&lt;license rdf:resource=&quot;http://creativecommons.org/licenses/by-nc-nd/2.0/kr/&quot; /&gt;
		&lt;/Work&gt;
		&lt;License rdf:about=&quot;http://creativecommons.org/licenses/by-nc-nd/&quot;&gt;
			&lt;permits rdf:resource=&quot;http://web.resource.org/cc/Reproduction&quot;/&gt;
			&lt;permits rdf:resource=&quot;http://web.resource.org/cc/Distribution&quot;/&gt;
			&lt;requires rdf:resource=&quot;http://web.resource.org/cc/Notice&quot;/&gt;
			&lt;requires rdf:resource=&quot;http://web.resource.org/cc/Attribution&quot;/&gt;
			&lt;prohibits rdf:resource=&quot;http://web.resource.org/cc/CommercialUse&quot;/&gt;
		&lt;/License&gt;
	&lt;/rdf:RDF&gt;
	--&gt;
&lt;/div&gt;
</description>
			<category>Visual Studio</category>
			<author>six605</author>
			<guid>http://six605.tistory.com/551</guid>
			<comments>http://six605.tistory.com/551#entry551comment</comments>
			<pubDate>Sun, 25 Dec 2011 13:08:00 +0900</pubDate>
		</item>
		<item>
			<title>Writing Debug and Trace Messages</title>
			<link>http://six605.tistory.com/550</link>
			<description>&lt;br /&gt;
원문 : &lt;a href=&quot;http://www.blackwasp.co.uk/DebugWrite.aspx&quot; target=&quot;_blank&quot; title=&quot;[http://www.blackwasp.co.uk/DebugWrite.aspx]로 이동합니다.&quot;&gt;Writing Debug and Trace Messages - BlackWasp&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
복잡한 소프트웨어는 디버깅 및 로깅 코드로 모니터링 하기 쉽게 만들어야 한다. 정말로..&lt;br /&gt;
고생해 보면 알아요.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: 11pt; &quot;&gt;What are Debug and Trace Messages?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
로그는 복잡한 소프트웨에서 사용자 인터페이스(UI)만으로 동작을 관찰하기 힘들때 사용되어 진다. 로깅 메시지는 프로그램의 문제를 파악하는데 많은 도움이 된다. .NET Framework 에서는 Debug 와 Trace 메시지를 제공해 준다.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Debug messages&lt;/b&gt;&lt;br /&gt;
System.Diagnostics 네임스페이스의 Debug 클래스 사용&lt;br /&gt;
Visual Studio로 디버그 모드로 디버깅 시 &quot;지역 창&quot; 에 출력된다.&lt;br /&gt;
메시지 작성을 위한 메소드는 Conditional 어트리뷰트와 DEBUG 심벌을 갖는다. 따라서 프로그램이 Release 모드로 컴파일 되었다면 호출되지 않는다. (디버그 메시지가 최종 사용자에게 보여지지 않음과 디버깅 동작으로 프로그램 성능 저하 방지를 보장한다.)&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Trace messages&lt;/b&gt;&lt;br /&gt;
System.Diagnostics 네임스페이스의 Trace 클래스 사용&lt;br /&gt;
TRACE 심벌이 정의되었을 때 코드에 포함된다. Visual Studio 는 기본적으로 TRACE 심벌을 포함하여 빌드한다. 따라서 모듈을 debug 또는 release 모드로 빌드하건 TRACE 코드가 모듈에 포함된다.&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: 11pt; &quot;&gt;Writing Messages&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
디버그 메시지를 기록하는 가장 간단한 방법으로 디버그 모드에서 프로그램이 실행중일 때 출력창에 메시지를 출력시키는 방법이 있다. Debug, Trace 클래스를 사용하기 위해선 다음 네임스페이스를 using 해준다.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;txc-textbox&quot; style=&quot;border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(231, 253, 181); border-right-color: rgb(231, 253, 181); border-bottom-color: rgb(231, 253, 181); border-left-color: rgb(231, 253, 181); background-color: rgb(231, 253, 181); padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; &quot;&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;using System.Diagnostics;&lt;/p&gt;
&lt;/div&gt;
&lt;br /&gt;
Debug, Trace 클래스에는 Write, WriteLine 의 Static 메소드가 존재한다. 하나의 매개변수를 받으며 어떤 타입도 사용될 수 있다. String 타입일 경우 해당 값이 출력되며, 다른 타입일 경우 ToString 메소드의 결과값이 출력된다.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;txc-textbox&quot; style=&quot;border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(231, 253, 181); border-right-color: rgb(231, 253, 181); border-bottom-color: rgb(231, 253, 181); border-left-color: rgb(231, 253, 181); background-color: rgb(231, 253, 181); padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; &quot;&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;Debug.Write(&quot;Application started (Debug)&quot;);&lt;br /&gt;
Trace.Write(&quot;Application stopped (Trace)&quot;);&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
Debug.WriteLine(&quot;Application started&quot;);&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: 11pt; &quot;&gt;Categories&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
출력하려는 디버그 메시지를 카테고리화 할 수 있다. Write, WriteLine 메서드의 두 번째 매개변수를 주면 되며 이 String 타입의 값이 카테고리의 이름이 된다.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;txc-textbox&quot; style=&quot;border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(231, 253, 181); border-right-color: rgb(231, 253, 181); border-bottom-color: rgb(231, 253, 181); border-left-color: rgb(231, 253, 181); background-color: rgb(231, 253, 181); padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; &quot;&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;Debug.Write(&quot;Application started&quot;, &quot;Debug&quot;);&lt;br /&gt;
Debug.WriteLine(&quot;Application stopped&quot;, &quot;Debug&quot;);&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;
&lt;p style=&quot;margin:0&quot;&gt;&lt;br /&gt;
&lt;div class=&quot;imageblock&quot; style=&quot;display:inline;&quot;&gt;&lt;img src=&quot;http://cfile6.uf.tistory.com/image/20654B4C4EF7C9DE022227&quot; alt=&quot;&quot; filemime=&quot;image/jpeg&quot; filename=&quot;1.png&quot; height=&quot;35&quot; width=&quot;170&quot;/&gt;&lt;/div&gt;&lt;/p&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: 11pt; &quot;&gt;Indentation&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
디버그 메시지를 읽기 쉽게 하기 위해 들여쓰기를 할 수 있다. Indent 메소드를 이용하면 들여쓰기를 하고, Unindent 메소드를 호출하면 들여쓰기를 취소한다.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;txc-textbox&quot; style=&quot;border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(231, 253, 181); border-right-color: rgb(231, 253, 181); border-bottom-color: rgb(231, 253, 181); border-left-color: rgb(231, 253, 181); background-color: rgb(231, 253, 181); padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; &quot;&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;Debug.WriteLine(&quot;Application started&quot;, &quot;Application&quot;);&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;Debug.Indent();&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;Debug.WriteLine(&quot;Processing input XML&quot;, &quot;File Import&quot;);&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;Debug.WriteLine(&quot;Imported 300 row(s)&quot;, &quot;File Import&quot;);&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;Debug.Unindent();&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;Debug.WriteLine(&quot;Application stopped&quot;, &quot;Application&quot;);&lt;/p&gt;
&lt;/div&gt;
&lt;p style=&quot;margin:0&quot;&gt;&lt;br /&gt;
&lt;div class=&quot;imageblock&quot; style=&quot;display:inline;&quot;&gt;&lt;img src=&quot;http://cfile24.uf.tistory.com/image/1262FB4F4EF7CAD23428F3&quot; alt=&quot;&quot; filemime=&quot;image/jpeg&quot; filename=&quot;2.png&quot; height=&quot;65&quot; width=&quot;235&quot;/&gt;&lt;/div&gt;&lt;/p&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: 11pt; &quot;&gt;Writing Messages Conditionally&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
디버그 메시지를 원하는 조건일때만 출력하고 싶을 경우가 있다. if 또는 switch 조건문안에서 디비그 메시지를 기록해도 되지만 이 방법은 코드 가독성이 떨어진다.&lt;br /&gt;
Debug, Trace 클래스는 조건 매개변수를 갖는 Write, WriteLine 메소드를 제공한다. WriteIf, WriteLineIf 메서드가 있으며 이 메소드는 첫 번째 매개번수 값이 true 일 경우만 메시지를 기록한다.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;txc-textbox&quot; style=&quot;border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(231, 253, 181); border-right-color: rgb(231, 253, 181); border-bottom-color: rgb(231, 253, 181); border-left-color: rgb(231, 253, 181); background-color: rgb(231, 253, 181); padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; &quot;&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;Debug.WriteLineIf(loggingEnabled, &quot;Application started&quot;, &quot;Application&quot;);&lt;/p&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: 11pt; &quot;&gt;&lt;b&gt;Using Trace Listeners&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Debug, Trace 클래스는 Listeners 프로퍼티를 갖는다. Listeners 프로퍼티는 메시지를 받는 trace listener 들을 컬렉션값으로 갖는다. 보통 출력창을 Listener로 갖는데 상황에 따라 다른 Listener에 메시지를 출력해야 될 때가 있다.&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;&lt;b&gt;TextWriterTraceListener&lt;/b&gt;&amp;nbsp;라는 Listener는 메지시를 텍스트 파일에 출력한다. 생성자에서 출력할 파일을 지정하며, 파일이 존재하지 않을 경우 새로 생성한다. Listeners 프로퍼티에 TextWriterTraceListener 를 추가한 후, 응용프로그램 종료 전에 Close 메소드를 호출해줘야 한다.&lt;br /&gt;
&lt;br /&gt;아래 예는 Windows Form 응용프로그램에서의 사용 예이다.&lt;br /&gt;
메인 폼이 열리기 전에 TextWriterTraceListener 를 추가하고, 메인 폼이 종료된 후 Close 메소드를 호출해준다. Close 메소드 호출 시 모든 메시지가 지정한 파일에 기록된다.&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;&lt;div class=&quot;txc-textbox&quot; style=&quot;border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(231, 253, 181); border-right-color: rgb(231, 253, 181); border-bottom-color: rgb(231, 253, 181); border-left-color: rgb(231, 253, 181); background-color: rgb(231, 253, 181); padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; &quot;&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;Debug.Listeners.Add(new TextWriterTraceListener(@&quot;c:\temp\debug.log&quot;));&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;Application.Run(new MainForm());&lt;/p&gt;
&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;Debug.Close();&lt;/p&gt;
&lt;/p&gt;&lt;/div&gt;



&lt;br /&gt;
&lt;br /&gt;
@&lt;div class=&quot;entry-ccl&quot; style=&quot;clear: both; text-align: right; margin-bottom: 10px&quot;&gt;
	&lt;img id=&quot;ccl-icon-550-0&quot; class=&quot;entry-ccl-by&quot; src=&quot;http://i1.daumcdn.net/cfs.tistory/v/0/static/admin/editor/ccl_black01.png&quot; alt=&quot;저작자 표시&quot;/&gt;
	&lt;img id=&quot;ccl-icon-550-1&quot; class=&quot;entry-ccl-nc&quot; src=&quot;http://i1.daumcdn.net/cfs.tistory/v/0/static/admin/editor/ccl_black02.png&quot; alt=&quot;비영리&quot;/&gt;
	&lt;img id=&quot;ccl-icon-550-2&quot; class=&quot;entry-ccl-nd&quot; src=&quot;http://i1.daumcdn.net/cfs.tistory/v/0/static/admin/editor/ccl_black03.png&quot; alt=&quot;변경 금지&quot;/&gt;
	&lt;!--
	&lt;rdf:RDF xmlns=&quot;http://web.resource.org/cc/&quot; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot;&gt;
		&lt;Work rdf:about=&quot;&quot;&gt;
			&lt;license rdf:resource=&quot;http://creativecommons.org/licenses/by-nc-nd/2.0/kr/&quot; /&gt;
		&lt;/Work&gt;
		&lt;License rdf:about=&quot;http://creativecommons.org/licenses/by-nc-nd/&quot;&gt;
			&lt;permits rdf:resource=&quot;http://web.resource.org/cc/Reproduction&quot;/&gt;
			&lt;permits rdf:resource=&quot;http://web.resource.org/cc/Distribution&quot;/&gt;
			&lt;requires rdf:resource=&quot;http://web.resource.org/cc/Notice&quot;/&gt;
			&lt;requires rdf:resource=&quot;http://web.resource.org/cc/Attribution&quot;/&gt;
			&lt;prohibits rdf:resource=&quot;http://web.resource.org/cc/CommercialUse&quot;/&gt;
		&lt;/License&gt;
	&lt;/rdf:RDF&gt;
	--&gt;
&lt;/div&gt;
</description>
			<category>C#</category>
			<category>debugging</category>
			<author>six605</author>
			<guid>http://six605.tistory.com/550</guid>
			<comments>http://six605.tistory.com/550#entry550comment</comments>
			<pubDate>Wed, 21 Dec 2011 15:42:56 +0900</pubDate>
		</item>
	</channel>
</rss>

