在vb.net/c#中创建类库 [英] Creating Class libraries in vb.net/c#

查看:119
本文介绍了在vb.net/c#中创建类库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在.net中创建一个类库,其中包含我在vb6中编写的所有常用功能.

准备好重写它,但是与vb6不同,在vb6中,我可以创建一个包含标准exe和dll项目的组项目.我希望能够像在vb6中一样调试vs2005中的dll.

我还需要知道如何在.net中编写属性,方法和事件.

请帮忙!

解决方案

根据您的要求,您是.Net的新手. 我认为您应该首先阅读C#或VB.Net书籍并进行阅读.

这将帮助您了解如何完成上面提到的某些事情.
然后,您可以开始重新编写代码-在此处发布遇到的任何问题,某个人应该可以为您提供帮助/指导.为你

.Net使用解决方案,这些解决方案是与旧的VB组项目构想相似的相关项目.创建解决方案后,您可以添加任意数量的项目并使它们相互引用.

*打开Visual Studio
*选择文件"->新建项目"
*选择项目类型"Windows应用程序"
*选择File-Add-> New Project
*选择项目类型类库"
*在Windows应用程序下,右键单击引用",然后选择添加引用"
*在打开的对话框中,切换到项目"选项卡,然后选择在步骤4中添加的类库项目.

您的Windows应用程序现在可以使用类库中的代码(使用\ Imports语句!),并且可以通过在类库代码中设置断点来进行调试


您好,

感谢您的及时答复,但我只需要有关此主题的教程.我读过大多数书籍,但它们似乎都集中在语言上,讨论诸如形式,控件,语法,功能,重载等内容.

请给我指向一个教程,该教程教如何制作具有属性,方法,事件,返回和传递参数的类库.

谢谢!


I want to create a class library in .net with all common functions that i have written in vb6.

Am ready to rewrite it, but unlike vb6, where i could create a group project that contains a standard exe and a dll project. I want to be able to debug the dll in vs2005 like i do in vb6.

I also need to know how to write properties, methods and events in .net.

Pleas help!

解决方案

Judging by your requirements, you are new to .Net.
I think you should first pick up a C# or VB.Net book and do some reading.

That will help you understand how to do some of the things you have mentioned above.
You can then start rewriting your code - post any problems you run into here and someone should be able to help / guide you.


Definitely have a read up on the subject, but a few pointers for you

.Net uses Solutions, which are related projects similar to the old VB group project idea. Once you''ve created a solution, you can add any number of projects and have them reference each other.

* Open Visual Studio
* Choose File->New Project
* Choose project type ''Windows Application''
* Choose File-Add->New Project
* Choose project type ''Class Library''
* Under windows application, right click on References and choose ''Add Reference''
* On the dialog that opens, switch to the ''Projects'' tab and choose the class library project you added in step 4.

Your windows application can now use the code in the class library (with using \ Imports statements!) & can debug by setting breakpoints in your class library code


Hello,

Thanks for the prompt reply, but i just need a tutorial on the subject. I have been reading most books, but they all seem to focus on the language generally, discussing thing like forms, controls, syntax, features,overloading etc.

Please just point me to a tutorial that teach how to make a class library with properties, methods, events, returning and passing arguments.

thanks!


这篇关于在vb.net/c#中创建类库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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