Multiple objects initialization with parameters.

Hello!

I want to use a loop for the code below, that creates an array of objects S instead of the objects s0, s1, ...s9.

public static SNMPObject s0 = new SNMPObject("1.3.6.1.4.1.1331.11.5.1.0");
public static SNMPObject s1 = new SNMPObject("1.3.6.1.4.1.1331.11.5.1.1");
public static SNMPObject s2 = new SNMPObject("1.3.6.1.4.1.1331.11.5.1.2");
public static SNMPObject s3 = new SNMPObject("1.3.6.1.4.1.1331.11.5.1.3");
public static SNMPObject s4 = new SNMPObject("1.3.6.1.4.1.1331.11.5.1.4");
public static SNMPObject s5 = new SNMPObject("1.3.6.1.4.1.1331.11.5.1.5");
public static SNMPObject s6 = new SNMPObject("1.3.6.1.4.1.1331.11.5.1.6");
public static SNMPObject s7 = new SNMPObject("1.3.6.1.4.1.1331.11.5.1.7");
public static SNMPObject s8 = new SNMPObject("1.3.6.1.4.1.1331.11.5.1.8");
public static SNMPObject s9 = new SNMPObject("1.3.6.1.4.1.1331.11.5.1.9");

Thank you so much!

[1715 byte] By [dellover] at [2008-1-9]
# 1
public static SNMPObject[] oids = new SNMPObject[100];

for (i=0; i<100;i++)
{
oidsIdea=new SNMPObject("1.3.6.1.4.1.1331.11.5.1.0");
Console.WriteLine("f");
}

Ok I think I have solved it. Only the param needs to be changed, which is easy now.

dellover at 2007-10-2 > top of Msdn Tech,Visual C#,Visual C# General...