반응형
c# 변수 Type 구하기 - GetType()
환경 : windows 7 64bit, visual studio 2013 community
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace typetest | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
int a = 33; | |
string bb = "abc"; | |
var cc = "test"; | |
Console.WriteLine(a.GetType()); | |
Console.WriteLine(bb.GetType()); | |
Console.WriteLine(cc.GetType()); | |
Console.WriteLine(a.GetType().Name); | |
Console.WriteLine(bb.GetType().Name); | |
Console.WriteLine(cc.GetType().Name); | |
} | |
} | |
} |
반응형
'C#' 카테고리의 다른 글
C# -- Debug, Trace 사용하여 출력하기 (0) | 2015.08.12 |
---|---|
c# -- winform, console 동시 사용하기 (0) | 2015.08.12 |
c# - 시스템 상태 확인 ; cpu, ram (0) | 2015.06.20 |
c# -- multi-thread winform 만들기 (0) | 2015.06.18 |
c# -- thread id 구하기 (0) | 2015.06.18 |