两个代码片断
for (int i = 0; i < parInfos.Length; i++)
{
//objPars[i] = assembly.CreateInstance(parInfos[i].ParameterType.FullName); //#1
if (parInfos[i].ParameterType.FullName == "System.String")
{
objPars[i] = "Lee";
}
}
for (int i = 0; i < parInfos.Length; i++)
{
//objPars[i] = assembly.CreateInstance(parInfos[i].ParameterType.FullName); //#2
if (parInfos[i].ParameterType.FullName == "System.String")
{
objPars[i] = "Lee XiaoMing";
}
if (parInfos[i].ParameterType.FullName == "System.Int32")
{
objPars[i] = 22;
}
}
我发现#1 和#2 这两句要不要程序都正常,请问这2句是什么意思?有什么作用呢 |