1、新建一个解决方案;
2、在解决方案下添加一个新类库项目;
3、在类库项目下添加一个类文件:
内容如下:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;namespace ClassLibrary1
{
public class ReflectionTest
{
public ReflectionTest()
{ }public string WriteName(string name)
{
return "您好:" + name + "!";
}public string WriteHello(string str)
{
return "Hello " + str;
}public string WriteNoParaments()
{
return "您调用的是无参方法!";
}
}
}
4、添加一个应用程序项目
5、在Program类中进行测试