Trigger a Timer Event at the Specific time of the Day in a Windows Service

I have used timer many times in Windows Form Application. It’s a simple control that is easy to use and implement. Lately, I was working on a Windows Service where there was a requirement of implementing a periodic job. The timer available in Windows Form is located in System.Windows.Form namespace which is definitely not available … Read more

Server.MapPath

Server.MapPath specifies the relative or virtual path to map to a physical directory. Server.MapPath(“.”) returns the current physical directory of the file (e.g. aspx) being executed Server.MapPath(“..”) returns the parent directory Server.MapPath(“~”) returns the physical path to the root of the application Server.MapPath(“/”) returns the physical path to the root of the domain name (is … Read more

OpenFileDialog.SafeFileName

I had developed an application in VS2008 with .NET 2.0 . The application was deployed using the VS2008 deployment project  with .NET Framework as pre-req. AutoCAD 2009 was already installed on all the client machines so the pre-req conditions were satisfied so .NET Framework was not skipped during the installation of the application. Later on,  … Read more

Missing Items in Visual Studio 2005 Menu

I noticed some missing menu items in the VS2005 (like clean, rebuild, and many others) but i continued by using the commands from other locations; until I got stucked!  I wanted to export a form as a template but the Export was not available in the File menu. The details of my environment are: WIN … Read more

Constansts in C#: const VS readonly

Pop quiz: What’s the difference between these three declarations? And, more importantly, when should you use each one? private const int _Millenium = 2000; private static readonly DateTime _classCreation = DateTime.Now; private readonly DateTime _InstanceTime = DateTime.Now; The first creates a compile-time constant, the second creates a run-time class constant, and the third creates a … Read more