ForumKalbi.Com

ForumKalbi.Com (https://www.forumkalbi.com/index.php)
-   Bilgisayar (https://www.forumkalbi.com/forumdisplay.php?f=220)
-   -   C# Görev Yöneticisi (https://www.forumkalbi.com/showthread.php?t=4651)

Candres 27 Ocak 2024 18:57

C# Görev Yöneticisi
 
C# Görev Yöneticisi
Çalışan programları listeleyen ve sonlandıran bir "Process Manager"


Kod:

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using Microsoft.Win32;
using System.IO;
using System.Diagnostics;
using System.Resources;

namespace Process_Manager
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
Process myProcess = new Process();
//Declare process
txtMachine.Text = System.Environment.MachineName.ToString();
//set the machine name to textbox
}

private void FillList(string MachineName)
{
Process[] Prc;
ListViewItem lvwP;

Cursor.Current = Cursors.WaitCursor;
//Set cusrsor as wait

try
{
lvwProcesses.Items.Clear();
Prc = Process.GetProcesses(MachineName.ToString());

foreach (Process Prcs in Prc)
{
lvwP = lvwProcesses.Items.Add(Prcs.ProcessName.ToUpper()) ;
if (MachineName != System.Environment.MachineName)
{
lvwP.SubItems.Add("Unavailable...");
lvwP.SubItems.Add("Unavailable...");
lvwP.SubItems.Add(Prcs.Id.ToString());
}
else
{
lvwP.SubItems.Add(Prcs.MainWindowTitle);
lvwP.SubItems.Add(Prcs.Responding.ToString());
lvwP.SubItems.Add(Prcs.Id.ToString());
}
}
}
catch
{
lvwProcesses.Items.Add("Error enumerating items...");
}

Cursor.Current = Cursors.Default;
}

private void Form1_Load(object sender, EventArgs e)
{
FillList(txtMachine.Text);
}

private void cmdRefresh_Click(object sender, EventArgs e)
{
FillList(txtMachine.Text);
}
}
}


Forum saati; Türkiye'ye göre ayarlanmış olup, şu an saat: 02:28.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Navbar with Avatar by Motorradforum