从进程列表中查找在指定的(存放在string数组中)进程: string processList = ConfigurationManager.AppSettings["CheckProcessList"]; string[] aryProcessList = processList.ToLower().Split(new char[] { ';', ','}); Process[] curProcesslist = Process.GetProcesses(); //Use LINQ to query the object var downProcess = from process in aryProcessList join processCur in curProcesslist on process equals processCur.ProcessName.ToLower()+".exe" into newProcessList from newprocess in newProcessList.DefaultIfEmpty() select new { ProcessName = process, ProcessInfo = newprocess == default(Process) ? null : newprocess }; LINQ to Entities 中查询有些区别: var books = from SofTextBook stb in psciEntities.SofTextBook from SofPublisher sp in psciEntities.SofPublisher from SofGrade sg in psciEntities.SofGrade where (sg.ID == stb.GradeID) && (sp.ID == stb.PublisherID) orderby stb.PublisherID, stb.GradeID select new { BookName = stb.Title, PublishName = sp.PublishName, GradeName = sg.GradeName, BookID = stb.ID }; var booksList = from book in books.AsEnumerable() select new { BookTitle = book.PublishName + '-' + book.GradeName + '-' + book.BookName, BookID = book.BookID }; 真省事: bool isExists = true; var c = (from content in BLLFactory.BookBll.GetContents(articleId) where content.ContentType == contentType select content).FirstOrDefault(); if(c == null) { c = new Content(); c.Id = Guid.NewGuid(); isExists = false; } 顺便记个数组中查找及组合元素的: pbReading.VoiceRecorder.Photo = lstImages.Find(delegate(string s) { return s.IndexOf(recorderName) > -1; }); string phIndex = selectedLables.Select(i => ((string[])i.Tag)[1]).Aggregate((a, b) => a + "," + b); ;