Publier
Profil
Docs
FAQ
Connexion
|
Inscription
Linux
Serveurs
Hardware
Python
Ajax / Javascript
C++
PHP
Infographie
Framework .NET
Edition :Tuer un processus
Modifier l'intitulé' :
<p>Tuer un processus comme la commande killall sur Linux</p><p> <!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:PunctuationKerning/> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:Compatibility> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> <w:DontGrowAutofit/> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]--> <!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0cm; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} @page Section1 {size:612.0pt 792.0pt; margin:72.0pt 90.0pt 72.0pt 90.0pt; mso-header-margin:35.4pt; mso-footer-margin:35.4pt; mso-paper-source:0;} div.Section1 {page:Section1;} --> <!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Tableau Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--> </p><p class="MsoNormal"><span style="font-size: 8pt; font-family: 'Courier New'"><span style="color: blue">private</span> <span style="color: blue">static</span> <span style="color: blue">void</span> killall (<span style="color: #2b91af">String</span> task)</span></p> <p class="MsoNormal"><span style="font-size: 8pt; font-family: 'Courier New'">{</span></p> <p class="MsoNormal"><span style="font-size: 8pt; font-family: 'Courier New'"><span> </span><span style="color: #2b91af">ProcessStartInfo</span> pi = <span style="color: blue">new</span> <span style="color: #2b91af">ProcessStartInfo</span> (<span style="color: #a31515">"taskkill.exe"</span>);</span></p> <p class="MsoNormal"><span style="font-size: 8pt; font-family: 'Courier New'"><span> </span>pi.UseShellExecute = <span style="color: blue">false</span>;</span></p> <p class="MsoNormal"><span style="font-size: 8pt; font-family: 'Courier New'"><span> </span>pi.RedirectStandardOutput = <span style="color: blue">false</span>;</span></p> <p class="MsoNormal"><span style="font-size: 8pt; font-family: 'Courier New'"><span> </span>pi.Arguments = <span style="color: #a31515">"/f /im "</span> + task;</span></p> <p class="MsoNormal"><span style="font-size: 8pt; font-family: 'Courier New'"><span> </span><span style="color: #2b91af">Process</span> p = <span style="color: #2b91af">Process</span>.Start (pi);</span></p> <p class="MsoNormal"><span style="font-size: 8pt; font-family: 'Courier New'"><span> </span>p.WaitForExit ();</span></p> <p class="MsoNormal"><span style="font-size: 8pt; font-family: 'Courier New'">}</span></p><p class="MsoNormal"> </p><p class="MsoNormal"> </p>Cette fonction utilise la référence <!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:PunctuationKerning/> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:Compatibility> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> <w:DontGrowAutofit/> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]--> <!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0cm; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} @page Section1 {size:612.0pt 792.0pt; margin:72.0pt 90.0pt 72.0pt 90.0pt; mso-header-margin:35.4pt; mso-footer-margin:35.4pt; mso-paper-source:0;} div.Section1 {page:Section1;} --> <!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Tableau Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--><span style="font-size: 8pt; font-family: 'Courier New'"> System.Diagnostics</span> <p class="MsoNormal"> </p><p class="MsoNormal"> </p> <p> </p><p> </p>
-- Style --
-- Bloc de texte --
Paragraphe
Infos sur l'auteur
Texte préformaté
Titre de niveau 1
Titre de niveau 2
Titre de niveau 3
Titre de niveau 4
Titre de niveau 5
Titre de niveau 6
Type :
Solution
Ebauche d'article
Projet
Problème non résolu
Comparatif
Test