One way of obtaining management data and operation related to the Windows operating system is to use the Windows Management Instrumentation (WMI) classes. WMI can be considered as a database while the classes are like tables in the database. Therefore WMI can be queried to obtain specific table/class information. To use WMI classes in .NET … Continue reading Working with WMI classes
Author: Karlston D'Emanuele
Using ToString() on the same item multiple times
In article String concatenation and int indirect cast it was shown how the ToString() can be used to improve the performance of a program by eliminating the need for the boxing concept. However, the ToString() can still hinder the performance especially when used multiple times to convert a data type or object into a string … Continue reading Using ToString() on the same item multiple times
Shrinking the Log file
MS SQL stores database changes into a log file that as more activity occurs on the database the larger the log file grows. When it comes to disk space limitations and performance this becomes a considerable problem. MS SQL Server provides a command to truncate the log file DBCC SHRINKFILE(<log file>, 0, TRUNCATEONLY) The command … Continue reading Shrinking the Log file
Combining Directory Paths
When working with files it is typically to encounter the need to create a file path from two different strings. The basic way of doing this is to use a conditional statement and string concatenation. However, this is not recommended as it relies on system assumptions, like the directory separator character and that the paths … Continue reading Combining Directory Paths
String concatenation and int indirect cast – Part 2
In the previous section it was discovered that the ToString() method creates a new string. In this section the inner studies of ToString() are taken one step further in analyzing what implications the ToString() method has on string concatination. Test Scenario 3: Let’s modify the test in Test Scenario 1 in a way that this … Continue reading String concatenation and int indirect cast – Part 2