Click here to Skip to main content
16,004,901 members
Home / Discussions / C#
   

C#

 
AnswerRe: Deploy Web Service Pin
Rob Philpott28-Sep-06 3:04
Rob Philpott28-Sep-06 3:04 
GeneralRe: Deploy Web Service Pin
chacimulch28-Sep-06 3:19
chacimulch28-Sep-06 3:19 
GeneralRe: Deploy Web Service Pin
Rob Philpott28-Sep-06 3:23
Rob Philpott28-Sep-06 3:23 
Questionexport to excell Pin
galatia27-Sep-06 8:41
galatia27-Sep-06 8:41 
AnswerRe: export to excell Pin
Jim Conigliaro27-Sep-06 9:49
Jim Conigliaro27-Sep-06 9:49 
QuestionDelete Nodes in XML with C# [modified] Pin
Raph127-Sep-06 8:40
Raph127-Sep-06 8:40 
QuestionClose all processes launched by program Pin
Vodstok27-Sep-06 8:22
Vodstok27-Sep-06 8:22 
AnswerRe: Close all processes launched by program Pin
Vodstok27-Sep-06 9:01
Vodstok27-Sep-06 9:01 
Okay, I dont know if this is "Best Practice" for this kind of thing, but I found somehting that works just dandy.

in the method that launches the process, I add the process id to an arraylist:

proc = new Process();<br />
proc.EnableRaisingEvents = true;<br />
proc.StartInfo.FileName = "Notepad.exe";<br />
<br />
proc.Start(); <br />
progList.Add(proc.Id);<br />


in the Form_Disposed method, i added the following:
for (int i = 0; i < progList.Count; i++)<br />
            {<br />
                Process[] p = Process.GetProcesses();<br />
<br />
                foreach (Process pp in p)<br />
                {<br />
                    if (pp.Id.ToString() == progList[i].ToString())<br />
                    {<br />
                        pp.Kill();<br />
                    }<br />
                }<br />
            }


Works like a charm.Smile | :)

______________________
Mr Griffin, eleventy billion is not a number...WTF | :WTF:

GeneralRe: Close all processes launched by program Pin
Dave Kreskowiak27-Sep-06 9:24
mveDave Kreskowiak27-Sep-06 9:24 
GeneralRe: Close all processes launched by program Pin
Vega0227-Sep-06 11:11
Vega0227-Sep-06 11:11 
QuestionStarting a Process without Windows "Run" Window Pin
Gareth H27-Sep-06 8:17
Gareth H27-Sep-06 8:17 
AnswerRe: Starting a Process without Windows "Run" Window Pin
Not Active27-Sep-06 8:36
mentorNot Active27-Sep-06 8:36 
GeneralRe: Starting a Process without Windows "Run" Window Pin
Gareth H27-Sep-06 8:43
Gareth H27-Sep-06 8:43 
GeneralRe: Starting a Process without Windows "Run" Window Pin
Not Active27-Sep-06 8:55
mentorNot Active27-Sep-06 8:55 
GeneralRe: Starting a Process without Windows &quot;Run&quot; Window Pin
Dave Kreskowiak27-Sep-06 9:13
mveDave Kreskowiak27-Sep-06 9:13 
GeneralRe: Starting a Process without Windows &quot;Run&quot; Window Pin
Gareth H27-Sep-06 23:03
Gareth H27-Sep-06 23:03 
GeneralRe: Starting a Process without Windows &quot;Run&quot; Window Pin
Dave Kreskowiak28-Sep-06 2:14
mveDave Kreskowiak28-Sep-06 2:14 
QuestionProgrammatically installing printer driver Pin
sharkbait27-Sep-06 7:47
sharkbait27-Sep-06 7:47 
AnswerRe: Programmatically installing printer driver Pin
Dave Kreskowiak27-Sep-06 10:14
mveDave Kreskowiak27-Sep-06 10:14 
Questionhow to print datagrid.rows in vs 2005 ? Pin
hdv21227-Sep-06 7:47
hdv21227-Sep-06 7:47 
AnswerRe: how to print datagrid.rows in vs 2005 ? Pin
Eric Dahlvang27-Sep-06 9:21
Eric Dahlvang27-Sep-06 9:21 
QuestionMarshal.Copy for ushort[]?! Pin
Daniel Strigl27-Sep-06 7:14
Daniel Strigl27-Sep-06 7:14 
QuestionHow to find available RAM Pin
srev27-Sep-06 6:52
srev27-Sep-06 6:52 
AnswerRe: How to find available RAM Pin
Niiiissssshhhhhuuuuu27-Sep-06 7:29
Niiiissssshhhhhuuuuu27-Sep-06 7:29 
AnswerRe: How to find available RAM Pin
samtam27-Sep-06 19:23
samtam27-Sep-06 19:23 

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.