Enable content expiration under IIS 7

In IIS6, it was with the website properties –> HTTP Headers. Here in IIS7, you can do this on the “HTTP Response Headers” feature on the website.

  • Select the website in the Connections pane.
  • Double click on the “HTTP Response Headers” feature in the features pane
  • In the action pane, click on the “Set Common Headers…”

image

  • You will see the following popup

image

Now, you know what to select. You should enable the HTTP Keep-Alive on this popup only.

 

Source : http://blogs.msdn.com/b/rakkimk/archive/2007/07/10/iis7-how-to-enable-content-expiration.aspx

Using Windows Services to monitor folders and unzip files – VB.NET

Sample Image - screenshot3.jpg

Introduction

A friend, developing an application in VB 6.0 needed a solution with the following requirements:

  • Have to run all the time.
  • There is no need to any user to be logged on.
  • Must run in Win 2K, XP and may be in 2003 server.

The answer was: Windows Services.

What does the application do?

The application that generated this solution uploads mdb access files zipped into a file to decrease the size of the data base file, ’cause some of his clients use 56k modem connections.

When developing his application in ASP.NET, he needed some way to monitor directory for this special zipped files. As the files arrive, the solution must unzip the files and overwrite the file content in the same directories.

The easiest way to do this, we thought, was with VB 6. We started to look for some place to find information of how doing this in VB 6, but no success. Every article, tutorial and code I found used VB.NET, C# or any other .NET language.

We were convinced that VB.NET had to be the choice for developing the Windows service. Were fascinated with how easy is to build a Windows service with VB.NET. With VB 6, we tried to build a normal executable and run it against a series of tools (as many articles describe) but none of the tools did the job.

Read more of this post

Create a Windows Service using VB.NET

Ok, its time for one more tutorial. This times pick is Windows Services. Creating Windows Services is not a big deal using Visual Basic. Just follow few simple steps and you are all set to run and test your first Windows Service.

Windows Services is new name for NT Services you used to develop in previous versions of Visual Studio. This tutorial walks you through how to create and use your Windows Services. This Service writes some text to a text file when stop and start the service. The base idea is taken from MSDN but its more elaborated. You can modify it according to your needs.

Step 1. Create Skeleton of the Service

To create a new Window Service, pick Windows Service option from your Visual Basic Projects, give your service a name, and click OK.

The result look like this. The Wizard adds WebService1.vb class to your project.

Set your ServiceName to your own name so it would be easier to recognize your service during testing OR you can set this property programmatically using this line Me.ServiceName = “mcWinService”

This is the name you will be looking for later :).

Read more of this post

Simple Windows Service Sample in C#

As a matter of fact Microsoft Windows services, formerly known as NT services enable you to create long-running executable applications that run in its own Windows session, which then has the ability to start automatically when the computer boots and also can be manually paused, stopped or even restarted.

This makes services ideal for use on a server or whenever you need long-running functionality that does not interfere with other users who are working on the same computer. You can also run services in the security context of a specific user account that is different from the logged-on user or the default computer account.

Windows services don’t have any interface to the user, so it can not be debugged like any regular application, but it’s debugged as a process. .NET has a very nice tool that enables processes debugging while it’s in the run status, by easily pressing Ctrl + Alt + P shortcut.

Background

I’ve searched well so many sites about a code that I can with the help of it, build a simple Windows service, but I found a lot of code on how to manage the current Windows services of the system and that’s through theServiceController class.

After searching the MSDN, I’ve found some nice code that helped me to create this simple Windows service. Hope it can help as a basic architecture for and usage of such a Windows service.

Using the code

At first you should simply open VS.NET and then at the File menu click on NewProject. From the New Project Dialog Box, choose the Windows service template project and name it MyNewService like shown below:

Winows Service New Project

Read more of this post