Click here to Skip to main content
15,901,001 members
Home / Discussions / C#
   

C#

 
QuestionHow to read 32 bit registry value from 64 bit application Pin
Hemal Kotak15-Jan-09 0:59
Hemal Kotak15-Jan-09 0:59 
AnswerRe: How to read 32 bit registry value from 64 bit application Pin
Simon P Stevens15-Jan-09 1:24
Simon P Stevens15-Jan-09 1:24 
GeneralRe: How to read 32 bit registry value from 64 bit application Pin
Hemal Kotak15-Jan-09 3:04
Hemal Kotak15-Jan-09 3:04 
Question.arc Pin
mark_w_15-Jan-09 0:27
mark_w_15-Jan-09 0:27 
AnswerRe: .arc Pin
benjymous15-Jan-09 0:51
benjymous15-Jan-09 0:51 
QuestionInstantiate System.String through reflection Pin
jdstuart15-Jan-09 0:00
jdstuart15-Jan-09 0:00 
AnswerRe: Instantiate System.String through reflection Pin
SeMartens15-Jan-09 0:42
SeMartens15-Jan-09 0:42 
GeneralRe: Instantiate System.String through reflection Pin
jdstuart15-Jan-09 1:58
jdstuart15-Jan-09 1:58 
The values in my app.config file actually looks like this.

<parameter type="System.String" value="32">
<parameter type="System.Int32" value="32">

Now, I can't call
int i = new int("32") or,
string myString = new string("32"),
since no such constructors exist. I need to somehow create objects of these types and assign these values to them. But I'm looking at a generic way of doing this.

(I don't want to write code like
object obj = null;
if(paramType is Int32)
obj = 32;
else if(paramType is String)
obj = "32";

I want to avoid code like this.

Any ideas?
GeneralRe: Instantiate System.String through reflection Pin
Daniel Grunwald15-Jan-09 2:25
Daniel Grunwald15-Jan-09 2:25 
AnswerRe: Instantiate System.String through reflection Pin
jdstuart15-Jan-09 2:50
jdstuart15-Jan-09 2:50 
GeneralRe: Instantiate System.String through reflection Pin
SeMartens15-Jan-09 2:27
SeMartens15-Jan-09 2:27 
GeneralRe: Instantiate System.String through reflection Pin
jdstuart15-Jan-09 2:32
jdstuart15-Jan-09 2:32 
GeneralRe: Instantiate System.String through reflection Pin
SeMartens15-Jan-09 3:08
SeMartens15-Jan-09 3:08 
GeneralRe: Instantiate System.String through reflection Pin
jdstuart15-Jan-09 18:33
jdstuart15-Jan-09 18:33 
QuestionGenerics Casting [modified] Pin
gnjunge14-Jan-09 23:45
gnjunge14-Jan-09 23:45 
AnswerRe: Generics Casting Pin
Simon P Stevens15-Jan-09 0:31
Simon P Stevens15-Jan-09 0:31 
GeneralRe: Generics Casting Pin
gnjunge15-Jan-09 0:57
gnjunge15-Jan-09 0:57 
GeneralRe: Generics Casting Pin
Simon P Stevens15-Jan-09 1:17
Simon P Stevens15-Jan-09 1:17 
GeneralRe: Generics Casting Pin
gnjunge15-Jan-09 1:43
gnjunge15-Jan-09 1:43 
AnswerRe: Generics Casting Pin
S. Senthil Kumar15-Jan-09 1:39
S. Senthil Kumar15-Jan-09 1:39 
GeneralRe: Generics Casting Pin
gnjunge15-Jan-09 1:44
gnjunge15-Jan-09 1:44 
QuestionAdd Row to the Bottom of Grid Pin
satsumatable14-Jan-09 23:11
satsumatable14-Jan-09 23:11 
GeneralRe: Add Row to the Bottom of Grid Pin
nelsonpaixao15-Jan-09 6:11
nelsonpaixao15-Jan-09 6:11 
GeneralRe: Add Row to the Bottom of Grid Pin
satsumatable16-Jan-09 0:42
satsumatable16-Jan-09 0:42 
QuestionUsing Crystal Report from C# .net Pin
Hema Bairavan14-Jan-09 21:40
Hema Bairavan14-Jan-09 21:40 

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.