J
James B
If I have a Class below and I want to use Reflection to get classes
member variable value how should I actually do it? Can anyone help?
Cheers!
using System;
using System.Reflection;
namespace ConsoleApplication1
{
/// <summary>
/// Summary description for Class.
/// </summary>
class MyClass
{
private string MyValue = String.Empty;
public void setMyValue(string s)
{
MyValue = s;
}
[STAThread]
static void Main(string[] args)
{
MyClass o = new MyClass();
o.setMyValue("Value is String");
// How to get varaible MyValu's value
// using Reflection????
}
}
}
member variable value how should I actually do it? Can anyone help?
Cheers!
using System;
using System.Reflection;
namespace ConsoleApplication1
{
/// <summary>
/// Summary description for Class.
/// </summary>
class MyClass
{
private string MyValue = String.Empty;
public void setMyValue(string s)
{
MyValue = s;
}
[STAThread]
static void Main(string[] args)
{
MyClass o = new MyClass();
o.setMyValue("Value is String");
// How to get varaible MyValu's value
// using Reflection????
}
}
}