生活,终究会美好一些!
hello word!

逸风铭

不做恶,就是行善。



不要冷漠的走入普通人,每个人都在追求自己的幸福。痛苦的人,总是携带傲慢与偏见;幸福的人,总是多一分宽容与慈悲;
不必盼望世界先理解你,你可以尝试先理解世界。

C#数组定义与操作

数组定义:

public static string[][] data;
public static string[] retRefdetail;
public static object[] newretRefdetail;
public static string[][][] array = null;
public static object[][] outData=new object[2000][];

 

数组操作:

array = new string[ieds.Count][][];
arrayB = new string[ieds.Count][][];

 

for (int a = 0; a < array.Length; a++)
{
if (array[a] != null)
{
for (int b = 0; b < array[a].Length; b++)
{
if (array[a][b] != null)//三维数组不为空
{

for (int t = 0; t < array[a][b].Length; t++)
{
try
{

if (array[a][b][0] == block.APPID )
{
if (array[a][b][1] == fullpath)

{


newretRefdetail[0] = array[a][b][0];


for (int i = 0; i < this.dgvDataSet.RowCount; i++)
{
if (block.DataSets[i].RefPath == array[a][b][t].ToString())

{

newretRefdetail[i + 1] = array[a][b][t].ToString();

if (outData != null)
{
if ( outData[outdataUp] !=null) {

#region bef code
for (int j = 0; j < outData[outdataUp].Length; j++)
{

if (outData[j]!=null) {
if (outData[j][0].ToString() == block.APPID)
{

outData[j] = newretRefdetail;//相同条目记录一次
gflag = true;
break;
}

}

}
if (!gflag)
{
outdataUp++;
if (outData[outdataUp] == null)
{
outData[outdataUp] = newretRefdetail;
}

}

#endregion
}
else { outData[outdataUp] = newretRefdetail; }
}

}

}
}
}
}

catch (Exception ex)
{
string aa = ex.ToString();
}
}
}
}
}

}

posted @ 2020-06-11 09:32  NY217  阅读(471)  评论(0)    收藏  举报