Jump to content

Need Help with .NET code for scanning network

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1
hoser2001

hoser2001

    Programmer

  • Members
  • PipPipPipPip
  • 173 posts
I'm using VisualStudio 2005 and I want to create an application that simply scans my LAN for all available MAC addresses.

I believe I need to somehow implement SNMP. But am having problems finding understandable references online. I am wondering if anyone here has had to develop anything similiar to this.

#2
hoser2001

hoser2001

    Programmer

  • Members
  • PipPipPipPip
  • 173 posts
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

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????

#3
hoser2001

hoser2001

    Programmer

  • Members
  • PipPipPipPip
  • 173 posts
nevermind the last post, it was a stupid error on my part.

I abandoned the sample application I was testing and am moving on to find a new solution to my problem. Again, if anyone has any suggestions please feel free to post a comment

#4
hoser2001

hoser2001

    Programmer

  • Members
  • PipPipPipPip
  • 173 posts
please disregard this topic, i found solution to my problem.

#5
Crane

Crane

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 398 posts
What was the answer?