CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2010
    Posts
    23

    array, object properties

    Code:
    'array
    Dim adapters As NetworkInterface() = NetworkInterface.GetAllNetworkInterfaces 
    'Need to output names 'adapter.Name' to another array for faster access.
    
     'Iteration, slower
      For Each arss As NetworkInterface In adapters
                MessageBox.Show(arss.Name)
            Next
    I would like to put all the network interface names into an array without using iteration (For Each, For i).

    Is there a way to get the properties ie. 'Name' of an array object and be able to array.getvalue() their names?
    Last edited by StriderH2; October 25th, 2011 at 08:07 PM.

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: array, object properties

    Why? Unless you have dozens of adapters, just loop thru, and match the name or whatever. For...Each is quite fast
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Oct 2010
    Posts
    23

    Re: array, object properties

    Never mind I'll try another method.
    Last edited by StriderH2; October 25th, 2011 at 09:40 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured