View Single Post
  #2 (permalink)  
Old 06-18-2007, 10:09 AM
hoser2001's Avatar   
hoser2001 hoser2001 is offline
Programmer
 
Join Date: Jul 2006
Posts: 175
Rep Power: 10
hoser2001 is on a distinguished road
Default

Ok guys, I found some help online and have this application, however I can't seem to get it to work right. I'm running into this problem calling argv[] in a function. The complier is throwing a "Index was outside the bounds of the array" message. Here is some code
Code:
public static void Main(string[] argv)
    {
        int commlength, miblength, datastart, datalength;
        string nextmib, value;
        SNMP conn = new SNMP();
        string mib = "1.3.6.1.2.1.17.4.3.1.1";
        int orgmiblength = mib.Length;
        byte[] response = new byte[1024];
        System.Console.WriteLine(argv[1]);
        nextmib = mib;
        while (true)
        {
            response = conn.get("getnext", argv[0], argv[1], nextmib);
The last line of code there is where I get the error.

Any ideas????
Reply With Quote