Click here to Skip to main content
12,884,480 members (32,647 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

How can i use linq to do the same thing quickly?
Posted 18-Dec-12 22:19pm
Updated 18-Dec-12 23:04pm

1 solution

Rate this: bad
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."

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.170422.1 | Last Updated 19 Dec 2012
Copyright © CodeProject, 1999-2017
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