using ll.dll;
using 后面一般是跟命名空间的呀,
你要给mydll一个命名空间,然后要在App中引用:
ll.cs:using System;
namespace Mylib
{
public class mydll
{
public const int max=50;
}
}
app.cs:using System;
using Mylib;
class myapp
{
static void Main()
{
Console.WriteLine("最大为" + mydll.max); }
}
using 后面一般是跟命名空间的呀,
你要给mydll一个命名空间,然后要在App中引用:
ll.cs:using System;
namespace Mylib
{
public class mydll
{
public const int max=50;
}
}
app.cs:using System;
using Mylib;
class myapp
{
static void Main()
{
Console.WriteLine("最大为" + mydll.max); }
}
/reference:bbb.dll不过建议你用模块更稳定些!/addmodule:abc.mob不懂就好好看看 csc.exe /?
你用VSS自身的开发环境吧,在哪里写app.cs,并在它的项目中添加对那个DLL文件的引用
csc /reference:11.dll app.cs
public class mydll
{
public const int max=50;
}
csc /t:library ll.cs 编译后保存为d:\ll.dll
//////////////////////////////////////////一个app.cs也保存在d:\内容为:using System;
using ll.dll;
class myapp
{
static void Main()
{
Console.WriteLine("最大为" + mydll.max); }
} csc app.cs 编译时说“找不到类型或命名空间ll”...
我一个ll.cs内容为:using System;
public class mydll
{
public const int max=50;
}
csc /t:library ll.cs 编译后保存为d:\ll.dll//////////////////////////////////////////一个app.cs也保存在d:\内容为:using System;
using ll.dll;
class myapp
{
static void Main()
{
Console.WriteLine("最大为" + mydll.max); }
} 执行 csc /reference: ll.dll app.cs 报错:缺少对 /reference 命令行选项的文件规范;
d:\ll.dll是二进制文件,而非源代码文件;
源文件ll.dll未能打开;还是不行啊?
文件内容:
ll.cs:using System;
namespace Mylib
{
public class mydll
{
public const int max=50;
}
}app.cs:using System;
using Mylib;
class myapp
{
static void Main()
{
Console.WriteLine("The max = " + mydll.max); }
}
编译命令:csc /t:library ll.cs csc /reference: ll.dll app.cs 经过上两句,产生了app.exeapp命令行提示:The max = 50为要把“最大为”什么改英文呢?是因为我的命令行下中文提示显示为乱码!
同意楼上的, 命令行的 一次看 C#的书 用的全是指令, 晕