Re: Convert an Object to an array of strings.
- From: Göran Andersson <guffa@xxxxxxxxx>
- Date: Mon, 03 Jul 2006 12:16:16 +0200
Cast the value that you get back to the actual data type. If the object really is a string array, cast it as such:
string[] LoadedObject = (string[])SUBKEY.GetValue(KeyNames[i].ToString());
james wrote:
I wrote values to the registry in a "MultiString" registry type. I now want to retrieve these into a string array..
I use this:
String[] LoadedObject = SUBKEY.GetValue(KeyNames[i].ToString())
but this gives an error "Cannot implicitly convert type 'object' to 'string[]'. Which is fine, but what do I do?
Googling, I saw this:
= (string[])<object>.ToArray(typeof(string));
but my object (the getvalue) bit doesn't seem to offer "ToArray".
James.
- Follow-Ups:
- Re: Convert an Object to an array of strings.
- From: james
- Re: Convert an Object to an array of strings.
- References:
- Convert an Object to an array of strings.
- From: james
- Convert an Object to an array of strings.
- Prev by Date: Convert an Object to an array of strings.
- Next by Date: Re: Convert an Object to an array of strings.
- Previous by thread: Convert an Object to an array of strings.
- Next by thread: Re: Convert an Object to an array of strings.
- Index(es):
Relevant Pages
|