VB中C语言的"等于"等效

Log*_*man 3 c# arrays vb6 vb6-migration

我知道在循环的上下文Toi = long1 To long2,VB中的等价(i = long1; i < long2; ++i)于C#,但我试图在上下文中找到它的等价物ReDim/System.Array.Resize():

VB6:

ReDim indexCorr(LBound(fDefMatchs) to UBound(fDefMatchs)

C#:

System.Array.Resize(indexCorr, ***?)

有没有其他人知道如何使用一系列这样的数字在C#中调整数组大小?

p.s*_*w.g 6

我想你要找的是这个:

System.Array.Resize(ref indexCorr, fDefMatchs.Length);
Run Code Online (Sandbox Code Playgroud)

但是,在.NET中,您无法设置数组的下限.从文档:

数组为零索引:具有n个元素的数组从0到n-1索引.