Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

C# Processe

Empfohlene Antworten

Veröffentlicht

Hallo alle zusammen!

Mein Problem besteht darin:

Ich soll die System Prozesse auslesen! Aber weis nicht wie ich die maximale Anzahl der momentan aktiven Prozesse feststellen kann!

Da es hierfür keine get-Methode gibt! (hab zumindest keine gefunden)

Hat jemand einen Tipp für mich wie ich das machen kann?!

Vergleich mit null etc. ist nicht möglich! Dabei beendet sich das Programm ständig!

Bitte um Hilfe.. Danke schon mal!

MfG CTom

aber google kennst du schon?!

Schau dir mal Process.GetProcesses an...

Ich möchte nicht die Prozesse einzeln rausholen mit Process.GetProcesses, sonder Zählen wie viele Prozesse es SIND!!


using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

using System.Diagnostics;


namespace LogFileAuswerten

{

    public partial class Form1 : Form

    {


        public Form1()

        {

            InitializeComponent();

            Auswertung.AcceptsTab = true;

            Auswertung.ScrollBars = ScrollBars.Vertical;


         //   Auswertung.AppendText(Program.Lesen());


            for (int i = 0; i < [COLOR="red"]30[/COLOR]; i++)

            {

                Auswertung.AppendText(String.Format("{"+i+"}\r\n", Process.GetProcesses()));

            }

        }


        private void button1_Click(object sender, EventArgs e)

        {

            Application.Exit();

        }

    }

Für das 30 möchte ich gerne die Anzahl der Aktiven Prozesse haben!

Wenn ich einen zu hohen wert eingebe dann bricht das Programm ab mit einer Fehlermeldung!


Process.GetProcesses().Length

//b.z.w.

Process.GetProcesses().Length.ToString()

Bedarf es einer Erklärung?

Mit freundlichen Grüßen,

Cadpax

Toll danke!

Auf das einfachste bin ich nicht gekommen! :(

Aber danke!

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.