# Wednesday, October 26, 2005

[...]The .NET Framework 2.0 comes with a built-in webserver, based on the old Cassini web server. So I wanted to be able to easily set up any directory to have its contents served up on an as-needed basis. The result is an addition to the Windows Explorer right-click menu...[Robert McLaws]

Chris Fraizer wrote it thgether in a small app.

Here is my version with a few modifications:

using System;

using System.IO;

using System.Collections.Generic;

using System.Diagnostics;

using System.Windows.Forms;

using System.Text;

using System.Runtime.InteropServices;

 

namespace WebServerHere

{

    class Program

    {

        static void Main(string[] args)

        {

            if (args.Length >= 1)

            {

                string _path;

 

                string _command =

                    Path.Combine(

                    RuntimeEnvironment.GetRuntimeDirectory(),

                    "WebDev.WebServer.EXE");

 

                StringBuilder _commandArgs = new StringBuilder();

 

                Random _r = new Random();

 

                string _port = _r.Next(1024, 9000).ToString();

 

                if (args.Length == 2)

                {

                    _port = args[1];

                }

 

 

                //grab the original path

                _path = args[0];

 

                _commandArgs.Append(" /path:\"");

                _commandArgs.Append(_path);

                _commandArgs.Append("\"");

                _commandArgs.Append(" /port:");

                _commandArgs.Append(_port);

                _commandArgs.Append(" /vpath: \"/");

                _commandArgs.Append(_path.Substring(

                    _path.LastIndexOf('\\') + 1));

                _commandArgs.Append("\"");

 

                ProcessStartInfo _info =

                    new ProcessStartInfo();

 

                _info.Arguments = _commandArgs.ToString();

                _info.CreateNoWindow = true;

                _info.FileName = _command;

                _info.UseShellExecute = false;

                _info.WorkingDirectory =

                    _command.Substring(0, _command.LastIndexOf('\\'));

 

 

                Process.Start(_info);

 

                using (Control _c = new Control())

                {

                    Help.ShowHelp(_c, "http://localhost:" + _port + "/");

                }

            }

            else

            {

                MessageBox.Show("Usage:\n\tWebServerHere.exe <path> [port]",

                    "WebServerHere", MessageBoxButtons.OK,

                    MessageBoxIcon.Information);

            }

        }

    }

}

And the Non-Admin installation reg-file:

Windows Registry Editor Version 5.00

[HKEY_Current_User\SOFTWARE\Classes\Folder\shell\VS2005 WebServer]
@="ASP.NET 2.0 Web Server Here"

[HKEY_Current_User\SOFTWARE\Classes\Folder\shell\VS2005 WebServer\command]
@="\"%SystemRoot%\\System32\\WebServerHere.exe\" %1"

ASP.NET | C# | Misc | Projects
Wednesday, October 26, 2005 9:53:48 AM (W. Europe Daylight Time, UTC+02:00)  #    Disclaimer  |  Comments [1]  | 
# Tuesday, October 25, 2005
Wie ich blogge?!
Tuesday, October 25, 2005 1:15:04 PM (W. Europe Daylight Time, UTC+02:00)  #    Disclaimer  |  Comments [0]  | 
# Monday, October 24, 2005

Wow, what a weekend. Just so short cuz my desk is quite full - but I promise to tell more tomorrow.

 

Event | Misc
Monday, October 24, 2005 6:23:00 PM (W. Europe Daylight Time, UTC+02:00)  #    Disclaimer  |  Comments [1]  | 
# Wednesday, October 12, 2005

Problem
When connecting through a Microsoft ISA 2004 server, the FTP client has read only access to the files and folders. e.g. Uploading, renaming or deleting a file or folder is not possible. The FTP server replies with a "550 Access denied" message if such operations are performed.

Solution
Microsoft ISA 2004 server (acts as Firewall) default settings only allow read access (list and download).

To change this settings open ISA management -> Select Firewall policy -> Web Access -> Protocol -> Filtering ->Configure FTP
On this page remove the check mark from the "Read Only" option.

Wednesday, October 12, 2005 9:35:01 AM (W. Europe Daylight Time, UTC+02:00)  #    Disclaimer  |  Comments [1]  | 
# Tuesday, October 11, 2005

Damir hat ein tolles Video zusammengeschnitten...

Starring: Barbara Steiger, Simone Stocker, Frank Butler, Christian Frei, Amy Sorokas, Trisha Lacey, Hans Verbeeck, Karsten Samatschke, Christian Wenz, Damir Tomicic, André Obelink, Dirk Primbs, Frank Prengel, Bill Gates, Jim Alchin, Andres Hejlsberg, Chris Anderson, Don Box, Scott Guthrie, Doug Purdue, Sara Faatz, Samantha Spears, Morgan Baker, Julia Lerman, Nicolas Clerc, Patrick Hynds, Chris Capossela, Golo Haas, Alex Bierhaus, Mario Spuszta, Alexander Holly, Michael Willers, Channel 9 guy

Tuesday, October 11, 2005 9:49:27 PM (W. Europe Daylight Time, UTC+02:00)  #    Disclaimer  |  Comments [0]  |