Click here to Skip to main content
15,887,676 members
Home / Discussions / C#
   

C#

 
Questionhow can run a application when a file click such as pdf files that run acrobat reader ? Pin
B.A17-Sep-07 4:00
B.A17-Sep-07 4:00 
AnswerRe: how can run a application when a file click such as pdf files that run acrobat reader ? Pin
Giorgi Dalakishvili17-Sep-07 4:04
mentorGiorgi Dalakishvili17-Sep-07 4:04 
AnswerRe: how can run a application when a file click such as pdf files that run acrobat reader ? Pin
J a a n s17-Sep-07 4:08
professionalJ a a n s17-Sep-07 4:08 
AnswerRe: how can run a application when a file click such as pdf files that run acrobat reader ? Pin
BoneSoft17-Sep-07 4:10
BoneSoft17-Sep-07 4:10 
QuestionHow to break For Loop.... Pin
KETAN.RK17-Sep-07 3:42
KETAN.RK17-Sep-07 3:42 
AnswerRe: How to break For Loop.... Pin
Giorgi Dalakishvili17-Sep-07 3:45
mentorGiorgi Dalakishvili17-Sep-07 3:45 
AnswerRe: How to break For Loop.... Pin
Pete O'Hanlon17-Sep-07 5:06
mvePete O'Hanlon17-Sep-07 5:06 
QuestionSetting listbox items to the registry Pin
Lucy17-Sep-07 3:32
Lucy17-Sep-07 3:32 
I have a listbox on a form that displays data from a registry key of value multistring. This listbox is filled when the form loads by this code:

RegistryKey getItems = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\RegKey_test");
if (getItems.GetValue("Items") != null)
{
string[] itemName = (string[])getItems.GetValue("Items");
for (int i = 0; i < itemName.Length; i++)
{
listBox1.Items.Add(getItems.GetValue("Items", itemName));
}
}

This works fine. But when I want to set the listbox items to the registry with the following code, an error occurs:

if (getItems.GetValue("Items") != null)

{ Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\RegKey_test", "Items", listBox1.Items.ToString(), RegistryValueKind.MultiString); }

I no that something is wrong with this line of code but I am not sure what it is. Can anyone advise me where I am going wrong please?

Lucy
AnswerRe: Setting listbox items to the registry Pin
Giorgi Dalakishvili17-Sep-07 3:43
mentorGiorgi Dalakishvili17-Sep-07 3:43 
GeneralRe: Setting listbox items to the registry Pin
Lucy17-Sep-07 3:51
Lucy17-Sep-07 3:51 
GeneralRe: Setting listbox items to the registry Pin
Giorgi Dalakishvili17-Sep-07 3:58
mentorGiorgi Dalakishvili17-Sep-07 3:58 
GeneralRe: Setting listbox items to the registry Pin
Lucy17-Sep-07 4:04
Lucy17-Sep-07 4:04 
GeneralRe: Setting listbox items to the registry Pin
Giorgi Dalakishvili17-Sep-07 4:11
mentorGiorgi Dalakishvili17-Sep-07 4:11 
GeneralRe: Setting listbox items to the registry Pin
Lucy17-Sep-07 4:21
Lucy17-Sep-07 4:21 
GeneralRe: Setting listbox items to the registry Pin
Giorgi Dalakishvili17-Sep-07 5:12
mentorGiorgi Dalakishvili17-Sep-07 5:12 
QuestionHow can I set Multi Folder Watcher?? Pin
Rakesh B Singh17-Sep-07 3:11
Rakesh B Singh17-Sep-07 3:11 
AnswerRe: How can I set Multi Folder Watcher?? Pin
Giorgi Dalakishvili17-Sep-07 3:23
mentorGiorgi Dalakishvili17-Sep-07 3:23 
QuestionRe: How can I set Multi Folder Watcher?? Pin
Rakesh B Singh17-Sep-07 23:28
Rakesh B Singh17-Sep-07 23:28 
AnswerRe: How can I set Multi Folder Watcher?? Pin
Giorgi Dalakishvili17-Sep-07 23:30
mentorGiorgi Dalakishvili17-Sep-07 23:30 
QuestionRe: How can I set Multi Folder Watcher?? Pin
Rakesh B Singh18-Sep-07 18:33
Rakesh B Singh18-Sep-07 18:33 
QuestionChange the location of the Shared add-in User.Config File Pin
Seenu_prabakar17-Sep-07 3:03
Seenu_prabakar17-Sep-07 3:03 
AnswerRe: Change the location of the Shared add-in User.Config File Pin
originSH17-Sep-07 3:12
originSH17-Sep-07 3:12 
QuestionPersisting collections - Serialization Problem??? Pin
Johnny J.17-Sep-07 3:00
professionalJohnny J.17-Sep-07 3:00 
Questionfile sharing for web applications Pin
gbabu1717-Sep-07 2:24
gbabu1717-Sep-07 2:24 
AnswerRe: file sharing for web applications Pin
Pete O'Hanlon17-Sep-07 2:56
mvePete O'Hanlon17-Sep-07 2:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.