Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [TestClass]
- public class RuntimeConversionsExample
- {
- [TestMethod]
- public void Example()
- {
- Type targetType;
- Type convertedType;
- object convertedValue;
- object initialValue;
- initialValue = "99";
- targetType = typeof (int);
- convertedValue = Convert.ChangeType(initialValue, targetType);
- convertedType = convertedValue.GetType();
- targetType = typeof (double);
- convertedValue = Convert.ChangeType(initialValue, targetType);
- convertedType = convertedValue.GetType();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement