








我写个了小sample
1.cs
using System;
public class MyClass
{
public static string GetStr()
{
return "this is a sample.. haha i am Taye";
}
}
在cmd中
csc /t:library 1.cs
生成了1.dll
2.cs
using System;
public class MyClass2
{
public static void Main()
{
Console.WriteLine(MyClass.GetStr());
}
}
在cmd中
csc /t:exe 2.cs /r:1.dll
生成了2.exe
2.cs中使用了1.dll中的MyClss.GetStr()的一个静态方法。所以在编译时要先引用
/r:1.dll
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。