Question : VB.net monitor process CPU usage and defrag when below certain percentage

I want to be able to monitor a specific process and if the CPU usage is at a defined low point for a defined amount of time I want the pc to defrag it's drives automatically.

I have searched through google and found many variations, but none that I could actually get working. Ill post some of the things I started with.

Does anyone know how to do this?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
Dim myProcesses() As Process = Process.GetProcesses
Dim myProcess As Process
For Each myProcess In myProcesses
If (myProcess.ProcessName.ToLower = "buggyprocess") Then
myProcess.Kill()
End If
Next

'and also
PC.CategoryName = "Processor"
PC.CounterName = "% Processor Time"
PC.InstanceName = "_Total"
MessageBox.Show(PC.NextValue().ToString())

'and also
'-- Declare Private Member
    Private mPerformanceCounter As New System.Diagnostics.PerformanceCounter("Processor", "% Processor Time", "_Total")
 
    Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
        lvCPU.Items.Clear()
    End Sub
 
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        lvCPU.Items.Add(CInt(mPerformanceCounter.NextValue()) & "%")
        lvCPU.SelectedIndex = lvCPU.Items.Count - 1
    End Sub

Answer : VB.net monitor process CPU usage and defrag when below certain percentage

This appears to be a home or a non-server (serverless) network. Assuming that to be true, set one router to be the master router. It needs only be a wired router. Log into the router and determine the DHCP range (it is probably something like 192.168.1.100 - 192.168.1.200).

Log into the wireless router, turn off DHCP on the wireless router. Plug a wire from a LAN (internal network) port on the wireless router to a LAN (internal network) port on the wired (main) router.

Set the IP addressing on the wireless router (where you set up external network) to a fixed address on the wired router (192.168.1.10 in the example above).

Now any connection (wired or wireless) should get the same range of IP addresses (192.168.1.101, 102, 103 etc.) Once you have confirmed this part, you can begin networking the computers.

... Thinkpads_User
Random Solutions  
 
programming4us programming4us