1.类库创建
1.1 编码
namespace lib{
public class Jishuan{
public int add(int a,int b){
return a+b;
}
}
}
1.2 编译
2 客户端
2 1.编码
using System;
using lib;
namespace HelloWorldApplication
{
class HelloWorld
{
static void Main(string[] args)
{
Console.WriteLine("Hello World");
Jishuan js = new Jishuan();
int a = js.add(2,3);
Console.WriteLine(a);
Console.ReadKey();
}
}
}
编译
运行结果