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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

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

Thread ID:




2348 Jan 10,2003 03:56 AM UTC WinForms 0
Tags: FAQ
Asked On January 10, 2003 03:56 AM UTC

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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon