Process-Klasse
Namespace: System.Diagnostics
Assembly: System (in System.dll)
[HostProtectionAttribute(SecurityAction.LinkDemand, SharedState = true, Synchronization = true, ExternalProcessMgmt = true, SelfAffectingProcessMgmt = true)] [PermissionSetAttribute(SecurityAction.LinkDemand, Name = "FullTrust")] [PermissionSetAttribute(SecurityAction.InheritanceDemand, Name = "FullTrust")] public class Process : Component
Der Process-Typ macht die folgenden Member verfügbar.
| Name | Beschreibung | |
|---|---|---|
![]() | BasePriority | |
![]() | CanRaiseEvents | |
![]() | Container | |
![]() | DesignMode | |
![]() | EnableRaisingEvents | |
![]() | Events | |
![]() | ExitCode | |
![]() | ExitTime | |
![]() | Handle | |
![]() | HandleCount | |
![]() | HasExited | |
![]() | Id | |
![]() | MachineName | |
![]() | MainModule | |
![]() | MainWindowHandle | |
![]() | MainWindowTitle | |
![]() | MaxWorkingSet | |
![]() | MinWorkingSet | |
![]() | Modules | |
![]() | NonpagedSystemMemorySize | Veraltet. |
![]() | NonpagedSystemMemorySize64 | |
![]() | PagedMemorySize | Veraltet. |
![]() | PagedMemorySize64 | |
![]() | PagedSystemMemorySize | Veraltet. |
![]() | PagedSystemMemorySize64 | |
![]() | PeakPagedMemorySize | Veraltet. |
![]() | PeakPagedMemorySize64 | |
![]() | PeakVirtualMemorySize | Veraltet. |
![]() | PeakVirtualMemorySize64 | |
![]() | PeakWorkingSet | Veraltet. |
![]() | PeakWorkingSet64 | |
![]() | PriorityBoostEnabled | |
![]() | PriorityClass | |
![]() | PrivateMemorySize | Veraltet. |
![]() | PrivateMemorySize64 | |
![]() | PrivilegedProcessorTime | |
![]() | ProcessName | |
![]() | ProcessorAffinity | |
![]() | Responding | |
![]() | SessionId | |
![]() | Site | |
![]() | StandardError | |
![]() | StandardInput | |
![]() | StandardOutput | |
![]() | StartInfo | |
![]() | StartTime | |
![]() | SynchronizingObject | |
![]() | Threads | |
![]() | TotalProcessorTime | |
![]() | UserProcessorTime | |
![]() | VirtualMemorySize | Veraltet. |
![]() | VirtualMemorySize64 | |
![]() | WorkingSet | Veraltet. |
![]() | WorkingSet64 |
| Name | Beschreibung | |
|---|---|---|
![]() | BeginErrorReadLine | |
![]() | BeginOutputReadLine | |
![]() | CancelErrorRead | |
![]() | CancelOutputRead | |
![]() | Close | |
![]() | CloseMainWindow | |
![]() | CreateObjRef | |
![]() | Dispose() | |
![]() | Dispose(Boolean) | Infrastruktur. |
![]() ![]() | EnterDebugMode | |
![]() | Equals(Object) | |
![]() | Finalize | |
![]() ![]() | GetCurrentProcess | |
![]() | GetHashCode | |
![]() | GetLifetimeService | |
![]() ![]() | GetProcessById(Int32) | |
![]() ![]() | GetProcessById(Int32, String) | |
![]() ![]() | GetProcesses() | |
![]() ![]() | GetProcesses(String) | |
![]() ![]() | GetProcessesByName(String) | |
![]() ![]() | GetProcessesByName(String, String) | |
![]() | GetService | |
![]() | GetType | |
![]() | InitializeLifetimeService | |
![]() | Kill | |
![]() ![]() | LeaveDebugMode | |
![]() | MemberwiseClone() | |
![]() | MemberwiseClone(Boolean) | |
![]() | OnExited | |
![]() | Refresh | |
![]() | Start() | |
![]() ![]() | Start(ProcessStartInfo) | |
![]() ![]() | Start(String) | |
![]() ![]() | Start(String, String) | |
![]() ![]() | Start(String, String, SecureString, String) | |
![]() ![]() | Start(String, String, String, SecureString, String) | |
![]() | ToString | |
![]() | WaitForExit() | |
![]() | WaitForExit(Int32) | |
![]() | WaitForInputIdle() | |
![]() | WaitForInputIdle(Int32) |
| Name | Beschreibung | |
|---|---|---|
![]() | Disposed | |
![]() | ErrorDataReceived | |
![]() | Exited | |
![]() | OutputDataReceived |
Hinweis |
|---|
Hinweis |
|---|
Hinweis |
|---|
Hinweis |
|---|
Das auf diesen Typ oder Member angewendete HostProtectionAttribute-Attribut besitzt den folgenden Resources-Eigenschaftswert: SharedState | Synchronization | ExternalProcessMgmt | SelfAffectingProcessMgmt. Das HostProtectionAttribute hat keine Auswirkungen auf Desktopanwendungen (die normalerweise durch Doppelklicken auf ein Symbol, Eingeben eines Befehls oder einer URL in einem Browser gestartet werden). Weitere Informationen finden Sie unter der HostProtectionAttribute-Klasse oder unter SQL Server-Programmierung und Hostschutzattribute. |
using System; using System.Diagnostics; using System.ComponentModel; namespace MyProcessSample { class MyProcess { public static void Main() { Process myProcess = new Process(); try { myProcess.StartInfo.UseShellExecute = false; // You can start any process, HelloWorld is a do-nothing example. myProcess.StartInfo.FileName = "C:\\HelloWorld.exe"; myProcess.StartInfo.CreateNoWindow = true; myProcess.Start(); // This code assumes the process you are starting will terminate itself. // Given that is is started without a window so you cannot terminate it // on the desktop, it must terminate itself or you can do it programmatically // from this application using the Kill method. } catch (Exception e) { Console.WriteLine(e.Message); } } } }
using System; using System.Diagnostics; using System.ComponentModel; namespace MyProcessSample { class MyProcess { // Opens the Internet Explorer application. void OpenApplication(string myFavoritesPath) { // Start Internet Explorer. Defaults to the home page. Process.Start("IExplore.exe"); // Display the contents of the favorites folder in the browser. Process.Start(myFavoritesPath); } // Opens urls and .html documents using Internet Explorer. void OpenWithArguments() { // url's are not considered documents. They can only be opened // by passing them as arguments. Process.Start("IExplore.exe", "www.northwindtraders.com"); // Start a Web page using a browser associated with .html and .asp files. Process.Start("IExplore.exe", "C:\\myPath\\myFile.htm"); Process.Start("IExplore.exe", "C:\\myPath\\myFile.asp"); } // Uses the ProcessStartInfo class to start new processes, // both in a minimized mode. void OpenWithStartInfo() { ProcessStartInfo startInfo = new ProcessStartInfo("IExplore.exe"); startInfo.WindowStyle = ProcessWindowStyle.Minimized; Process.Start(startInfo); startInfo.Arguments = "www.northwindtraders.com"; Process.Start(startInfo); } static void Main() { // Get the path that stores favorite links. string myFavoritesPath = Environment.GetFolderPath(Environment.SpecialFolder.Favorites); MyProcess myProcess = new MyProcess(); myProcess.OpenApplication(myFavoritesPath); myProcess.OpenWithArguments(); myProcess.OpenWithStartInfo(); } } }
- LinkDemand
für volle Vertrauenswürdigkeit für den unmittelbaren Aufrufer. Diese Klasse kann von teilweise vertrauenswürdigem Code nicht verwendet werden. - InheritanceDemand
für volle Vertrauenswürdigkeit für Erben. Diese Klasse kann nicht von teilweise vertrauenswürdigem Code geerbt werden.
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core-Rolle wird nicht unterstützt), Windows Server 2008 R2 (Server Core-Rolle wird mit SP1 oder höher unterstützt; Itanium wird nicht unterstützt)
.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen für .NET Framework.






Hinweis