在C#中的#include指令 [英] #include directive in C#

查看:187
本文介绍了在C#中的#include指令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有替代?如果有,如何将指令查找名为class.cs的文件?
我只是想代码分成每个类的文件。

Is there a replacement? If there is, how would the directive look for a file named "class.cs"? I just want to split the code into a file for each class.

推荐答案

没有,有没有替代品#include语句。 C#是在那里代码被组织成类的面向对象的语言。你可以在另一个类中使用代码从一个类取决于其知名度,并且可以从整个使用部分类多个源文件一个类拆分代码。这些人基本上是使用代码在另外一个文件的方式。但它是不一样的东西都没有。

No, there is no replacement for an #include statement. C# is an object-oriented language where code is organised into classes. You can use code from one class in another class depending on its visibility, and you can split the code from a single class across multiple source files using partial classes. These are essentially the way you use code from one "file" in another. But it's not the same thing at all.

这篇关于在C#中的#include指令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆