Beispiel #1
0
    public bool SetStatic(string ip, string netmask)
    {
        int retVal = WMIMethod.ExecuteMethod(this, new { IPAddress = new string[] { ip }, SubnetMask = new string[] { netmask } });

        if (retVal != 0)
        {
            Console.WriteLine($"Failed to set network settings with error code {retVal}");
        }
        return(retVal == 0);
    }
Beispiel #2
0
        public ProcessResult Create(string commandLine, string currentDirectory, string processStartupInformation)
        {
            ProcessResult res = WMIMethod.ExecuteStaticMethod <ProcessResult>(new { CommandLine = commandLine, CurrentDirectory = currentDirectory, ProcessStartupInformation = processStartupInformation });

            return(res);
        }
Beispiel #3
0
 public int AttachDebugger()
 {
     return(WMIMethod.ExecuteMethod <int>(this));
 }
Beispiel #4
0
 public ProcessOwner GetOwner()
 {
     return(WMIMethod.ExecuteMethod <ProcessOwner>(this));
 }
Beispiel #5
0
 public dynamic GetOwnerSid()
 {
     return(WMIMethod.ExecuteMethod(this));
 }
Beispiel #6
0
 public void RenamePrinter(string newName)
 {
     WMIMethod.ExecuteMethod(this, new { NewPrinterName = newName });
 }
Beispiel #7
0
 public dynamic Activate()
 {
     return(WMIMethod.ExecuteMethod(this));
 }