logoruby


C# 引用类库dll

Posted in c# by wanguan2000 on the 02月 19th, 2009

MathLibrary.cs 文件

namespace Wrox.ProCSharp.Basics
{
public class MathLib
{
public int Add(int x, int y)
{
return x + y;
}}}

MathClient.cs 文件

using System;
namespace Wrox.ProCSharp.Basics

{
class Client
{
public static void Main()
{
MathLib mathObj = new MathLib();
Console.WriteLine(mathObj.Add(7,8));
}
}
}

编译:

csc /t:library MathLibrary.cs
csc MathClient.cs /r:MathLibrary.dll

评论关闭