Click here to Skip to main content
12,296,307 members (61,612 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: VB VB.NET
How to use linq in managementobjectcollection?

following is the code that I want to convert to linq.

For Each share As ManagementObject In searcher.Get()
            For Each PC As PropertyData In share.Properties
                If Not IsNothing(PC.Value) Then
                    If PC.Name = "ProcessorId" Then
                        MsgBox(PC.Name & "-" & PC.Value.ToString())
                    End If
                End If
            Next
        Next

How can i use linq to do the same thing quickly?
Thanx
Posted 18-Dec-12 22:19pm
Edited 18-Dec-12 23:04pm
ProgramFOX182.7K
v3

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

LINQ isn't going to speed anything up here and since the code works, what's the point in converting it to LINQ?? Don't tell me it's because "LINQ is the latest and greatest thing and it makes my code look cool."
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160525.2 | Last Updated 19 Dec 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100