Find Some Information of Your Process.

Santosh4u
Posted by Santosh4u under Windows Forms category on | Views : 1770
Description:
Below Code Will Help you Find Some Information Of your Process.
Just Drag Two List Box as ListBox1 and ListBox2 and Write the Below Code.

VB.NET
   Private Sub frmGetProcessInfo_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 
MyBase.Load
GerProcessInfo()
End Sub
Private Sub GerProcessInfo()
Dim currentProcess As Process = Process.GetCurrentProcess()
For i As Integer = 0 To currentProcess.Modules.Count - 1
ListBox1.Items.Add(currentProcess.Modules.Item(i).ToString)
Next
ListBox2.Items.Add(currentProcess.ProcessName.ToString)
ListBox2.Items.Add(currentProcess.StartTime)
ListBox2.Items.Add(Process.GetCurrentProcess.TotalProcessorTime)
End Sub

C#.NET
private void button1_Click(object sender, EventArgs e)
{
GerProcessInfo();
}
private void GerProcessInfo()
{
Process currentProcess = Process.GetCurrentProcess();
for (int i = 0; i < currentProcess.Modules.Count; i++)
{
ListBox1.Items.Add(currentProcess.Modules[i].ToString());
}
ListBox2.Items.Add(currentProcess.ProcessName.ToString());
ListBox2.Items.Add(currentProcess.StartTime);
ListBox2.Items.Add(Process.GetCurrentProcess().TotalProcessorTime);
}

Regards
Santosh

Comments or Responses

Login to post response