C#库? [英] c# library?

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

问题描述


我在哪里可以找到C#库:

例如:

Hi,
Where can i find c# libraries:

for example:

using csLibrary;

public class x
{
  // ton of these out of the box methods
  public string GetFileAsString(string fileName)
  {
    return csLibrary.GetFileAsString(fileName);
  }
}



谢谢

我澄清我的问题:

程序员需要重复做很多事情,例如,从查询字符串获取值,解析为特定类型,对其进行验证并在需要时返回所需值或默认值.所有这些功能都可以归类为一个方法,而我正在尝试查找包含大量此类方法的库.换句话说,对框架的一种扩展.我不是在搜索应用程序块,入门工具包等,而是在寻找一个方法库,这些方法可以帮助完成无聊的事情,例如用一个提供文件的方法从xml提取节点或节点集合名称和标签元素.

再次感谢各位同事.
附言:我是高级的ASP.NET和C#程序员,也许我的英语有点有限.

对于Christian:也许您会说File.ReadAllText();,但是如果读取失败,则必须捕获错误,可以将其封装在方法中而不是代码中.



thanks

I clarify my question:

There are a lot of things that programmers need to do repeatedly, for example, get a value from querystring, parse to a specific type, validate it and return the desired value or a default value if necessary. All of this functionality can be grouped into a method and I''m trying to find libraries with tons of these methods. In other words, a kind of extensions to the framework. I''m not searching application blocks, starter kits, etc, I''m looking for a library of methods that can help to do the boring things like extract a node or collection of nodes from an xml with a single method giving a file name and a tag element.

thanks again to respectuosily collegues.
p.s.: I''m an advanced asp.net and c# programmer, perhaps my english is a little limited.

for Christian: maybe you will say File.ReadAllText();, but if read fails, you have to catch the error, it can be encapsulated in the method instead of your code.

推荐答案

尝试免费找到Internet上的Microsoft框架,其中一个是Enterprise框架,但是正如其他人所说,我认为您不会找到一个可以完成所有工作的库,大多数.NET可以完成您想要的全部工作,如果您想不花时间处理错误,那么,给我一行内容,然后我就可以为您创建该库了,显然我不会免费我很确定你会从中赚钱,我想要我的股份:)
对于像您:rolleyes:这样的C#专家来说,如果您确切地知道需要什么,那么创建此库将需要数小时,而添加新功能/方法将需要数分钟,即假设您尝试实现的功能不在.NET中.已经

祝您搜索顺利!
Try looking for Microsoft''s frameworks that are in the internet for free, one of them is the Enterprise one, but as others said, I don''t think you will find a library that does everything, most of what you want can be done with .NET, if you''re trying not to spend time handling errors, well, drop me a line and I can create that library for you, obviously won''t be for free as I''m pretty sure you''ll be making money out of this and I want my share :)
For an expert in C# like you :rolleyes: , creating this library will be matter of hours if you know exactly what you need and adding new features/methods will be minutes, that is supposing that what you try to achieve is not in .NET already

Good luck with your search


确定,现在有了一些道理.我的答案是一样的.您可以搜索框架,也可以搜索CP文章.大多数团队最终都会得到一个他们可以重用的方法的dll,例如,Path.Combine到处都是无用的虫子,所以我用我自己的.


OK, now it makes some sense. My answer is the same. You can search the framework, or you can search CP articles. Most teams end up with a dll of methods they reuse, for example, Path.Combine is buggy to the point of being useless, so I use my own.


Manuellt写道:
Manuellt wrote:

对于克里斯蒂安:也许你会说File.ReadAllText();,但是如果读取失败,你必须抓住错误,它可以封装在方法中而不是代码中.

for Christian: maybe you will say File.ReadAllText();, but if read fails, you have to catch the error, it can be encapsulated in the method instead of your code.



这是零意义.将对File.ReadAllText的调用和错误处理放入一个辅助方法中,意味着编写一个可以吞下异常并始终以相同方式响应的方法.那是错误的代码.



That makes zero sense. To put the call to File.ReadAllText AND the error handling into a helper method, means writing a method that swallows the exception and always responds the same way. That is bad code.


您的问题不清楚.

您是否要:

1)找到一个特定功能的库.

2)添加对您已经拥有的库的引用.

3)为项目中已经存在的库生成外观.

尼克
Your question is not clear.

Are you trying to:

1) Find a library that does something specific.

2) Add a reference to a library you already have.

3) Generate a facade for a library already in your project.

Nick


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

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