所以我正在制作一个dll注入器并且我得到了这个错误:变量' TargetProcess'隐藏一个封闭块中的变量。
代码:
Dim httpclient = New Net.WebClient
httpclient.Credentials = New Net.NetworkCredential("ftp_username", "ftp_password")
httpclient.DownloadFile("ftp:/you.gifrsite.com/Cheat.dll", Application.StartupPath & "\Cheat.dll")
IO.File.Move(Application.StartupPath & "\Cheat.dll", Cheat)
Dim TargetProcess As Process() = Process.GetProcessesByName("PROCESS NAME")
If TargetProcess.Length = 0 Then Me.TextBox1.Text = ("Waiting for GAME.exe")
答案 0 :(得分:1)
compiler error是有意义的,您在此范围内有两个具有相同名称的变量。重命名其中之一。由于Process.GetProcessesByName
会返回Process()
(可能是多个),我会将其命名为targetProcesses
(复数):
Dim targetProcesses As Process() = Process.GetProcessesByName("PROCESS NAME")