Introduction
In my .NET applications, I use several types of classes for several types of different applications. You never know, what you come across. This is a series of classes which any C# user may search in Google and spend considerable amount of time to find. Most of these classes I have taken from The Code Project and this can be considered as a tribute to The Code Project. Of course, there are my implementations all over the place but there is also code taken from The Code Project. So thanks to those who contributed in developing some part of this work. Because it's a huge project, I won't go into the details of the code in the article. However there are comments in the code in several places (not all). Moreover, using the code is very straightforward.
You can take it and use it wherever you want since it's a collection of different useful classes.
Using The Code
WHAT DOES IT INCLUDE? Good question.
Hashing algorithms (xcrypt.cs - TBMultiFunctionLibrary.SecurityEngine
)
HashAlgorithmEngine
:
- SHA, SHA256, SHA384, SHA512, MD5
Encryption algorithms (xcrypt.cs - TBMultiFunctionLibrary.SecurityEngine
)
SymmetricAlgorithmEngine
:
- AES, DES, RC2, Rijndael, TripleDES, BlowFish, Twofish
TBMultiFunctionLibrary.AES
->Implementation of AES
Operating System Management (TBMultiFunctionLibrary.OSManagementUtil
)
- Shut down computer
- Add new user to Windows
- Change Windows password
- Get username / machinename
- Get processlist
- Run or kill processes
Mail Objects (TBMultiFunctionLibrary.Mail
)
- Simple mail program can be implemented
- Send and get mails over internet
- Find mails, etc. (Requires Outlook to be configured)
SQL Server ADO.NET Connection Class (TBMultiFunctionLibrary.SQL
)
- Execute commands, transactions, stored procedures
- Manages your database
HTTP Web Request/Response Classes (TBMultiFunctionLibrary.HTTPWebObject
)
- Get URL
- Post data
- Proxy objects
- Manage cookies and errors
- Includes events
High Performance Timer (TBMultiFunctionLibrary.PerformanceTimer
)
- Uses
QueryPerformanceCounter
(the most precise timer) to measure time.
- Acts as a cronometer.
- You can use it to measure the execution time of your code.
Sort Algorithms (TBMultiFunctionLibrary.SortAlgorithms
)
- This part includes only one fast sorting algorithm but will be developed.
Computer Based States(TBMultiFunctionLibrary.ComputerState
)
- Methods:
IsConnectedToInternet
, isTabletPC
.
- This part will also be developed.
Conversions (TBMultiFunctionLibrary.Conversion
)
- Hexadecimal to Binary and vice versa conversions
- This part will also include more universal conversion of different metrics.
Clipboard Data Access (TBMultiFunctionLibrary.ClipBoard
)
- Write and read data to/from different data types (even image)
Socket Class for Client Side (TBMultiFunctionLibrary.ClientSocket
)
- A class that's able to transmit data to a certain server over TCP/IP using .NET sockets.
- Don't be afraid. It's very easy to use.
- Events are also included.
Hardware Information Class (TBMultiFunctionLibrary.Hardware
)
- Get detailed information on the hardware that this code runs on. You can get: CPU ID, Hard Disk information, Volume information, MAC Address, IP and computer name, etc.
Profile XML, INI, Registry Reader/Writer (TBMultiFunctionLibrary.Profile
)
- This class is able to perform I/O nearly for all of the computer devices such as registry, INI file, XML, etc.
- It supports events.
- Please refer to this article for more details.
Conclusion
Ok, now the hard part (knowing the objects) is complete. It's really simple to use any of those classes. Just declare an object. Give parameters required if necessary (most of the time it is not) and call the method you want to call with its parameters. As I said before, I cannot specify any demonstration or code explanation because there are a huge amount of classes given.
This is all for now. If you have any questions, please e-mail.
Happy coding!
History
- 16th November, 2006: Initial post