公司用的一个类库是VB的,调用的时候有这样一些语句:
...
sub new
  Me.QueryProcedure = 'aaaaaQuery'
  Redim Me.QueryParam(2)
  Me.createParam(Me.QueryParam(0), DbType.String)
  ...
end sub
...类似这样的代码用C#该怎么写呀~望各位大哥大姐指教。

解决方案 »

  1.   

    C#中没有Redim,所以要用几条语句来写VB.NET:
    Redim QueryParam(2)C#:
    //比如类型为int
    int[] temp = new int[2];
    Array.Copy(QueryParam, temp, QueryParam.Length);
    QueryParam = temp;
      

  2.   

    是这样啊,那VB转换成中间代码的时候也是这么弄的吧。还有,如果QueryParam本来就是空数组的话,直接用int[] QueryParam = new int[2];不知道可以不?
      

  3.   

    int[] QueryParam = new int[2];变量不能重复定义,删掉int[]
      

  4.   

    多谢各位,后面的数字要+1:
    this.QueryParam = new int[3];~.~