That entirely depends on the string representation and the type
involved. If you control the type involved, you can use the
TypeConverter class to do some of the work for you - if you look up
TypeConverter in the MSDN, you'll find quite a lot of information to
help you.
That entirely depends on the string representation and the type
involved. If you control the type involved, you can use the
TypeConverter class to do some of the work for you - if you look up
TypeConverter in the MSDN, you'll find quite a lot of information to
help you.
Apologies - having read Ryan's answer, I see what you mean
Ryan's on the right track - but there is one caveat, which is that when
Type.GetType is presented with just the type name (and no assembly
information) it only looks in the current assembly and mscorlib, so
Type.GetType ("System.Windows.Forms.Form") will return null, for
instance. If your string contains the full assembly information, that's
used appropriately - otherwise you can use Assembly.GetType if you know
the assembly which contains the type you're after.
Sorry again about the previous reply...
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.