ASP.NET:How to write error messages into a text file using a simple httpModule

In one of my previous posts, I mentioned about how to troubleshoot some issues with the use of a module. In this post, I will show you how a similar module could be of use when you want to log all the errors in a text file for troubleshooting purposes. Please ensure that C:\Temp folder…


Logparser Scenario 9:Find out what is the peak time for your IIS Server

This blog entry is a continuation of the KB Article http://support.microsoft.com/?id=910447 Scenario 9:Find out what is the peak time for your IIS Server How can you find out what is the peak time (peak hour) for your Website using Logparser? Answer: Logparser "SELECT quantize(time,60), count(*) as Frequency from ex080716.log GROUP BY quantize(time,60) order by quantize(time,…

3

Run a batch file as a specific User (or Administrator) from ASP.NET…

…well first of all, I am NOT recommending it, but sometimes it could be necessary! Now, let’s proceed to the code… 1. Create a page called RunBatchFile.vb and paste the following… Imports System.Diagnostics Imports System.IO Partial Class RunBatchFile Inherits System.Web.UI.Page Dim _password As New System.Security.SecureString Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)…

3

Visual Studio 2008 – More control over Recent Projects list in Start Page

If you work with a lot of samples, the chances are quite likely that you will end up in a rather dirty list of Recent Projects List in Visual Studio. I’m personally quite nit-picky and I really hate it when I find something like this… Now… I don’t know which of these Samples should I click…

16

Why do I like overflow:scroll so much?

There are times when you want to incorporate a picture, a large piece of code in a limited web space… ex. a blog post which has a lot of <DIV> tags. Now, to crop or resize the picture may not be the option always. I still see a lot posts where the images are either…

1

Why am I unable to search for the folder which I know is present (in Vista)?

Or… what exactly is this “Compatibility Files” folder icon doing in my Windows Explorer?? Jerry’s Blog explains this stuff beautifully! So, why am I blogging about this? Well… to cut the long story short, I have lost almost 3 hours yesterday searching for some files/folders to fix an issue with one of my software which…


The F7 and F8 key while you are using command prompt.

I am sure many of you will be aware of this F7 and F8 keyboard shortcut while working with the plain old command prompt. For those who are not… try this out! F7 – Basically, this would just list the history of commands you have already typed in. You can then choose up and down…

2

MSIL Trivia – 1

Background: If you have multiple Main methods in your C# console application, you will be able to compile the application only if you provide the /main:ClassName on your command prompt. For ex. create a file called SampleMSIL.cs and paste the following… using System; class AA {    public static void Main()    {       Console.WriteLine("In…

1

Enable wrap and change the color of Listbox items

Problem description> You have a Listbox where you have a lot of items which are quite large and won’t fit inside the width of your listbox. You don’t want to enable Horizontal Scroll bar, since you have don’t want your users to keep scrolling left and right in order to view the items. Now if…

12

Change the border color and style of PictureBox in VB.NET

You know that by default you don’t have too many options to change the Border Color/Style of a normal PictureBox control. I wanted to customize this control a little bit, so that you can at least change the border color and style when you click on any image. Let’s see how it looks, and then…

6