We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to get the (new Type()).InvokeMember(....) 's output value?

Thread ID:




2348 Jan 9,2003 10:56 PM Windows Forms 0
Tags: FAQ
Asked On January 9, 2003 10:56 PM

hi, I'd like to ask a question about Reference: 1. Known Type's Name (String). 2. Known a public Method in the Class. Assembly assem = Assembly.Load("Test"); Type type = assem.GetType("Test.TestClass"); Object obj = Activator.CreateInstance( type ); Object[] args = new Object[1]; args[0] = "Hello"; type.InvokeMember( "GetMessage", BindingFlags.InvokeMethod, Type.DefaultBinder, obj, args ); // Then how to get the Return value? namespace Test { public class Test { public String GetMessage( String message ) { return message; } } } Thanks very much!


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.