public string[] tName = new string[]{"Whatever","Doesntmatter"};
string vBob = "Something";
string[] tVars = new string[]{"tName[0]","vBob","tName[1]"};
지금, TNAME [0]의 값을 변경하고자하지만 작업 나던에서 :C# GetType을() GetField 배열 위치
for(int i = 0; i < tVars.Lenght;++i)
{
this.GetType().GetField("tVars[0]").SetValue(this, ValuesThatComeFromSomewhereElse[i]));
}
내가 어떻게 할 수 있습니까?
편집 : 내가하려는 일을보다 정확하게 보여주기 위해 코드가 변경되었습니다.
/한숨 나는 분명히하기 위해 간단한 예를 만들었습니다. – Wildhorn