View Full Version : Add input to line
bobbie
01-05-2007, 09:59 AM
I have and I want to take the registry from the input and add it to the line on the Software\\registry but not sure how to do the replace?
Must be something simple. lol
registry = Input.GetText("Input1");
all_names = Registry.GetKeyNames (HKEY_LOCAL_MACHINE, "Software\\registry");
Thanks for the help.
mwreyf1
01-05-2007, 10:42 AM
registry = Input.GetText("Input1");
all_names = Registry.GetKeyNames(HKEY_LOCAL_MACHINE, "Software\\"..registry.."");
bobbie
01-05-2007, 11:01 AM
Thank you . I'm trying to add the output to a Paragraph but I get this error?
Error
---------------------------
Page1 -> Button1 -> On Click, Line 3: Argument 2 must be of type string.
---------------------------
OK
registry = Input.GetText("Input1");
all_names = Registry.GetKeyNames(HKEY_LOCAL_MACHINE, "Software\\"..registry.."");
Paragraph.SetText("Paragraph1", all_names);
Lorne
01-05-2007, 11:09 AM
Registry.GetKeyNames returns a table, not a string.
mwreyf1
01-05-2007, 11:20 AM
Try this
registry = Input.GetText("Input1");
is_there = Registry.DoesKeyExist (HKEY_LOCAL_MACHINE, "Software\\"..registry.."");
if is_there == true then
all_names = Registry.GetKeyNames (HKEY_LOCAL_MACHINE, "Software\\"..registry.."");
-- Initialize sInputContents to ""
sParagraphContents = "";
-- Concat table and add line numbers
if all_names ~= nil then
for LineNumber, LineContents in all_names do
if LineContents ~= "\r\n" then
sParagraphContents = sParagraphContents .. LineNumber .. ": " .. LineContents .. "\r\n";
else
sParagraphContents = sParagraphContents .. LineNumber .. ": " .. "\r\n";
end
end
-- Change the table into a string to load into the input object
--sParagraphContents = Table.Concat(tFileContents, "\r\n", 1, TABLE_ALL);
-- Set the input text
Paragraph.SetText("Paragraph", sParagraphContents);
else
Dialog.Message("Notice", "There are no subkeys for that key! Please choose a different key.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
end
else
Dialog.Message("Notice", "That key does not exist! Check your spelling or choose a different key.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
end
bobbie
01-05-2007, 11:43 AM
Thank you for the help. I will play with it more. and maybe get back for more questions.
mwreyf1
01-05-2007, 03:46 PM
Try this instead. I cleaned the code up a little and changed a few concats.
registry = Input.GetText("Input1");
is_there = Registry.DoesKeyExist (HKEY_LOCAL_MACHINE, "Software\\"..registry);
if is_there == true then
all_names = Registry.GetKeyNames (HKEY_LOCAL_MACHINE, "Software\\"..registry);
sParagraphContents = "";
-- Concat table and add line numbers
if all_names ~= nil then
for LineNumber, LineContents in all_names do
if LineContents ~= "\r\n" then
sParagraphContents = sParagraphContents .. LineNumber .. ": " .. LineContents .. "\r\n";
else
sParagraphContents = sParagraphContents .. LineNumber .. ": " .. "\r\n";
end
end
Paragraph.SetText("Paragraph", sParagraphContents);
else
Dialog.Message("Notice", "There are no subkeys for that key! Please choose a different key.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
end
else
Dialog.Message("Notice", "That key does not exist! Check your spelling or choose a different key.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
end
jfxwave
01-05-2007, 07:47 PM
I'm new at this 1 year running :)
This worked for me.
registry = Input.GetText("Input1");
all_names = "Registry.GetKeyNames (HKEY_LOCAL_MACHINE, *Software\\\\"..registry.."*);";
all_names = String.Replace(all_names, "*", "''", false);
Paragraph.SetText("Paragraph1", all_names);
If you need to add to the paragraph just ask if you need help and i will do it..
Jean
bobbie
01-05-2007, 08:04 PM
Whatever name you add to the input it just prints that out to the Paragraph1.
Even if is not in the registry.
jfxwave
01-05-2007, 09:27 PM
I'm sorry i thought thats what you wanted.
So the whole line of the registry will be in the input box and you want to change it in-side the input box and click the button to add it to the paragraph?
If so how is the reg string getting in the input box?
If not i don't understand ( sorry ) please explan more.
bobbie
01-05-2007, 09:34 PM
What I'm trying to do is enter a name of a program and seach the registry for it and show the keys for it.
Then I can make a backup of the key.
jfxwave
01-06-2007, 10:31 AM
I think i know what your talking about. Maybe this will help.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.