public class MyClass
{
public string _datafile;
public MyClass()
{
_datafile = "Hello";
}
public void PrintField()
{
var result = this.GetType().GetField("_datafile").GetValue(this);
Console.WriteLine(result); // will print Hello
}
}
'프로그래밍' 카테고리의 다른 글
C# XML 읽어오기 (0) | 2020.12.01 |
---|---|
C# DateTime 포맷 (0) | 2020.09.02 |
유니티 Microphone 녹음 시작-종료 지점 잘라서 녹음. (2) | 2020.08.28 |
C# 문자열을 int 리스트 / int 배열로 변환하기 (0) | 2020.02.28 |
유니티 UI 클릭했을 때, 클릭된 위치 값 가져오기 (0) | 2019.11.07 |