问题标签 [class-library]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
4 回答
1196 浏览

c# - 如何保护 .net 类库使其不能被其他应用程序引用?

如何保护 .net 类库项目和生成的 dll,使其不能被其他应用程序(.net 项目)引用,除了我自己的解决方案中的那些项目?

0 投票
3 回答
22794 浏览

c++ - 在 .so 库中使用 C++ 类

我正在尝试为 C++ 课程编写一个小型类库。

我想知道是否可以在我的共享对象中定义一组类,然后直接在演示库的主程序中使用它们。有没有什么技巧?我记得很久以前(在我开始真正编程之前)读过这篇文章,C++ 类只适用于 MFC .dll 而不是普通的,但这只是 windows 方面的。

0 投票
13 回答
7896 浏览

language-agnostic - 进行网络抓取的最佳图书馆

我想从不同的网页获取数据,例如餐厅地址或给定位置的不同事件的日期等。我可以用来从一组给定的站点中提取这些数据的最佳库是什么?

0 投票
3 回答
2951 浏览

c++ - setbuf() 会影响 cout 吗?

再次,我的老师无法回答我的问题。我知道谁能...

所以,我从来没有真正学过 C。在 C++ 中,我显然会一直使用 cout 语句。在最近的一项作业中,我的老师告诉我们要确保

在 main() 的顶部,以获得无缓冲的输出,从而使我们能够正确查看输出。

我的问题是:这个语句会影响 cout 语句,还是我调用的 printf() 语句?

提前致谢!

0 投票
10 回答
13663 浏览

c# - 如何在 VB 代码中调用 C# 扩展方法

我有一个类库,其中包含一些用 C# 编写的扩展方法和一个用 VB 编写的旧网站。

我想从 VB 代码中调用我的扩展方法,但它们没有出现在 intelisense 中,并且当我访问该站点时出现编译错误。

我已经获得了所有必需的Import,因为相同命名空间中包含的其他类在 Intelisense 中看起来很好。

有什么建议么

编辑:更多信息以帮助发表一些评论。

我的实现看起来像这样

和我这样的用法

0 投票
3 回答
3695 浏览

vb.net - VB .NET (.NET 2.0) Class Library configuration

I have created a class library in VB .NET. Some code in the library connects to the database. I want to create a config file that would hold the connection string.

I have created a "Settings.settings" file and stored the connection string in there.

When a class library having a settings file is built, it generates a ".dll.config" file which has the key value pairs defined in the settings file.

Problem with this is when i change the connection string in the ".dll.config" file, the library does not references these changes. I would still need to recompile the class library which would then overwrite my changes in the .dll.config file.

I need to be able to change the connection strings on the fly without having to recompile the library.

Is there a mechanism in VB.NET class library (.NET 2.0) that would let me do this?

Passing the connection string to the class library from the web page that uses its method is not a option.

I have listed a sample below, this is how i would access the string.

0 投票
6 回答
1307 浏览

c# - C# - 获取参考文献

我已经建立了一个类库项目,它引用了几个 dll。在我的类库项目的构造函数中,我使用了来自引用的 dll 之一的一些枚举。在另一个项目中使用我的类库时,是否可以不必添加对我的 dll 的引用以及我的类库项目在内部引用的那些?

0 投票
1 回答
728 浏览

silverlight - 如何在 Silverlight 中创建已编译、可再分发的类库?

是否可以创建可在 Silverlight 应用程序中使用的小型库(类似于 Flash 或 Flex SWC 组件)?

因为我是一名 Flash 和 Flex 开发人员,所以我将把它联系起来。在 Flex 中,如果我有一个 SWC,我可以将它添加到我的构建路径中,然后立即在我的项目中使用它包含的类和函数。同样,在 Flash 中,如果我将 SWC 添加到 Components 文件夹,然后将该 SWC 拖到我的库中,我可以在我的 Flash 项目中使用这些类。

Silverlight 有类似的概念吗?我只需要一个可以发送给其他开发人员的小型代码库,但它应该是预编译的,因此源代码不容易获得。

谢谢!

0 投票
5 回答
742 浏览

naming-conventions - 项目命名

作为一名初学者/中级开发人员,我遇到了一个问题,因为我的项目变得越来越大,越来越抽象,因为我使用了更多的 OOP 原则,我在命名事物时遇到了问题。就像当我有多个项目或类库时,我不知道如何命名它们。我看到了从 xxx.Core 到 xxx.Main 的东西,甚至看到了 xxx.BLL 和 xxx.DAL。在浏览其他人时,我看到 xxx.Services 和 xxx.Data 用于他们的库和命名空间。

那么一旦解决了这个问题,我该怎么称呼 DTO?在那个领域我见过 xxx.DTO、xxx.Entities、xxx.Props。

在编码时命名库,方法,接口等有什么好的指导方针,以便越来越多的人在我之后接手项目时会理解事物。

0 投票
2 回答
1268 浏览

c# - InternalEquals(object objA, object objB) 的实现在哪里

在使用 Reflector 反汇编 .Net 源代码时,我发现了 Object Class 中的 Equals 实现,它指的是

这又是指

我现在很困惑在哪里可以找到这个InternalEquals(object objA, object objB)函数的实现,它是如何使用这个函数的,这个函数是在哪个 .Net 程序集中定义的,以及如果每个东西都是从头开始为 .Net 源代码编写的,那么为什么我找不到这个函数的实现。