Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6700255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:47:34+00:00 2026-05-26T06:47:34+00:00

i hope i did’t make any clone. I am studying book effective c# wrote

  • 0

i hope i did’t make any clone.
I am studying book effective c# wrote by Bill Wagner and stuck with using query syntax.

In my project i use something like that:

this.processList = new List<Process>();

            foreach (Process process in Process.GetProcesses(machine))
            {
                if (process.MainWindowTitle.Contains(patternTitle))
                {
                    this.processList.Add(process);
                }
            }

            if (processList.Count == 1)
            {
                this.handler = this.processList[0].MainWindowHandle;
            }

And i would like to use query syntax but i really don’t have any idea how to.
I tried this under, but it fails. I know it won’t work, but this is my proof that i tried.

(from n in Enumerable.Range(0,
Process.GetProcesses(machine)).Contains select
var).add(value));

Any help will be appreciate.

P.S. please correct my topic if it was not good specified. Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T06:47:34+00:00Added an answer on May 26, 2026 at 6:47 am

    If you’re trying to use LINQ be sure to include a “using System.LINQ;”

    The LINQ expression you probably want is something like this:

    var processList = from p in Process.GetProcesses(machine)
     where p.MainWindowTitle.Contains(patternTitle)
     select p;
    

    There’s lots of examples for LINQ around. I use http://en.wikipedia.org/wiki/Linq as a reference.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I did this before with javascript, and have no idea to make it using
Hope to get solution to this problem. I have been stuck on it since
Hope you are fine. I have to make a Web Project (very simple) I
Did a static version of site using FontSquirrel-generated CSS code. CSS stylesheet in css
I hope the title did not mislead you. My problem is the following: Currently
before posting the question i did my research for 10 days so really hope
I hope this qualifies as a programming question, as in any programming tutorial, you
I hope you can help me out with any advice, it'd be greatly appreciated.
I hope i did not skip this part in the ObjC manual but is
I hope someone can help me... Josh Smith did a great article on WPF

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.