47 Replies
i usualy added automatcly or if not i added like thath but now it doenst work
maybie its thath it was a feature of net framework?
@🌈 Thinker 🌈 i invoke you
no idea what System.Management is
its built in on net
but i dont now why i cant import it
its like the wmic of windows
Looking at the docs for most of the types in that namespace, none of them list versions past .NET Framework 4.8.1
So in all likelihood it's not part of .NET Core / modern versions of .NET.
😭
What are you aiming to do exactly? There's probably some other better library for it.
... what is this
why is there Convert.ToInt32 here
why
obj["parentprocessid"]
why no string interpolationJust use NuGet to get System.Management
System.Management 8.0.0-preview.2.23128.3
Provides access to a rich set of management information and management events about the system, devices, and applications instrumented to the Windows Management Instrumentation (WMI) infrastructure.
Commonly Used Types:
System.Management.ManagementClass
System.Management.ManagementObject
System.Management.SelectQuery
better now?
ummm
What does
obj[]
return
numbers
right, then you don't need the
(int)
i dont really now
but halp
Well, apparently it's not supported :/
WTF im on windows
ah yes,
object
I honestly have no idea, sorryanother thing that i prefere framework
it's fine to be wrong
You should never ever use Framework for new projects. The only reason Framework is required here is because this library System.Management is very likely very very old.
bruh its just esayer on framework
what is easier? it's just this specific library
yes it just querys on windows components
and a lot of things more
like what
one files
not exe on cpp and the dll with the actual data of proyect
wdym?
?
wdym??
just not sure what you meant by that
Unhandled exception. System.InvalidCastException: Unable to cast object of type 'System.UInt32' to type 'System.Int32'.
at SimpleBatchObfuscator.Program.GetParentProcessId() in C:\Users\Mrgaton\OneDrive\Programas\Programas Oscuros que cre en csharp\SimpleBatchObfuscator\SimpleBatchObfuscator\Program.cs:line 20
at SimpleBatchObfuscator.Program.Main(String[] args) in C:\Users\Mrgaton\OneDrive\Programas\Programas Oscuros que cre en csharp\SimpleBatchObfuscator\SimpleBatchObfuscator\Program.cs:line 34
uint
not int
GetProcessById accepts only int
but whats difference in int and uint
why do you even want the parent process?
yes
(also you just just do
(int)(uint)
)i want to know if started from the explorer
like if called from user or from automated application
int is signed (can be negative), uint is unsigned (cannot be negative)
why do you need to know this?
thanks
yes
that's not an answer
checking if called from explorer is not a good way to do that
a user can use a command line too, after all
"Programas Oscuros que cre en csharp".... are you creating something malicious?
its just my funny folders names
but believe what you want
if that folder is actually in a OneDrive folder that gets synced back and forth, there's almost bound to be problems
@Gato have u tried pinvoke libraries instead of WMI Queries? WMI is usually slow, I've used this one before:
it uses the standard PInvoke lib, not vanara's
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.