|
-
Invoking a static method with Reflection
I like to invoke a static method "getInstance" on a class using C#. Any ideas?
This won't work...
Assembly a = Assembly.LoadFrom("Reflection.dll");
Type t = a.GetType("Reflection.Singleton");
MethodInfo mi = t.GetMethod("getInstance");
object o = mi.Invoke(t, new object[]{});
Thanks
/Staffan
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks