|
I have updated my article[^] to include a second major situation, which probably is what you need.
|
|
|
|
|
Ofcourse the absolute coordinates (MousePosition) !
I was stuck with this problem for a couple of days.
Thanks a lot Luc, you saved me.
|
|
|
|
|
You're welcome.
|
|
|
|
|
Can i have textfile templetes for Captcha with Random numbers
|
|
|
|
|
I suppose you can, but I'm guessing you don't.
|
|
|
|
|
Greetings Gurus,
Could you help please?
I am querying the registry to get a list of installed programs, this works.
I am trying to locate a value in the list of returned items, this doesn't work.
e.g.
RegistryKey rk = Registry.LocalMachine;
RegistryKey rkprograms = rk.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Uninstall");
foreach (string s in rkprograms.GetSubKeyNames())
{
int idx;
idx = s.IndexOf(".NET");
Console.WriteLine(idx);
{
Console.WriteLine(s);
}
Console.ReadKey(true);
}
but all "idx" values return "-1" i.e. not found.
Is my method faulty?
|
|
|
|
|
That looks OK, try stepping through it in debug and see what the values are.
|
|
|
|
|
I just ran your code on my XP machine and it works.
This to obvious, but I will ask it anyway.
Did you check the registry manually to see whether any .NET entries are present?
Also note that your code will not work on XP x64 and Vista (and higher).
I read about it here[^]. But your code would have crashed if this was the case.
0100000101101110011001000111001011101001
|
|
|
|
|
Your method of looking at the Uninstall keys is flawed. It is NOT a list of everything installed on the machine, 'cause, lets face it, not everything is uninstallable/repairable.
Use WMI and the System.Management namespace to query for all instances of the Win32_Product class. This will show you everything that's installed on the machine, not including patches. Those are listed under the Win32_QuickFixEngineering class.
|
|
|
|
|
Bad luck, he's the no-WMI-for-me guy you have encountered not so long ago!
|
|
|
|
|
Ah, sucks to be him then. I'd rather use the stuff that works and is easy to code up instead of blowing half my project time working on something that is very complex to replace it.
|
|
|
|
|
@ PIEBALD - Will do (again), maybe looking at it with fresh eyes will reveal something
@ André - There are quite a few .NET entries in the registry "Microsoft .NET Framework 4 Client Profile", "Microsoft .NET Compact Framework 1.0 SP3 Developer"
@ Dave - http://stackoverflow.com/questions/673233/wmi-installed-query-different-from-add-remove-programs-list[^],
http://stackoverflow.com/questions/2246768/finding-all-installed-applications-with-powershell[^], http://www.techmumbojumblog.com/?p=39[^]and personal experience have proved that WMI only finds instances installed through MSI. If you are trying to catch an app that hasn't used MSI (Google Chrome for e.g.)the RegKey "Uninstall" is better. I also know that it won't find eveything, but it will find everything that Windows knows about.
@ Luc - I am not a "not-WMI-for-me" guy and already have WMI code in app. I prefer to only use WMI when it is more efficient than any other method. WMI is an inefficient method compared to using (for e.g.) System.Environment, System.Net.NetworkInformation etc.
@ Dave - I'd also rather use the stuff that works, but I would be even happier to use stuff that works efficiently. If that means that I have to write a few more lines of code so that there is less impact on the system's resources then that is what I'll do.
Thanks to all for your replies.
|
|
|
|
|
Yeah, you'll find stuff all over the registry. There isn't going ot be one method that returns everything that's installed on the machine. I've seen setups out there (.EXE-based) that don't show up in the resigtry at all.
|
|
|
|
|
A quick look at the subkey names in the registry will show you why.
|
|
|
|
|
|
Again, not the proper forum for this.
|
|
|
|
|
|
12.No advertising or soliciting.
|
|
|
|
|
Advertising, false advertising at that. Those keys are crackable. ECC isn't magic.
|
|
|
|
|
Greetings Gurus,
Without using another language, is there a C# way to convert the Windows install date to yyyymmdd ?
RegistryKey RegKeyIN = Registry.LocalMachine;
RegKeyIN = RegKeyIN.OpenSubKey("SOFTWARE\\MICROSOFT\\WINDOWS NT\\CURRENTVERSION");
Object Date = RegKeyIN.GetValue("InstallDate");
|
|
|
|
|
I'm no expert, but that appears to be the number of seconds since 1970-01-01.
System.DateTime dt = new System.DateTime ( 1970 , 1 , 1 ).AddSeconds ( seconds ) ;
|
|
|
|
|
Solved:
Get Windows install date and convert to human-readable format
RegistryKey RegKeyIN = Registry.LocalMachine;
RegKeyIN = RegKeyIN.OpenSubKey("SOFTWARE\\MICROSOFT\\WINDOWS NT\\CURRENTVERSION");
Int32 t = Convert.ToInt32(RegKeyIN.GetValue("InstallDate"));
System.DateTime dt = new System.DateTime(1970, 1, 1).AddSeconds(t);
{
Console.WriteLine("Install Date " + dt);
}
Hope this helps
|
|
|
|
|
I have an application that acquires data on a computer in real time. I want someone to be able to view that data in a web browser from anywhere. Can someone please point me in the right direction to get me started. I really don't even know what to search for so some tutorials or any info would be appreciated.
|
|
|
|
|
Do I understand that you want anyone to be able pull up this webpage on the system where the data is being captured? If so then this is a bad idea.
1) You would need this machine to be running IIS.
2) The URL would need to be accessible, i.e. a permanent IP address or DNS entries for your network.
3) Security
If you want to just make the data available from an outside website? Still a bad idea.
1) The machine would need to be accessible
2) Security
A better design would be to have the machine send the data to a central location, such as a database, then view or report on the data from there.
No comment
modified 7-Oct-11 11:01am.
|
|
|
|
|
You would need the computer (either the source or the acquirer) to host a web server, which would need to be DNS accessible from anywhere (i.e. on the internet). This has obvious security concerns (is the server you use secure? is the OS etc secure against portscans/exploit hunters? is the data you are publishing sensitive?), which you need to think about before going ahead.
I disagree that it's a 'really bad idea', but you should think about whether it is a good idea, at least.
If you decide that it is, you have two options:
- Host a full web server system, like IIS/ASP.net or Apache/PHP, which has access to a shared resource (e.g. a database) with the data acquiring process. Write some scripts to pull the data and format it for the browser.
- Use a simple in-process HTTP server, for example mine[^] or others that you might find in the same category[^]. You may need to disable IIS/Apache/etc if you want to host on port 80. Handle the requests and populate a response from the variables in your application.
|
|
|
|