red_ghost
Member
I created a service and have it setup as a local service. When the service runs, I start a timer with a 5 second interval. What it does, is it goes through and makes sure a program is running, and if it isnt, it will start it. But this doesn't seem to be happening.
Here is the code for it:
Dim cnt As Integer = 0
Try
cnt = UBound(Process.GetProcessesByName("AlcanProcessor")) + 1
Catch ex As Exception
End Try
If cnt = 0 Then
Dim p As New Process
Dim pass As New System.Security.SecureString
Dim c As System.Char
For Each c In "Password"
pass.AppendChar(c)
Next
Process.Start("C:/Program Files/DDSi/AlcanProcSetup/AlcanProcessor.exe", "Admin", pass, "necsrv01")
End If
I have the same code setup to a button in another program that I was using to test it, and it works fine in there.
Here is the code for it:
Dim cnt As Integer = 0
Try
cnt = UBound(Process.GetProcessesByName("AlcanProcessor")) + 1
Catch ex As Exception
End Try
If cnt = 0 Then
Dim p As New Process
Dim pass As New System.Security.SecureString
Dim c As System.Char
For Each c In "Password"
pass.AppendChar(c)
Next
Process.Start("C:/Program Files/DDSi/AlcanProcSetup/AlcanProcessor.exe", "Admin", pass, "necsrv01")
End If
I have the same code setup to a button in another program that I was using to test it, and it works fine in there.