{I+=codeWee;}
[C#] How to call private method by name
class A
{

	private void MethodA(int n, int m)
	{

	}

}

class B
{

	private void Start()
	{

		A a = new A();

		System.Reflection.MethodInfo theMethod = a.GetType().GetMethod("MethodA", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
		theMethod.Invoke(this, new object[] { 1, 2 });
	}
}
HTML | PHP | C++ | DirectX11 | Javascript | C# | HTML5 | ASP | SQL | General | CSS | Oculus Rift | Unity3d | Virtools SDK | Tip | NSIS | PowerShell | node.js | Web API | RTSP | All
Copyright© 2016 CodeWee.com All rights reserved.