C#: Getting last modified file from a directory
Friday, March 20th, 2009The following code snippet demonstrates how to get the most recently modified file from a directory.
(more…)
The following code snippet demonstrates how to get the most recently modified file from a directory.
(more…)
With Windows Vista getting popular and Windows 7 fast approaching there will soon be a lot of applications running on these platform. Some of the scenarios need to read the OS name dynamically from code. The commonly used method is to extract the OS name using System.OperatingSystem object. It provides a Platform and version number using which you can deduce the OS name.
Even wondered how to use a Java or Jar file in .Net ?
Well, the answer can be complicated or it can be simple too.
(more…)
Sometimes we need to expand the TextBox dynamically based on the length of the entered text. TextBox does not have a AutoSize property by which it can adjust it’s size based on the content. On way of calculating the Width for the TextBox is using the Graphics.MeasureString and calculating the Pixel width. This method has it’s Pros and cons.
Ever wanted to find out the different drives or just the removable drives on the machine ?? The DriveInfo class is the answer to your prayers.
.Net 3.5 has introduced a new TimeZoneInfo class which is an improvement over the existing TimeZone class. The TimeZone class can work on local TimeZone only i.e. converting between UTC and Local time zone only. The new TimeZoneInfo class provide much more richer functionality of working with different other Time zone’s.
(more…)
One of the cool feature of VS is the ability to set conditional breakpoints i.e. setting a breakpoints which hit based on a condition. When the condition is True the breakpoint will hit or else it won’t.
(more…)
There is a cool list of MetaData functions present in SQL server. I will be discussing one of them - object_id
Often we need to check if the Database is present and if it not then we need to create a new one. The most common answer to this is, try to connect to the Db and if the connection fails/throws an exception then the database does not exist. Do you think it is correct ?
(more…)