程式碼
private void ShowAllProcess() { Listdd = new List (); foreach (System.Diagnostics.Process procCur in System.Diagnostics.Process.GetProcesses()) { dd.Add(procCur.ProcessName); } //排序後將所以的處裡程序名稱印出 dd.Sort(delegate(string s1, string s2) { return s1.CompareTo(s2); }); dd.ForEach(delegate(string s1) { Console.WriteLine(s1); }); Console.WriteLine(dd.Count); }
沒有留言:
張貼留言