如何在c#.net中添加模块?菜单项目中没有选项->在vb.net中的c#.net中添加模块. [英] how to add module in c#.net? There is no option in the menu project-> add module in c#.net which we have in vb.net.

查看:148
本文介绍了如何在c#.net中添加模块?菜单项目中没有选项->在vb.net中的c#.net中添加模块.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在c#.net中添加模块?菜单项目中没有选项->在vb.net中的c#.net中添加模块.

how to add module in c#.net? There is no option in the menu project-> add module in c#.net which we have in vb.net.

推荐答案

C#中没有类似的模块.最接近的一件事是静态函数.因此,不要使用模块,而要使用带有静态函数的类-这是我的建议.
There is nothing like modules in C#. The one thing that is close to that is a static function. So, instead of using modules, just use a class with a static function - that is my advice.


C#不使用模块-仅使用类.
相反,右键单击您的项目,然后选择添加...新项",您将获得一个看起来与您期望的外观几乎相同的列表.

顺便说一句,如果您在VB中选择添加...模块",那么无论如何您都会得到与添加...新项目"相同的列表...
C# Doesn''t use Modules - just classes.
Instead, right click your project and select "Add...New Item" you will get a list that looks pretty much as you expect.

Incidentally, if you select "Add...Module" in VB, you get the same list as "Add...New Item" anyway...


我想您的意思是模块实际上是一个代码文件..在C#中,我们有一个称为代码文件的功能.只需单击添加新项",您将在末尾看到一个名为代码文件"的东西.就像vb.net中的模块一样.您可以在其中放置实用程序类.
I think what you mean by module is actually a code file.. In C# we have a feature called code file.. Just click Add New Item you will see a something called "Code File" towards the end. That is something like a module in vb.net.. you could put your utility classes there..


这篇关于如何在c#.net中添加模块?菜单项目中没有选项->在vb.net中的c#.net中添加模块.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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