I've finally gotten this thing to open information and place it into a text file.
My next question is, how do I get this part to work? I've bolded the registry key that I'm trying to put into the notepad file, but this one just will not work. What am I doing wrong?
using System;
using System.IO;
using Microsoft.Win32;
using System.Text;
using System.Diagnostics;
using System.Data;
using System.Collections.Generic;
using System.ComponentModel;
class Test
{
public static void Main()
{
// Create an instance of StreamWriter to write text to a file.
// The using statement also closes the StreamWriter.
using (StreamWriter sw = new StreamWriter("SysInfo.txt"))
{
RegistryKey hklm = Registry.LocalMachine;
hklm = hklm.OpenSubKey("HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0");
Object obp = hklm.GetValue("Identifier");
sw.WriteLine("Processor Identifier: " + obp);
[b]RegistryKey hklp = Registry.HKEY_CURRENT_USER;
hklp = hklp.OpenSubKey("HKEY_CURRENT_USER\Software\America Online\AOL Instant Messenger (TM)\CurrentVersion\Users");
Object obc = hklp.GetValue("Users");
sw.WriteLine("Users: {0} ", obc);[/b]
RegistryKey biosv = Registry.LocalMachine;
biosv = biosv.OpenSubKey("HARDWARE\\DESCRIPTION\\System\\MultiFunctionAdapter\\4");
Object obv = biosv.GetValue("Identifier");
sw.WriteLine("Bios Status: {0} ", obv);
RegistryKey biosd = Registry.LocalMachine;
biosd = biosd.OpenSubKey("HARDWARE\\DESCRIPTION\\System\\");
Object obd = biosd.GetValue("SystemBiosDate");
sw.WriteLine("Bios Date: {0} ", obd);
RegistryKey bios = Registry.LocalMachine;
bios = bios.OpenSubKey("HARDWARE\\DESCRIPTION\\System\\");
Object obs = bios.GetValue("Identifier");
sw.WriteLine("System Identifer: {0} ", obs);
sw.Close();
}
}
}
Basically I want it to place all those users on my computer into the file.