' Collection of code snippets by Arne Vajhøj 
' (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
Imports System
Imports System.IO
Imports System.Net

Namespace E
    Public Class Program
        Public Shared Sub Main(args As String())
            Using srv As New HttpListener()
                srv.Prefixes.Add("http://localhost:6666/")
                srv.Start()
                Dim ctx As HttpListenerContext = srv.GetContext()
                Dim req As HttpListenerRequest = ctx.Request
                Dim resp As HttpListenerResponse = ctx.Response
                resp.StatusCode = 301
                resp.RedirectLocation = "http://www.google.com/"
                resp.Close()
                srv.Stop()
            End Using
        End Sub
    End Class
End Namespace
