我想這將是那麼容易,因爲: if(typeof(Array.push) == 'undefined'){
//not defined, prototype a version of the push method
// Firefox never gets here, but IE/Safari/Chrome/etc. do, even though
// the A
我無法寫這將是利用可變從一個配置文件一個的typeof語句的代碼是這樣的 Type t = new typeof ("My.other.class" + configValue[0]);
configValue是動態值我從app.config文件得到。 我得到的錯誤是「類型預期」,如果我直接輸入類,那就好了,所以我假設我的格式不正確。這應該怎麼寫?
我想在運行時得到一個類memeber變量列表。我知道這可能使用typeof和反射。但找不到示例。請有人爲我散光。 下面是僞代碼示例: Class Test01
{
public string str01;
public string str02;
public int myint01;
}
我想是這樣的(僞代碼): Test01 tt = new Test01();
foreach