I have no control over the image. I turn up at a customers and use my utility - they set their machines up however they want. I have to work with what is in front of me. I haven't come across the P/Invoke thing, so I will research that and see if I understand how it works. Thanks
Thanks for everyones replies - I have refactored using the above code and this does what I need for now.
I appreciate it may not be elegant or use the correct calls.
Thanks Folks
OK - I have read through some online tutorials and messed around. Here is my updated code. It does what I want and only has one instance of the actual code to execute, it calls it 6 times and passes different parameters each time. Probably still a very ugle way of doing it, but it reduces the...
Invoking dll's is a bit out of my depth. I've tested the current code and it alters the correct power settings on the active GUID.
I was just hoping to clean the code up a little and not call the same code (bar the arguments) 6 times.
I have written a small utility that extracts various information from a computer. Some of the data collected requires third party applications to run, this can take time and in some instances the machine will go to sleep or the disks will spin down etc...
I used to use various batch files to...
I have written some code with alters the power settings on Windows computers. I am no software dev, but I suspect there is a better way of coding than what I have written. Basically the code is duplicated 6 times to run each alteration to the system. I am sure there must be a way to write one...
Thanks everyone for your help on this one.
I did some debugging and found that I had messed up on the parameters. I needed to move the 'export' switch to the .Arguments line. It works a treat now.
I do take care of the error handling too - that is dealt with when I refine the code. I just...
I am trying to write a piece of code to export registry keys using C# and the built in reg export command line. This is what I have so far, but it just doesn't work:
using System;
using System.Diagnostics;
using System.IO;
namespace VolatileDataCapture.Services
{
class...
Hi All,
I am relatively new to C# and am struggling with outputting some results.
I have a piece of code that uses the inbuilt WMI commands to retrieve some system information. It currently writes the output to the console and works fine (both shown below). What I would like to do is output...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.