Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Process.GetProcessByName() Inject Error #1

Closed
Shitric opened this issue Aug 11, 2019 · 1 comment
Closed

Process.GetProcessByName() Inject Error #1

Shitric opened this issue Aug 11, 2019 · 1 comment

Comments

@Shitric
Copy link

Shitric commented Aug 11, 2019

Process[] p = Process.GetProcessesByName("notepad"); Injector injector = new Injector(p);

Process does not accept a process of type [].

@Sewer56
Copy link
Member

Sewer56 commented Aug 11, 2019

Accepting an array of processes as an argument wouldn't make logical sense, unless you would want to operate over all instances at the same time.

For the purpose of this library, writing a class which performs all operations on a set rather than individual item would probably be unnecessary rarely used boilerplate code making the library size larger.

Anyway, consider using a for/foreach loop to just make an Injector for every instance.

Alternatively you can do it with a LINQ one liner:

Injector[] injectors = Process.GetProcessesByName("notepad").Select(x => new Injector(x)).ToArray();

@Sewer56 Sewer56 closed this as completed Aug 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants