|
Este artigo foi traduzido por máquina. Coloque o ponteiro do mouse sobre as frases do artigo para ver o texto original. Mais informações.
|
Tradução
Original
|
Classe Process
Namespace: System.Diagnostics
Assembly: System (em 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
O tipo Process expõe os membros a seguir.
| Nome | Descrição | |
|---|---|---|
![]() | BasePriority | |
![]() | CanRaiseEvents | |
![]() | Container | |
![]() | DesignMode | |
![]() | EnableRaisingEvents | |
![]() | Events | |
![]() | ExitCode | |
![]() | ExitTime | |
![]() | Handle | |
![]() | HandleCount | |
![]() | HasExited | |
![]() | Id | |
![]() | MachineName | |
![]() | MainModule | |
![]() | MainWindowHandle | |
![]() | MainWindowTitle | |
![]() | MaxWorkingSet | |
![]() | MinWorkingSet | |
![]() | Modules | |
![]() | NonpagedSystemMemorySize | Obsoleta. |
![]() | NonpagedSystemMemorySize64 | |
![]() | PagedMemorySize | Obsoleta. |
![]() | PagedMemorySize64 | |
![]() | PagedSystemMemorySize | Obsoleta. |
![]() | PagedSystemMemorySize64 | |
![]() | PeakPagedMemorySize | Obsoleta. |
![]() | PeakPagedMemorySize64 | |
![]() | PeakVirtualMemorySize | Obsoleta. |
![]() | PeakVirtualMemorySize64 | |
![]() | PeakWorkingSet | Obsoleta. |
![]() | PeakWorkingSet64 | |
![]() | PriorityBoostEnabled | |
![]() | PriorityClass | |
![]() | PrivateMemorySize | Obsoleta. |
![]() | PrivateMemorySize64 | |
![]() | PrivilegedProcessorTime | |
![]() | ProcessName | |
![]() | ProcessorAffinity | |
![]() | Responding | |
![]() | SessionId | |
![]() | Site | |
![]() | StandardError | |
![]() | StandardInput | |
![]() | StandardOutput | |
![]() | StartInfo | |
![]() | StartTime | |
![]() | SynchronizingObject | |
![]() | Threads | |
![]() | TotalProcessorTime | |
![]() | UserProcessorTime | |
![]() | VirtualMemorySize | Obsoleta. |
![]() | VirtualMemorySize64 | |
![]() | WorkingSet | Obsoleta. |
![]() | WorkingSet64 |
| Nome | Descrição | |
|---|---|---|
![]() | BeginErrorReadLine | |
![]() | BeginOutputReadLine | |
![]() | CancelErrorRead | |
![]() | CancelOutputRead | |
![]() | Close | |
![]() | CloseMainWindow | |
![]() | CreateObjRef | |
![]() | Dispose() | |
![]() | Dispose(Boolean) | Infraestrutura. |
![]() ![]() | 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) |
| Nome | Descrição | |
|---|---|---|
![]() | Disposed | |
![]() | ErrorDataReceived | |
![]() | Exited | |
![]() | OutputDataReceived |
Observação |
|---|
Observação |
|---|
Observação |
|---|
Observação |
|---|
O atributo HostProtectionAttribute aplicado a este tipo ou membro tem o seguinte valor da propriedade Resources: SharedState | Synchronization | ExternalProcessMgmt | SelfAffectingProcessMgmt. HostProtectionAttribute não afeta aplicativos de área de trabalho (que são normalmente iniciados com o clique duplo em um ícone, a digitação de um comando ou a inserção de uma URL em um navegador). Para obter mais informações, consulte a classe HostProtectionAttribute ou Atributos de proteção de Host e programação de SQL Server. |
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
para confiança total para o chamador imediato. Esta classe não pode ser usada pelo código parcialmente confiável. - InheritanceDemand
para confiança total para herdeiros. Esta classe não pode ser herdada pelo código parcialmente confiável.
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Função Server Core sem suporte), Windows Server 2008 R2 (Função Server Core com suporte com o SP1 ou posterior, Itanium sem suporte)
O .NET Framework não oferece suporte a todas as versões de cada plataforma. Para obter uma lista das versões com suporte, consulte .Requisitos de sistema do NET Framework.
