|
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.
|
|
|
|
|
if a LAN-wide solution is what you are after, then I'd consider embedding a web server, as is done e.g. here: Sample HTTP Server Skeleton in C#[^]. No need for IIS or some such.
|
|
|
|
|
It's not the end of the world if someone stumbles across this data but I would like to avoid it. Basically I want to call my boss or customer and say go to this address and you can watch what I'm going. It would only last a few hours at a time. It could be over a lan but I don't think that a customer can remote into our network.
I would like to avoid an extra server but I understand there are security concerns and it's not out of the question.
Thanks for the help.
|
|
|
|
|
I made a registration form(using asp.net and C#) with some attributes like username, password,date of birth,phone no,address, gender, postal code etc. There's no error in the code.
But When I run my web site and fill in the details, and press the OK button, I get an error:"Input string was not in a correct format."
Plz help me!
|
|
|
|
|
OK, a few pointers.
First of all, you should have asked this in the ASP.NET forum - that's the appropriate place to put questions on ASP.NET applications.
Secondly, have you actually tried debugging your application? Randomly pushing buttons and hoping that the fix-it fairy will magically visit isn't a valid debugging strategy.
Third - Google turns up millions of hits; always a good first stop - by the time you've typed your question in and waited for an answer, you could have found the answer on your own.
Fourth - big hint here. It's your DAL code that's at fault.
|
|
|
|
|
|
Pete O'Hanlon wrote: the fix-it fairy
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
That error means that the format of something that is trying to be converted to a number or date is wrong. Dates in particular are a pain because you really need to ask for input in an unambiguous format (e.g. 2011-10-07) which is unnatural, or allow a different format depending on the end user's locale. (Particularly for days like today where '7/10/11' is valid but different in the US or everywhere-else formats.)
|
|
|
|
|
angel 2 wrote: There's no error in the code.
How did you assume that?
angel 2 wrote: I get an error:"Input string was not in a correct format." Plz help me!
This error usually occurs during data type conversions, like when using Convert.ToInt() etc. You may want to check your string before converting.
|
|
|
|
|
angel 2 wrote: Re: Error!
That's an interesting subject.
angel 2 wrote: There's no error in the code
Lucky you. So why post a cry for help?
angel 2 wrote: Input string was not in a correct format
Most likely cause is the string you are converting to some type (int, DateTime, ...) is empty.
|
|
|
|
|
Hi,
I am a novice in C# and need to create a collapsible panel or expander in my C# project. I am using VS2010 .net4 Framework.
Please help with the code and explanation in detail.
Thanks,
Shikha
|
|
|
|
|
What type of application? ASP.NET, WPF, WinForms?
|
|
|
|
|