Runtime type cast in C#
From: mra (mra_at_discussions.microsoft.com)
Date: 03/21/05
- Next message: LP: "Re: LinkedList in C# good case to use them"
- Previous message: Steve Teeples: "PropertyGrid and Registry Editor"
- Next in thread: Nicholas Paldino [.NET/C# MVP]: "Re: Runtime type cast in C#"
- Reply: Nicholas Paldino [.NET/C# MVP]: "Re: Runtime type cast in C#"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 21 Mar 2005 10:23:03 -0800
I want to cast an object that I have created from a typename to the
corresponding type. Can anycone tell me how to do this?
Example:
//Here, Create the object of type "MyClass"
object obj=Activator.CreateInstance(strAssemblyName, "MyClass");
//Now, I want to do something like ((MyClass)obj).Method
//Can I do this?
- Next message: LP: "Re: LinkedList in C# good case to use them"
- Previous message: Steve Teeples: "PropertyGrid and Registry Editor"
- Next in thread: Nicholas Paldino [.NET/C# MVP]: "Re: Runtime type cast in C#"
- Reply: Nicholas Paldino [.NET/C# MVP]: "Re: Runtime type cast in C#"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|