Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi,
Where can i find c# libraries:

for example:

C#
using csLibrary;

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


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.
Posted
Updated 17-Feb-10 9:46am
v5

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
 
Share this answer
 
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 wrote:
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.


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.
 
Share this answer
 
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
 
Share this answer
 
So you want a single library with basically anything you could possibly want to do in it? You're not going to find anything like that. But, most likely, if you need to do something, that method has been written and put into one of the standard .Net libraries. If not, then there's nothing you can do but write one yourself.
 
Share this answer
 
Well, you can write your own, you can buy toolkits, or you can read articles on CP. The question is kind of stupid for a number of reasons:

1 - libraries to do what ?
2 - .NET does exactly what you asked for, File.GetAllText will do that ( it's in System. IO ). What you probably need, is a really basic beginners book, and to take the time to read it.
 
Share this answer
 
Thanks William for the response,

But, surely there is someone somewhere that has collected many methods and has a library.

thanks again
 
Share this answer
 
Manuellt wrote:
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.


Christian Graus wrote:
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.




Are you sure?, the method can returns a class (generic or not) that encapsulates the value, a default value, a success flag, the error text, etc. It don't seems a bad code.
 
Share this answer
 
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900