Click here to Skip to main content
16,007,277 members
Home / Discussions / C#
   

C#

 
AnswerRe: parse some values in a .rtf file Pin
Luc Pattyn20-Jun-10 11:32
sitebuilderLuc Pattyn20-Jun-10 11:32 
QuestionClosing only the applications, not the windows processes Pin
teknolog12320-Jun-10 9:56
teknolog12320-Jun-10 9:56 
AnswerRe: Closing only the applications, not the windows processes Pin
Luc Pattyn20-Jun-10 10:03
sitebuilderLuc Pattyn20-Jun-10 10:03 
GeneralRe: Closing only the applications, not the windows processes Pin
teknolog12320-Jun-10 10:11
teknolog12320-Jun-10 10:11 
GeneralRe: Closing only the applications, not the windows processes Pin
Luc Pattyn20-Jun-10 10:17
sitebuilderLuc Pattyn20-Jun-10 10:17 
GeneralRe: Closing only the applications, not the windows processes Pin
teknolog12320-Jun-10 10:21
teknolog12320-Jun-10 10:21 
GeneralRe: Closing only the applications, not the windows processes Pin
Luc Pattyn20-Jun-10 10:29
sitebuilderLuc Pattyn20-Jun-10 10:29 
GeneralRe: Closing only the applications, not the windows processes Pin
teknolog12321-Jun-10 2:25
teknolog12321-Jun-10 2:25 
hi Luc, I didn't wanna post a new question as this is the same issue.Could you please see below code and say where I'm doing wrong? Briefly, I just want to get the processes that are run after my form loaded. Thanks.

public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        Process[] processesBefore;
        Process[] processesAfter;
        private void Form1_Load(object sender, EventArgs e)
        {
            processesBefore = Process.GetProcesses();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            processesAfter = Process.GetProcesses();
            CompareProcesses compare = new CompareProcesses();
            IEnumerable<Process> theDifference = processesAfter.Except(processesBefore, compare);
            foreach (Process p in theDifference)
            {
                listboxDifference.Items.Add(p.ProcessName);
            }
        }
    }

    public class CompareProcesses : IEqualityComparer<Process>
    {
        public bool Equals(Process x, Process y)
        {
            return (x == y);
        }

        public int GetHashCode(Process obj)
        {
            return obj.GetHashCode() ^ obj.GetHashCode();
        }
    }

AnswerRe: Closing only the applications, not the windows processes Pin
Luc Pattyn21-Jun-10 2:43
sitebuilderLuc Pattyn21-Jun-10 2:43 
GeneralRe: Closing only the applications, not the windows processes Pin
teknolog12321-Jun-10 3:08
teknolog12321-Jun-10 3:08 
GeneralRe: Closing only the applications, not the windows processes Pin
Luc Pattyn21-Jun-10 3:12
sitebuilderLuc Pattyn21-Jun-10 3:12 
GeneralRe: Closing only the applications, not the windows processes Pin
teknolog12321-Jun-10 23:47
teknolog12321-Jun-10 23:47 
GeneralRe: Closing only the applications, not the windows processes Pin
PIEBALDconsult20-Jun-10 17:06
mvePIEBALDconsult20-Jun-10 17:06 
QuestionHelp me please ... Pin
SRJ9220-Jun-10 7:30
SRJ9220-Jun-10 7:30 
AnswerRe: Help me please ... Pin
Xmen Real 20-Jun-10 8:11
professional Xmen Real 20-Jun-10 8:11 
AnswerRe: Help me please ... Pin
dan!sh 20-Jun-10 9:18
professional dan!sh 20-Jun-10 9:18 
GeneralRe: Help me please ... Pin
SRJ9220-Jun-10 11:03
SRJ9220-Jun-10 11:03 
AnswerRe: Help me please ... Pin
DaveyM6920-Jun-10 10:00
professionalDaveyM6920-Jun-10 10:00 
QuestionSingleton Pattern Alternative Pin
Brendan Vogt20-Jun-10 4:33
Brendan Vogt20-Jun-10 4:33 
AnswerRe: Singleton Pattern Alternative Pin
Not Active20-Jun-10 4:50
mentorNot Active20-Jun-10 4:50 
GeneralRe: Singleton Pattern Alternative Pin
Brendan Vogt20-Jun-10 5:10
Brendan Vogt20-Jun-10 5:10 
GeneralRe: Singleton Pattern Alternative Pin
Not Active20-Jun-10 9:25
mentorNot Active20-Jun-10 9:25 
AnswerRe: Singleton Pattern Alternative Pin
PIEBALDconsult20-Jun-10 7:12
mvePIEBALDconsult20-Jun-10 7:12 
GeneralRe: Singleton Pattern Alternative Pin
J4amieC20-Jun-10 22:08
J4amieC20-Jun-10 22:08 
GeneralRe: Singleton Pattern Alternative Pin
PIEBALDconsult21-Jun-10 2:47
mvePIEBALDconsult21-Jun-10 2:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.