阅读背景:

c#如何从对象中获取结果字符串

来源:互联网 

some c# code like:

一些c#代码如下:

Array arr=Array.CreateInstance(typeof(oject),3);
bool b=true;
int i =2;
float[] foo={1.1f,2.2f};
arr.setValue(b,0);
arr.setValue(i,0);
arr.setValue(foo,0);
string str=GetParamStringFromArrayObject(arr.GetValue(3));

string GetParamStringFromArrayObject(object obj)
{
if(obj.GetType().IsArray)
{
int demesion=obj.GetType().GetRank();//error,how to get the demesion(should be 2)
return obj.ToString();//error,i want to return the string delimeter by ' ' of   the float array,how to do?
}
}
Array arr=Arra



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: