object pVal = new object();
int x = globalInfo.GobjSC.GetSiteList(ref pVal); //返回string数组,但参数必须是object
string[] xx = (string[])pVal;编译能通过,但是执行时提示指定转换无效。还有有时object得不到任何值也就不是数组形式,这时怎么判断.
int x = globalInfo.GobjSC.GetSiteList(ref pVal); //返回string数组,但参数必须是object
string[] xx = (string[])pVal;编译能通过,但是执行时提示指定转换无效。还有有时object得不到任何值也就不是数组形式,这时怎么判断.
int x = globalInfo.GobjSC.GetSiteList(ref pVal); //返回string数组,但参数必须是object
string[] xx = (string[])pVal;
我QQ:59335815
int x = globalInfo.GobjSC.GetSiteList(ref pVal);
System.Console.WriteLine(pVal.GetType());
if((pVal.GetType().ToString()) == "System.Object[]")
{
object[] obarr = (object[])pVal;
string str = (string)obarr[1];
System.Console.WriteLine(str);
}