Click here to Skip to main content
15,886,137 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a problem with accessing the process
This is the code
VB
Dim p As Process = Process.GetProcessesByName("Wolfteam.bin")(0)
        For Each moz As System.Diagnostics.ProcessModule In p.Modules
            If moz.FileName.IndexOf("obj") <> -1 Then
                Label1.Text = moz.BaseAddress.ToString
            End If
        Next


What I have tried:

I have tried to give the application administrator privilege but gave the same error.
Posted
Updated 28-Jul-19 5:37am
v2

1 solution

See Process.GetProcessesByName Method (System.Diagnostics) | Microsoft Docs[^] for details on how the name should be specified. You can also check it by looking in Task Manager.
 
Share this answer
 
Comments
Abduu Atef 28-Jul-19 8:05am    
The process name is correct, I checked it in the task manager and was the same.
Richard MacCutchan 28-Jul-19 13:09pm    
When I try "explorer.exe" I get an error, but using just "explorer" it works. Try just the name "wolfteam" without the ".bin" extension.
Abduu Atef 28-Jul-19 13:38pm    
I tried this but it gives an error says that [the index was outside the bounds of the array] that means that the process name is incorrect
Richard MacCutchan 28-Jul-19 14:08pm    
I have tried with a number of different process names which work fine. Remove the subscript index on line one, and set p as an array. You can then check p.Count to see how many process entries are returned.

I have no idea what "wolfteam.bin" is but you should be able to see how many processes it contains in Task Manager.
Abduu Atef 29-Jul-19 8:47am    
The Length is one when the process name is "Wolfteam.bin"
and is zero when the process name is "Wolfteam"
It may be a special case, wolfteam is a game by the way
The problem is accessing the process and its models to modify the memory is denied.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900