diff --git a/.gitignore b/.gitignore index 159ddf140..b62741867 100644 --- a/.gitignore +++ b/.gitignore @@ -3,8 +3,6 @@ Thumbs.db #Ignore files build by Visual Studio *.obj -*.exe -*.pdb *.user *.aps *.pch @@ -28,5 +26,7 @@ obj/ _ReSharper*/ [Tt]est[Rr]esult[s] +/[Bb]uild/ + #NZBDrone specific nzbdrone.db \ No newline at end of file diff --git a/CassiniDev/BuildDeploy.cmd b/CassiniDev/BuildDeploy.cmd deleted file mode 100644 index 22683d94f..000000000 --- a/CassiniDev/BuildDeploy.cmd +++ /dev/null @@ -1,7 +0,0 @@ -del ..\deploy\*.* /s/q -xcopy bin\x86 ..\deploy /S /I /F /Y ..\deploy.txt -copy ..\*.txt ..\deploy\ /Y diff --git a/CassiniDev/CassiniDev.4.csproj b/CassiniDev/CassiniDev.4.csproj deleted file mode 100644 index 972d2f802..000000000 --- a/CassiniDev/CassiniDev.4.csproj +++ /dev/null @@ -1,180 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {9AAD02EE-FE79-46BE-87EB-E3D2A376A043} - WinExe - Properties - CassiniDev - CassiniDev4 - v4.0 - 512 - true - ..\CasssiniDev-DevKey.snk - Resources\preferences-web-browser-shortcuts.ico - - - 3.5 - - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - - - - true - bin\x86\Debug\ - TRACE;DEBUG;NET40 - true - full - x86 - bin\Debug\CassiniDev4\CassiniDev4.exe.CodeAnalysisLog.xml - true - GlobalSuppressions.cs - prompt - AllRules.ruleset - ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets - false - ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules - false - - - bin\x86\Release\ - TRACE;NET40 - true - true - pdbonly - x86 - bin\Release\CassiniDev4\CassiniDev4.exe.CodeAnalysisLog.xml - true - GlobalSuppressions.cs - prompt - AllRules.ruleset - ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets - false - ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules - false - - - - - - - 3.5 - - - - - - - - - - - - - - - - - - - - - - - - - - Component - - - - - - UserControl - - - BodyView.cs - - - Form - - - FormView.cs - - - Form - - - LogView.cs - - - - - - BodyView.cs - - - FormView.cs - - - LogView.cs - - - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - Always - - - - - - - - - \ No newline at end of file diff --git a/CassiniDev/CassiniDev.Console.csproj b/CassiniDev/CassiniDev.Console.csproj deleted file mode 100644 index 49b6e70d6..000000000 --- a/CassiniDev/CassiniDev.Console.csproj +++ /dev/null @@ -1,105 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {539F0304-F14A-413F-A56A-AFB7724EA1A7} - Exe - Properties - CassiniDev - CassiniDev-console - v3.5 - 512 - - - - - - - - - true - ..\CasssiniDev-DevKey.snk - Resources\preferences-web-browser-shortcuts.ico - - - true - bin\x86\Debug\ - TRACE;DEBUG - true - full - x86 - true - GlobalSuppressions.cs - prompt - - - bin\x86\Release\ - TRACE;CONSOLE - true - true - pdbonly - x86 - true - GlobalSuppressions.cs - prompt - - - - - - - 3.5 - - - - - - - - - - - - - - - - - - - - - - - - - Component - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/CassiniDev/CassiniDev.Console4.csproj b/CassiniDev/CassiniDev.Console4.csproj deleted file mode 100644 index 0148be558..000000000 --- a/CassiniDev/CassiniDev.Console4.csproj +++ /dev/null @@ -1,156 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {539F0304-F14A-413F-A56A-AFB7724EA1A7} - Exe - Properties - CassiniDev - CassiniDev4-console - v4.0 - 512 - - - - - - - - - true - ..\CasssiniDev-DevKey.snk - Resources\preferences-web-browser-shortcuts.ico - - - 3.5 - - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - bin\x86\Debug\ - TRACE;DEBUG;NET40 - true - full - x86 - bin\Debug\CassiniDev4.Console\CassiniDev4-console.exe.CodeAnalysisLog.xml - true - GlobalSuppressions.cs - prompt - AllRules.ruleset - ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets - true - ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules - true - - - bin\x86\Release\ - TRACE;NET40 - true - true - pdbonly - x86 - bin\Release\CassiniDev4.Console\CassiniDev4-console.exe.CodeAnalysisLog.xml - true - GlobalSuppressions.cs - prompt - AllRules.ruleset - ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets - true - ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules - true - - - - - - - 3.5 - - - - - - - - - - - - - - - - - - - - - - - - - Component - - - - - - - - - - - - - Always - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - - - \ No newline at end of file diff --git a/CassiniDev/CassiniDev.Lib.csproj b/CassiniDev/CassiniDev.Lib.csproj deleted file mode 100644 index 1d06077de..000000000 --- a/CassiniDev/CassiniDev.Lib.csproj +++ /dev/null @@ -1,96 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {9AAD02EE-FE79-46BE-87EB-E3D2A376A043} - Library - Properties - CassiniDev - CassiniDev-lib - v3.5 - 512 - true - ..\CasssiniDev-DevKey.snk - Resources\preferences-web-browser-shortcuts.ico - - - true - bin\x86\Debug\ - DEBUG;TRACE - true - full - x86 - true - GlobalSuppressions.cs - prompt - - - bin\x86\Release\ - TRACE - true - true - pdbonly - x86 - true - GlobalSuppressions.cs - prompt - - - - - - - 3.5 - - - - - - - - - - - - - - - - - - - - - - - - Component - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/CassiniDev/CassiniDev.Lib4.csproj b/CassiniDev/CassiniDev.Lib4.csproj deleted file mode 100644 index cebce2220..000000000 --- a/CassiniDev/CassiniDev.Lib4.csproj +++ /dev/null @@ -1,148 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {070AE36D-4CE1-4708-BD0F-2896A6F117FC} - Library - Properties - CassiniDev - CassiniDev4-lib - v4.0 - 512 - false - ..\CasssiniDev-DevKey.snk - Resources\preferences-web-browser-shortcuts.ico - - - 3.5 - - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - bin\x86\Debug\ - TRACE;DEBUG;NET40 - true - full - x86 - bin\Debug\CassiniDev4.Lib\CassiniDev4-lib.dll.CodeAnalysisLog.xml - true - GlobalSuppressions.cs - prompt - AllRules.ruleset - ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets - true - ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules - true - - - bin\x86\Release\ - TRACE;NET40 - true - true - pdbonly - x86 - bin\Release\CassiniDev4.Lib\CassiniDev4-lib.dll.CodeAnalysisLog.xml - true - GlobalSuppressions.cs - prompt - AllRules.ruleset - ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets - ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules - false - false - - - - - - - 3.5 - - - - - - - - - - - - - - - - - - Code - - - Code - - - - - - - - - - - - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - Always - - - - - - - - - \ No newline at end of file diff --git a/CassiniDev/CassiniDev.VisualStudio.csproj b/CassiniDev/CassiniDev.VisualStudio.csproj deleted file mode 100644 index e3b6b11bd..000000000 --- a/CassiniDev/CassiniDev.VisualStudio.csproj +++ /dev/null @@ -1,177 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {F50EB799-6DED-4906-9DB0-B8FBE5C14028} - WinExe - Properties - CassiniDev - WebDev.WebServer - v3.5 - 512 - Resources\preferences-web-browser-shortcuts.ico - true - ..\CasssiniDev-DevKey.snk - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - bin\x86\Debug\ - TRACE;DEBUG - true - full - x86 - true - GlobalSuppressions.cs - prompt - - - bin\x86\Release\ - TRACE;GUI - true - true - pdbonly - x86 - true - GlobalSuppressions.cs - prompt - - - - - - - 3.5 - - - - - - - - - - - - - - - Component - - - Code - - - - - - - - - - - - - - - - - - - - UserControl - - - BodyView.cs - - - Form - - - FormView.cs - - - Form - - - LogView.cs - - - - - - BodyView.cs - - - FormView.cs - - - LogView.cs - - - - - False - .NET Framework Client Profile - false - - - False - .NET Framework 2.0 %28x86%29 - false - - - False - .NET Framework 3.0 %28x86%29 - false - - - False - .NET Framework 3.5 - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - - - - - - - \ No newline at end of file diff --git a/CassiniDev/CassiniDev.VisualStudio42.csproj b/CassiniDev/CassiniDev.VisualStudio42.csproj deleted file mode 100644 index d9e244ef3..000000000 --- a/CassiniDev/CassiniDev.VisualStudio42.csproj +++ /dev/null @@ -1,181 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {06764838-9B08-4254-AFA6-2B790E110DFB} - WinExe - Properties - CassiniDev - WebDev.WebServer20 - v3.5 - 512 - Resources\preferences-web-browser-shortcuts.ico - true - ..\CasssiniDev-DevKey.snk - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - bin\x86\Debug\ - TRACE;DEBUG - true - full - x86 - true - GlobalSuppressions.cs - prompt - - - bin\x86\Release\ - TRACE;GUI - true - true - pdbonly - x86 - true - GlobalSuppressions.cs - prompt - - - - - - - 3.5 - - - False - True - - - - - - False - - - - - - - - - - Component - - - Code - - - - - - - - - - - - - - - - - - - - UserControl - - - BodyView.cs - - - Form - - - FormView.cs - - - Form - - - LogView.cs - - - - - - BodyView.cs - - - FormView.cs - - - LogView.cs - - - - - False - .NET Framework Client Profile - false - - - False - .NET Framework 2.0 %28x86%29 - false - - - False - .NET Framework 3.0 %28x86%29 - false - - - False - .NET Framework 3.5 - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - - - - - - \ No newline at end of file diff --git a/CassiniDev/CassiniDev.VisualStudio44.csproj b/CassiniDev/CassiniDev.VisualStudio44.csproj deleted file mode 100644 index 07cdbb347..000000000 --- a/CassiniDev/CassiniDev.VisualStudio44.csproj +++ /dev/null @@ -1,190 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {73C76E4C-426C-45C2-9D37-1E46FA29CE66} - WinExe - Properties - CassiniDev - WebDev.WebServer40 - v4.0 - 512 - Resources\preferences-web-browser-shortcuts.ico - true - ..\CasssiniDev-DevKey.snk - - - 3.5 - - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - bin\x86\Debug\ - TRACE;DEBUG;NET40 - true - full - x86 - bin\Debug\DevServer\10.0\WebDev.WebServer40.exe.CodeAnalysisLog.xml - true - GlobalSuppressions.cs - prompt - AllRules.ruleset - ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets - true - ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules - true - - - bin\x86\Release\ - TRACE;NET40 - true - true - pdbonly - x86 - bin\Release\DevServer\10.0\WebDev.WebServer40.exe.CodeAnalysisLog.xml - true - GlobalSuppressions.cs - prompt - AllRules.ruleset - ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets - true - ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules - true - - - - - - - 3.5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - Component - - - - - - UserControl - - - BodyView.cs - - - Form - - - FormView.cs - - - Form - - - HelpView.cs - - - Form - - - LogView.cs - - - - - - BodyView.cs - - - FormView.cs - - - HelpView.cs - - - LogView.cs - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - Always - Designer - - - - - - - - - - - - - \ No newline at end of file diff --git a/CassiniDev/CassiniDev.csproj b/CassiniDev/CassiniDev.csproj deleted file mode 100644 index e7050b015..000000000 --- a/CassiniDev/CassiniDev.csproj +++ /dev/null @@ -1,200 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {0D9F0FEA-45F7-4CE4-9868-6FB9BBE3DD4C} - WinExe - Properties - CassiniDev - CassiniDev - v3.5 - 512 - Resources\preferences-web-browser-shortcuts.ico - - - - - - - - - - - true - ..\CasssiniDev-DevKey.snk - - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - bin\x86\Debug\ - TRACE;DEBUG - true - full - x86 - true - GlobalSuppressions.cs - prompt - - - bin\x86\Release\ - TRACE - true - true - pdbonly - x86 - true - GlobalSuppressions.cs - prompt - - - - - - - 3.5 - - - - - - - - - - - - Component - - - - - - - - - UserControl - - - BodyView.cs - - - - Form - - - LogView.cs - - - - - - - - - - Form - - - FormView.cs - - - - - - - - - - - - - - - - - - - - - - - BodyView.cs - - - LogView.cs - - - FormView.cs - - - Designer - - - - - False - .NET Framework Client Profile - false - - - False - .NET Framework 2.0 %28x86%29 - false - - - False - .NET Framework 3.0 %28x86%29 - false - - - False - .NET Framework 3.5 - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - - - - - - - \ No newline at end of file diff --git a/CassiniDev/CassiniDev4-lib.dll.config b/CassiniDev/CassiniDev4-lib.dll.config deleted file mode 100644 index 22ab261b3..000000000 --- a/CassiniDev/CassiniDev4-lib.dll.config +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/CassiniDev/CassiniDev4.csproj b/CassiniDev/CassiniDev4.csproj deleted file mode 100644 index d52911de2..000000000 --- a/CassiniDev/CassiniDev4.csproj +++ /dev/null @@ -1,163 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {0D9F0FEA-45F7-4CE4-9868-6FB9BBE3DD4C} - WinExe - Properties - CassiniDev - CassiniDev - v3.5 - 512 - Resources\earth_network.ico - - - - - - - - - - - true - ..\CasssiniDev-DevKey.snk - - - - - true - full - false - bin\Debug\ - TRACE;DEBUG - prompt - 4 - - - true - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - true - - - - - - 3.5 - - - - False - ..\lib\System.Data.SQLite.dll - False - - - - - - - - Form - - - HelpView.cs - - - - - - - - - UserControl - - - BodyView.cs - - - - - - Form - - - LogView.cs - - - - - - - - - - - Form - - - FormView.cs - - - - - - - - - - - - - - - - - - - - - Always - - - Always - - - - - BodyView.cs - - - HelpView.cs - - - LogView.cs - - - FormView.cs - - - Designer - - - - - - xcopy "$(TargetDir)$(TargetName).*" "$(ProjectDir)..\deploy\$(ConfigurationName)\" /S /I /F /Y <nul: - - \ No newline at end of file diff --git a/CassiniDev/CassiniDev4.exe.config b/CassiniDev/CassiniDev4.exe.config deleted file mode 100644 index 22ab261b3..000000000 --- a/CassiniDev/CassiniDev4.exe.config +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/CassiniDev/CassiniDevServerOP.cs b/CassiniDev/CassiniDevServerOP.cs deleted file mode 100644 index dda970556..000000000 --- a/CassiniDev/CassiniDevServerOP.cs +++ /dev/null @@ -1,241 +0,0 @@ -// /* ********************************************************************************** -// * -// * Copyright (c) Sky Sanders. All rights reserved. -// * -// * This source code is subject to terms and conditions of the Microsoft Public -// * License (Ms-PL). A copy of the license can be found in the license.htm file -// * included in this distribution. -// * -// * You must not remove this notice, or any other, from this software. -// * -// * **********************************************************************************/ -using System; -using System.Diagnostics; -using System.IO; -using System.Net; -using System.Threading; - -namespace CassiniDev -{ - - /// - /// Made a go at spinning the server up from this process but after dealing with - /// irratic behaviour regarding apartment state, platform concerns, unloaded app domains, - /// and all the other issues that you can find that people struggle with I just decided - /// to strictly format the console app's output and just spin up an external process. - /// Seems robust so far. - /// - public class CassiniDevServerOP - { - //private bool _disposed; - - private string _hostname; - private StreamWriter _input; - private IPAddress _ipAddress; - private Thread _outputThread; - private string _rootUrl; - private Process _serverProcess; - private const int TimeOut = 60000; - private const int WaitForPort = 5000; - - - /// - /// - public void Dispose() - { - { - if (_serverProcess != null) - { - StopServer(); - } - } - } - - - /// - /// The root URL of the running web application - /// - public string RootUrl - { - get { return _rootUrl; } - } - - /// - /// Combine the RootUrl of the running web application with the relative url specified. - /// - /// - /// - public string NormalizeUrl(string relativeUrl) - { - return CassiniNetworkUtils.NormalizeUrl(RootUrl, relativeUrl); - } - - /// - /// Will start specified application as "localhost" on loopback and first available port in the range 8000-10000 with vpath "/" - /// - /// Physical path to application. - public void StartServer(string applicationPath) - { - StartServer(applicationPath, CassiniNetworkUtils.GetAvailablePort(8000, 10000, IPAddress.Loopback, true), "/", "localhost"); - } - - /// - /// Will start specified application on loopback - /// - /// Physical path to application. - /// Port to listen on. - /// Optional. defaults to "/" - /// Optional. Is used to construct RootUrl. Defaults to "localhost" - public void StartServer(string applicationPath, int port, string virtualPath, string hostName) - { - // WebHost.Server will not run on any other IP - IPAddress ipAddress = IPAddress.Loopback; - - if (!CassiniNetworkUtils.IsPortAvailable(ipAddress, port)) - { - throw new Exception(string.Format("Port {0} is in use.", port)); - } - - applicationPath = Path.GetFullPath(applicationPath); - - virtualPath = String.Format("/{0}/", (virtualPath ?? string.Empty).Trim('/')).Replace("//", "/"); - hostName = string.IsNullOrEmpty(hostName) ? "localhost" : hostName; - - StartServer(applicationPath, ipAddress, port, virtualPath, hostName); - - - } - /// - /// - /// Physical path to application. - /// IP to listen on. - /// Port to listen on. - /// Optional. default value '/' - /// Optional. Used to construct RootUrl. Defaults to 'localhost' - public virtual void StartServer(string applicationPath, IPAddress ipAddress, int port, string virtualPath, string hostName) - { - - _hostname = hostName; - _ipAddress = ipAddress; - - // massage and validate arguments - if (string.IsNullOrEmpty(virtualPath)) - { - virtualPath = "/"; - } - if (!virtualPath.StartsWith("/")) - { - virtualPath = "/" + virtualPath; - } - if (_serverProcess != null) - { - throw new InvalidOperationException("Server is running"); - } - - - string commandLine = (new CommandLineArguments - { - Port = port, - ApplicationPath = string.Format("\"{0}\"", Path.GetFullPath(applicationPath).Trim('\"').TrimEnd('\\')), - HostName = hostName, - IPAddress = ipAddress.ToString(), - VirtualPath = string.Format("\"{0}\"", virtualPath), - TimeOut = TimeOut, - WaitForPort = WaitForPort, - IPMode = IPMode.Specific, - PortMode = PortMode.Specific - }).ToString(); - - - _serverProcess = new Process - { - StartInfo = new ProcessStartInfo - { - UseShellExecute = false, - ErrorDialog = false, - CreateNoWindow = true, - RedirectStandardOutput = true, - RedirectStandardInput = true, -#if NET40 //TODO: find out the real flag - FileName = "CassiniDev4-console.exe", -#else - FileName = "CassiniDev-console.exe", -#endif - - Arguments = commandLine, - WorkingDirectory = Environment.CurrentDirectory - } - }; - - // we are going to monitor each line of the output until we get a start or error signal - // and then just ignore the rest - - string line = null; - - _serverProcess.Start(); - - _outputThread = new Thread(() => - { - string l = _serverProcess.StandardOutput.ReadLine(); - while (l != null) - { - if (l.StartsWith("started:") || l.StartsWith("error:")) - { - line = l; - } - l = _serverProcess.StandardOutput.ReadLine(); - } - }); - _outputThread.Start(); - - // use StandardInput to send the newline to stop the server when required - _input = _serverProcess.StandardInput; - - // block until we get a signal - while (line == null) - { - Thread.Sleep(10); - } - - if (!line.StartsWith("started:")) - { - throw new Exception(string.Format("Could not start server: {0}", line)); - } - - // line is the root url - _rootUrl = line.Substring(line.IndexOf(':') + 1); - } - /// - /// Stops the server, if running. - /// - public virtual void StopServer() - { - StopServer(100); - } - - /// - /// Stops the server, if running. - /// - protected virtual void StopServer(int delay) - { - Thread.Sleep(delay); - if (_serverProcess != null) - { - try - { - _input.WriteLine(); - _serverProcess.WaitForExit(10000); - Thread.Sleep(10); - } - catch - { - } - finally - { - _serverProcess.Dispose(); - _serverProcess = null; - } - } - } - } -} diff --git a/CassiniDev/CassiniServer.cs b/CassiniDev/CassiniServer.cs deleted file mode 100644 index 956298627..000000000 --- a/CassiniDev/CassiniServer.cs +++ /dev/null @@ -1,140 +0,0 @@ -// /* ********************************************************************************** -// * -// * Copyright (c) Sky Sanders. All rights reserved. -// * -// * This source code is subject to terms and conditions of the Microsoft Public -// * License (Ms-PL). A copy of the license can be found in the license.htm file -// * included in this distribution. -// * -// * You must not remove this notice, or any other, from this software. -// * -// * **********************************************************************************/ -using System; -using System.Globalization; -using System.IO; -using System.Net; - - -namespace CassiniDev -{ - public class CassiniDevServer - { - - private Server _server; - - #region Implementation of IDisposable - - /// - /// - public void Dispose() - { - if (_server != null) - { - StopServer(); - _server.Dispose(); - _server = null; - } - } - - #endregion - - - - - - /// - /// The root URL of the running web application - /// - public string RootUrl - { - get { return string.Format(CultureInfo.InvariantCulture, "http://{0}:{1}{2}", _server.HostName, _server.Port, _server.VirtualPath); } - - } - /// - /// Combine the RootUrl of the running web application with the relative url - /// specified. - /// - /// - /// - public string NormalizeUrl(string relativeUrl) - { - return CassiniNetworkUtils.NormalizeUrl(RootUrl, relativeUrl); - } - - /// - /// Will start specified application as "localhost" on loopback and first available port in the range 8000-10000 with vpath "/" - /// - /// Physical path to application. - public void StartServer(string applicationPath) - { - StartServer(applicationPath, CassiniNetworkUtils.GetAvailablePort(8000, 10000, IPAddress.Loopback, true), "/", "localhost"); - } - - /// - /// Will start specified application on loopback - /// - /// Physical path to application. - /// Port to listen on. - /// Optional. defaults to "/" - /// Optional. Is used to construct RootUrl. Defaults to "localhost" - public void StartServer(string applicationPath, int port, string virtualPath, string hostName) - { - // WebHost.Server will not run on any other IP - IPAddress ipAddress = IPAddress.Loopback; - - if (!CassiniNetworkUtils.IsPortAvailable(ipAddress, port)) - { - throw new Exception(string.Format("Port {0} is in use.", port)); - } - - applicationPath = Path.GetFullPath(applicationPath); - - virtualPath = String.Format("/{0}/", (virtualPath ?? string.Empty).Trim('/')).Replace("//", "/"); - hostName = string.IsNullOrEmpty(hostName) ? "localhost" : hostName; - - StartServer(applicationPath, ipAddress, port, virtualPath, hostName); - - - } - - /// - /// - /// Physical path to application. - /// IP to listen on. - /// Port to listen on. - /// Optional. default value '/' - /// Optional. Used to construct RootUrl. Defaults to 'localhost' - public void StartServer(string applicationPath, IPAddress ipAddress, int port, string virtualPath, string hostname) - { - if (_server != null) - { - throw new InvalidOperationException("Server already started"); - } - _server = new Server(port, virtualPath, applicationPath, ipAddress,hostname, 60000); - - try - { - _server.Start(); - } - catch (Exception ex) - { - - throw new InvalidOperationException("Error starting server instance.", ex); - } - - } - - /// - /// Stops the server. - /// - public void StopServer() - { - if (_server != null) - { - _server.ShutDown(); - } - } - - - } -} diff --git a/CassiniDev/Configuration/CassiniDevConfigurationSection.cs b/CassiniDev/Configuration/CassiniDevConfigurationSection.cs deleted file mode 100644 index 78bfd8055..000000000 --- a/CassiniDev/Configuration/CassiniDevConfigurationSection.cs +++ /dev/null @@ -1,121 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Configuration; -using System.Linq; -using System.Net; -using System.Text; - -namespace CassiniDev.Configuration -{ - public class CassiniDevConfigurationSection : ConfigurationSection - { - [ConfigurationProperty("profiles")] - public CassiniDevProfileElementCollection Profiles - { - get - { - return (CassiniDevProfileElementCollection)this["profiles"]; - } - } - } - - [ConfigurationCollection(typeof(CassiniDevProfileElement), AddItemName = "profile", CollectionType = ConfigurationElementCollectionType.BasicMap)] - public class CassiniDevProfileElementCollection : ConfigurationElementCollection - { - protected override ConfigurationElement CreateNewElement() - { - return new CassiniDevProfileElement(); - } - - protected override object GetElementKey(ConfigurationElement element) - { - return ((CassiniDevProfileElement)element).Port; - } - } - public class CassiniDevProfileElement : ConfigurationElement - { - /// - /// Port is used as profile selector - /// - [ConfigurationProperty("port", DefaultValue = "*", IsKey = true, IsRequired = true)] - public string Port - { - get - { - return (string)this["port"]; - } - set - { - this["port"] = value; - } - } - - [ConfigurationProperty("path")] - public string Path - { - get - { - return (string)this["path"]; - } - set - { - this["path"] = value; - } - } - - - - - [ConfigurationProperty("hostName")] - public string HostName - { - get - { - return (string)this["hostName"]; - } - set - { - this["hostName"] = value; - } - } - - [ConfigurationProperty("ip")] - public string IpAddress - { - get - { - return (string)this["ip"]; - } - set - { - this["ip"] = value; - } - } - - [ConfigurationProperty("ipMode", DefaultValue = CassiniDev.IPMode.Loopback)] - public IPMode IpMode - { - get - { - return (IPMode)this["ipMode"]; - } - set - { - this["ipMode"] = value; - } - } - - [ConfigurationProperty("v6", DefaultValue = false)] - public bool IpV6 - { - get - { - return (bool)this["v6"]; - } - set - { - this["v6"] = value; - } - } - } -} diff --git a/CassiniDev/ConsoleProgram.cs b/CassiniDev/ConsoleProgram.cs deleted file mode 100644 index 94e6a3adb..000000000 --- a/CassiniDev/ConsoleProgram.cs +++ /dev/null @@ -1,156 +0,0 @@ -// /* ********************************************************************************** -// * -// * Copyright (c) Sky Sanders. All rights reserved. -// * -// * This source code is subject to terms and conditions of the Microsoft Public -// * License (Ms-PL). A copy of the license can be found in the license.htm file -// * included in this distribution. -// * -// * You must not remove this notice, or any other, from this software. -// * -// * **********************************************************************************/ -using System; -using System.Collections; -using System.Configuration.Install; -using System.Net; - - - - -namespace CassiniDev -{ - public class Program - { - [STAThread] - private static void Main(string[] cmdLine) - { - CommandLineArguments args = new CommandLineArguments(); - - - if (!CommandLineParser.ParseArgumentsWithUsage(cmdLine, args)) - { - Environment.Exit(-1); - } - else - { - switch (args.RunMode) - { - case RunMode.Server: - IPAddress ip=IPAddress.Loopback; - try - { - args.Validate(); - - ip = CommandLineArguments.ParseIP(args.IPMode, args.IPv6, args.IPAddress); - int port = args.PortMode == PortMode.FirstAvailable ? - CassiniNetworkUtils.GetAvailablePort(args.PortRangeStart, args.PortRangeEnd, ip, true) : - args.Port; - - if(args.AddHost) - { - HostsFile.AddHostEntry(ip.ToString(), args.HostName); - } - - using (var server = - new Server(port, args.VirtualPath, args.ApplicationPath, - ip, args.HostName, args.TimeOut)) - { - server.Start(); - Console.WriteLine("started: {0}\r\nPress Enter key to exit....", server.RootUrl); - Console.ReadLine(); - server.ShutDown(); - } - } - catch (CassiniException ex) - { - Console.WriteLine("error:{0} {1}", - ex.Field == ErrorField.None - ? ex.GetType().Name - : ex.Field.ToString(), ex.Message); - } - catch (Exception ex2) - { - Console.WriteLine("error:{0}", ex2.Message); - Console.WriteLine(CommandLineParser.ArgumentsUsage(typeof(CommandLineArguments))); - } - finally - { - if (args.AddHost) - { - HostsFile.RemoveHostEntry(ip.ToString(), args.HostName); - } - - } - break; - case RunMode.Hostsfile: - SetHostsFile(args); - break; - } - } - } - - private static void SetHostsFile(CommandLineArguments sargs) - { - try - { - if (sargs.AddHost) - { - HostsFile.AddHostEntry(sargs.IPAddress, sargs.HostName); - } - else - { - HostsFile.RemoveHostEntry(sargs.IPAddress, sargs.HostName); - } - } - catch (UnauthorizedAccessException) - { - Environment.Exit(-1); - } - catch - { - Environment.Exit(-2); - } - } - } - - public sealed class ServiceUtil - { - static void Install(bool undo, string[] args) - { - try - { - Console.WriteLine(undo ? "uninstalling" : "installing"); - using (AssemblyInstaller inst = new AssemblyInstaller(typeof(Program).Assembly, args)) - { - IDictionary state = new Hashtable(); - inst.UseNewContext = true; - try - { - if (undo) - { - inst.Uninstall(state); - } - else - { - inst.Install(state); - inst.Commit(state); - } - } - catch - { - try - { - inst.Rollback(state); - } - catch { } - throw; - } - } - } - catch (Exception ex) - { - Console.Error.WriteLine(ex.Message); - } - } - } -} \ No newline at end of file diff --git a/CassiniDev/Core/Connection.cs b/CassiniDev/Core/Connection.cs deleted file mode 100644 index c04731fd0..000000000 --- a/CassiniDev/Core/Connection.cs +++ /dev/null @@ -1,410 +0,0 @@ -// ********************************************************************************** -// CassiniDev - http://cassinidev.codeplex.com -// -// Copyright (c) 2010 Sky Sanders. All rights reserved. -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// This source code is subject to terms and conditions of the Microsoft Public -// License (Ms-PL). A copy of the license can be found in the license.txt file -// included in this distribution. -// -// You must not remove this notice, or any other, from this software. -// -// ********************************************************************************** - -#region - -using System; -using System.Globalization; -using System.IO; -using System.Net; -using System.Net.Sockets; -using System.Text; -using System.Web; -using CassiniDev.ServerLog; - -#endregion - -namespace CassiniDev -{ - public class Connection : MarshalByRefObject - { - private const int HttpForbidden = 403; - - private const int HttpOK = 200; - - private readonly MemoryStream _responseContent; - - private readonly Server _server; - private LogInfo _requestLog; - private LogInfo _responseLog; - - private Socket _socket; - - internal Connection(Server server, Socket socket) - { - Id = Guid.NewGuid(); - _responseContent = new MemoryStream(); - _server = server; - _socket = socket; - InitializeLogInfo(); - } - - public bool Connected - { - get { return _socket.Connected; } - } - - public Guid Id { get; private set; } - - public string LocalIP - { - get - { - IPEndPoint ep = (IPEndPoint) _socket.LocalEndPoint; - return (ep != null && ep.Address != null) ? ep.Address.ToString() : "127.0.0.1"; - } - } - - public string RemoteIP - { - get - { - IPEndPoint ep = (IPEndPoint) _socket.RemoteEndPoint; - return (ep != null && ep.Address != null) ? ep.Address.ToString() : "127.0.0.1"; - } - } - - public LogInfo RequestLog - { - get { return _requestLog; } - } - - public LogInfo ResponseLog - { - get { return _responseLog; } - } - - public void Close() - { - FinalizeLogInfo(); - - try - { - _socket.Shutdown(SocketShutdown.Both); - _socket.Close(); - } - // ReSharper disable EmptyGeneralCatchClause - catch - // ReSharper restore EmptyGeneralCatchClause - { - } - finally - { - _socket = null; - } - } - - /// - /// - public override object InitializeLifetimeService() - { - return null; - } - - public void LogRequest(string pathTranslated, string url) - { - _requestLog.PathTranslated = pathTranslated; - - _requestLog.Url = url; - } - - public void LogRequestBody(byte[] content) - { - _requestLog.Body = content; - } - - public void LogRequestHeaders(string headers) - { - _requestLog.Headers = headers; - } - - public byte[] ReadRequestBytes(int maxBytes) - { - try - { - if (WaitForRequestBytes() == 0) - { - return null; - } - - int numBytes = _socket.Available; - - if (numBytes > maxBytes) - { - numBytes = maxBytes; - } - - int numReceived = 0; - - byte[] buffer = new byte[numBytes]; - - if (numBytes > 0) - { - numReceived = _socket.Receive(buffer, 0, numBytes, SocketFlags.None); - } - - if (numReceived < numBytes) - { - byte[] tempBuffer = new byte[numReceived]; - - if (numReceived > 0) - { - Buffer.BlockCopy(buffer, 0, tempBuffer, 0, numReceived); - } - - buffer = tempBuffer; - } - - return buffer; - } - catch - { - return null; - } - } - - public int WaitForRequestBytes() - { - int availBytes = 0; - - try - { - if (_socket.Available == 0) - { - _socket.Poll(100000, SelectMode.SelectRead); - - if (_socket.Available == 0 && _socket.Connected) - { - _socket.Poll(30000000, SelectMode.SelectRead); - } - } - - availBytes = _socket.Available; - } - // ReSharper disable EmptyGeneralCatchClause - catch - // ReSharper restore EmptyGeneralCatchClause - { - } - - return availBytes; - } - - public void Write100Continue() - { - WriteEntireResponseFromString(100, null, null, true); - } - - public void WriteBody(byte[] data, int offset, int length) - { - try - { - _responseContent.Write(data, 0, data.Length); - _socket.Send(data, offset, length, SocketFlags.None); - } - catch (SocketException) - { - } - } - - public void WriteEntireResponseFromFile(String fileName, bool keepAlive) - { - if (!File.Exists(fileName)) - { - WriteErrorAndClose(404); - return; - } - - // Deny the request if the contentType cannot be recognized. - - string contentType = Common.GetContentType(fileName); - - //TODO: i am pretty sure this is unnecessary - if (contentType == null) - { - WriteErrorAndClose(HttpForbidden); - return; - } - - string contentTypeHeader = "Content-Type: " + contentType + "\r\n"; - - bool completed = false; - FileStream fs = null; - - try - { - fs = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); - int len = (int) fs.Length; - byte[] fileBytes = new byte[len]; - int bytesRead = fs.Read(fileBytes, 0, len); - - String headers = MakeResponseHeaders(HttpOK, contentTypeHeader, bytesRead, keepAlive); - _responseLog.Headers = headers; - _responseLog.StatusCode = HttpOK; - _socket.Send(Encoding.UTF8.GetBytes(headers)); - - _socket.Send(fileBytes, 0, bytesRead, SocketFlags.None); - - completed = true; - } - catch (SocketException) - { - } - finally - { - if (!keepAlive || !completed) - { - Close(); - } - - if (fs != null) - { - fs.Close(); - } - } - } - - public void WriteEntireResponseFromString(int statusCode, String extraHeaders, String body, bool keepAlive) - { - try - { - int bodyLength = (body != null) ? Encoding.UTF8.GetByteCount(body) : 0; - string headers = MakeResponseHeaders(statusCode, extraHeaders, bodyLength, keepAlive); - - _responseLog.Headers = headers; - _responseLog.StatusCode = statusCode; - _socket.Send(Encoding.UTF8.GetBytes(headers + body)); - } - catch (SocketException) - { - } - finally - { - if (!keepAlive) - { - Close(); - } - } - } - - public void WriteErrorAndClose(int statusCode, string message) - { - WriteEntireResponseFromString(statusCode, null, GetErrorResponseBody(statusCode, message), false); - } - - public void WriteErrorAndClose(int statusCode) - { - WriteErrorAndClose(statusCode, null); - } - - public void WriteErrorWithExtraHeadersAndKeepAlive(int statusCode, string extraHeaders) - { - WriteEntireResponseFromString(statusCode, extraHeaders, GetErrorResponseBody(statusCode, null), true); - } - - public void WriteHeaders(int statusCode, String extraHeaders) - { - string headers = MakeResponseHeaders(statusCode, extraHeaders, -1, false); - - _responseLog.Headers = headers; - _responseLog.StatusCode = statusCode; - - try - { - _socket.Send(Encoding.UTF8.GetBytes(headers)); - } - catch (SocketException) - { - } - } - - private void FinalizeLogInfo() - { - try - { - _responseLog.Body = _responseContent.ToArray(); - _responseContent.Dispose(); - _responseLog.Created = DateTime.Now; - _responseLog.Url = _requestLog.Url; - _responseLog.PathTranslated = _requestLog.PathTranslated; - _responseLog.Identity = _requestLog.Identity; - _responseLog.PhysicalPath = _requestLog.PhysicalPath; - } - // ReSharper disable EmptyGeneralCatchClause - catch - // ReSharper restore EmptyGeneralCatchClause - { - // log error to text - } - } - - private string GetErrorResponseBody(int statusCode, string message) - { - string body = Messages.FormatErrorMessageBody(statusCode, _server.VirtualPath); - - if (!string.IsNullOrEmpty(message)) - { - body += "\r\n"; - } - - return body; - } - - private void InitializeLogInfo() - { - _requestLog = new LogInfo - { - Created = DateTime.Now, - ConversationId = Id, - RowType = 1, - Identity = _server.GetProcessUser(), - PhysicalPath = _server.PhysicalPath - }; - - _responseLog = new LogInfo - { - ConversationId = Id, - RowType = 2 - }; - } - - private static string MakeResponseHeaders(int statusCode, string moreHeaders, int contentLength, bool keepAlive) - { - StringBuilder sb = new StringBuilder(); - - sb.Append("HTTP/1.1 " + statusCode + " " + HttpWorkerRequest.GetStatusDescription(statusCode) + "\r\n"); - sb.Append("Server: Cassini/" + Messages.VersionString + "\r\n"); - sb.Append("Date: " + DateTime.Now.ToUniversalTime().ToString("R", DateTimeFormatInfo.InvariantInfo) + "\r\n"); - - if (contentLength >= 0) - { - sb.Append("Content-Length: " + contentLength + "\r\n"); - } - - if (moreHeaders != null) - { - sb.Append(moreHeaders); - } - - if (!keepAlive) - { - sb.Append("Connection: Close\r\n"); - } - - sb.Append("\r\n"); - - return sb.ToString(); - } - } -} \ No newline at end of file diff --git a/CassiniDev/Core/Host.cs b/CassiniDev/Core/Host.cs deleted file mode 100644 index 46569f6e0..000000000 --- a/CassiniDev/Core/Host.cs +++ /dev/null @@ -1,296 +0,0 @@ -// ********************************************************************************** -// CassiniDev - http://cassinidev.codeplex.com -// -// Copyright (c) 2010 Sky Sanders. All rights reserved. -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// This source code is subject to terms and conditions of the Microsoft Public -// License (Ms-PL). A copy of the license can be found in the license.txt file -// included in this distribution. -// -// You must not remove this notice, or any other, from this software. -// -// ********************************************************************************** - -#region - -using System; -using System.Globalization; -using System.Security.Permissions; -using System.Security.Principal; -using System.Threading; -using System.Web; -using System.Web.Hosting; - -#endregion - -namespace CassiniDev -{ - /// - /// 01/01/10 sky: added HttpRuntime.Close to IRegisteredObject.Stop to eliminate - /// System.AppDomainUnloadedException when running tests in NUnit GuiRunner. - /// reference: http://stackoverflow.com/questions/561402/cassini-webserver-webdev-nunit-and-appdomainunloadedexception - /// need to test thoroughly but seems to work just fine with no ill effects - /// 01.03.10 sky: removed the HttpRuntime.Close because, even though it tests fine, I am not entirely certain it is in the right place - /// and since I am no longer recommending that the server be used as a library in testing (run a console instance in a new process). - /// - /// - internal class Host : MarshalByRefObject, IRegisteredObject - { - private bool _disableDirectoryListing; - - private string _installPath; - - private string _lowerCasedClientScriptPathWithTrailingSlash; - - private string _lowerCasedVirtualPath; - - private string _lowerCasedVirtualPathWithTrailingSlash; - - private volatile int _pendingCallsCount; - - private string _physicalClientScriptPath; - - private string _physicalPath; - - private int _port; - - private bool _requireAuthentication; - - private Server _server; - - private string _virtualPath; - - public Host() - { - HostingEnvironment.RegisterObject(this); - } - - public bool DisableDirectoryListing - { - get { return _disableDirectoryListing; } - } - - public string InstallPath - { - get { return _installPath; } - } - - public string NormalizedClientScriptPath - { - get { return _lowerCasedClientScriptPathWithTrailingSlash; } - } - - public string NormalizedVirtualPath - { - get { return _lowerCasedVirtualPathWithTrailingSlash; } - } - - public string PhysicalClientScriptPath - { - get { return _physicalClientScriptPath; } - } - - public string PhysicalPath - { - get { return _physicalPath; } - } - - public int Port - { - get { return _port; } - } - - public bool RequireAuthentication - { - get { return _requireAuthentication; } - } - - public string VirtualPath - { - get { return _virtualPath; } - } - - #region IRegisteredObject Members - - void IRegisteredObject.Stop(bool immediate) - { - // Unhook the Host so Server will process the requests in the new appdomain. - - if (_server != null) - { - _server.HostStopped(); - } - - // Make sure all the pending calls complete before this Object is unregistered. - WaitForPendingCallsToFinish(); - - HostingEnvironment.UnregisterObject(this); - } - - #endregion - - public void Configure(Server server, int port, string virtualPath, string physicalPath, - bool requireAuthentication) - { - Configure(server, port, virtualPath, physicalPath, requireAuthentication, false); - } - - public void Configure(Server server, int port, string virtualPath, string physicalPath) - { - Configure(server, port, virtualPath, physicalPath, false, false); - } - - public void Configure(Server server, int port, string virtualPath, string physicalPath, - bool requireAuthentication, bool disableDirectoryListing) - { - _server = server; - - _port = port; - _installPath = null; - _virtualPath = virtualPath; - _requireAuthentication = requireAuthentication; - _disableDirectoryListing = disableDirectoryListing; - _lowerCasedVirtualPath = CultureInfo.InvariantCulture.TextInfo.ToLower(_virtualPath); - _lowerCasedVirtualPathWithTrailingSlash = virtualPath.EndsWith("/", StringComparison.Ordinal) - ? virtualPath - : virtualPath + "/"; - _lowerCasedVirtualPathWithTrailingSlash = - CultureInfo.InvariantCulture.TextInfo.ToLower(_lowerCasedVirtualPathWithTrailingSlash); - _physicalPath = physicalPath; - _physicalClientScriptPath = HttpRuntime.AspClientScriptPhysicalPath + "\\"; - _lowerCasedClientScriptPathWithTrailingSlash = - CultureInfo.InvariantCulture.TextInfo.ToLower(HttpRuntime.AspClientScriptVirtualPath + "/"); - } - - public SecurityIdentifier GetProcessSid() - { - using (WindowsIdentity identity = new WindowsIdentity(_server.GetProcessToken())) - { - return identity.User; - } - } - - public IntPtr GetProcessToken() - { - new SecurityPermission(PermissionState.Unrestricted).Assert(); - return _server.GetProcessToken(); - } - - public string GetProcessUser() - { - return _server.GetProcessUser(); - } - - public override object InitializeLifetimeService() - { - // never expire the license - return null; - } - - public bool IsVirtualPathAppPath(string path) - { - if (path == null) - { - return false; - } - path = CultureInfo.InvariantCulture.TextInfo.ToLower(path); - return (path == _lowerCasedVirtualPath || path == _lowerCasedVirtualPathWithTrailingSlash); - } - - public bool IsVirtualPathInApp(string path, out bool isClientScriptPath) - { - isClientScriptPath = false; - - if (path == null) - { - return false; - } - - if (_virtualPath == "/" && path.StartsWith("/", StringComparison.Ordinal)) - { - if (path.StartsWith(_lowerCasedClientScriptPathWithTrailingSlash, StringComparison.Ordinal)) - { - isClientScriptPath = true; - } - return true; - } - - path = CultureInfo.InvariantCulture.TextInfo.ToLower(path); - - if (path.StartsWith(_lowerCasedVirtualPathWithTrailingSlash, StringComparison.Ordinal)) - { - return true; - } - - if (path == _lowerCasedVirtualPath) - { - return true; - } - - if (path.StartsWith(_lowerCasedClientScriptPathWithTrailingSlash, StringComparison.Ordinal)) - { - isClientScriptPath = true; - return true; - } - - return false; - } - - public bool IsVirtualPathInApp(String path) - { - bool isClientScriptPath; - return IsVirtualPathInApp(path, out isClientScriptPath); - } - - public void ProcessRequest(Connection conn) - { - // Add a pending call to make sure our thread doesn't get killed - AddPendingCall(); - - try - { - new Request(_server, this, conn).Process(); - } - finally - { - RemovePendingCall(); - } - } - - [SecurityPermission(SecurityAction.Assert, Unrestricted = true)] - public void Shutdown() - { - HostingEnvironment.InitiateShutdown(); - } - - private void AddPendingCall() - { - //TODO: investigate this issue - ref var not volitile -#pragma warning disable 0420 - Interlocked.Increment(ref _pendingCallsCount); -#pragma warning restore 0420 - } - - private void RemovePendingCall() - { - //TODO: investigate this issue - ref var not volitile -#pragma warning disable 0420 - Interlocked.Decrement(ref _pendingCallsCount); -#pragma warning restore 0420 - } - - private void WaitForPendingCallsToFinish() - { - for (;;) - { - if (_pendingCallsCount <= 0) - { - break; - } - - Thread.Sleep(250); - } - } - } -} \ No newline at end of file diff --git a/CassiniDev/Core/Messages.cs b/CassiniDev/Core/Messages.cs deleted file mode 100644 index 42b15887c..000000000 --- a/CassiniDev/Core/Messages.cs +++ /dev/null @@ -1,164 +0,0 @@ -// ********************************************************************************** -// CassiniDev - http://cassinidev.codeplex.com -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// This source code is subject to terms and conditions of the Microsoft Public -// License (Ms-PL). A copy of the license can be found in the license.txt file -// included in this distribution. -// -// You must not remove this notice, or any other, from this software. -// -// ********************************************************************************** - -#region - -using System.IO; -using System.Text; -using System.Web; - -#endregion - -namespace CassiniDev -{ - /// - /// TODO: get this into resources - /// - internal static class Messages - { - private const string _dirListingDirFormat = - @"{0,38:dddd, MMMM dd, yyyy hh:mm tt} <dir> {2} -"; - - private const string _dirListingFileFormat = - @"{0,38:dddd, MMMM dd, yyyy hh:mm tt} {1,12:n0} {3} -"; - - private const string _dirListingFormat1 = - @" - - Directory Listing -- {0} -"; - - private const string _dirListingFormat2 = - @" - - -

Directory Listing -- {0}

- -
- -
-";
-
-        private const string _dirListingParentFormat =
-            @"[To Parent Directory]
-
-";
-
-        private const string _httpErrorFormat1 =
-            @"
-    
-        {0}
-";
-
-        private const string _httpStyle =
-            @"        
-";
-
-        private static readonly string _dirListingTail =
-            @"
-
- - Version Information: Cassini Web Server " + - VersionString + @" - - - - - -"; - - private static readonly string _httpErrorFormat2 = - @" - - -

Server Error in '{0}' Application.

- -

HTTP Error {1} - {2}.

- -
- - Version Information: Cassini Web Server " + - VersionString + @" - - - - - -"; - - public static string VersionString = typeof (Server).Assembly.GetName().Version.ToString(); - - public static string FormatDirectoryListing(string dirPath, string parentPath, FileSystemInfo[] elements) - { - StringBuilder sb = new StringBuilder(); - - sb.Append(string.Format(_dirListingFormat1, dirPath)); - sb.Append(_httpStyle); - sb.Append(string.Format(_dirListingFormat2, dirPath)); - - if (parentPath != null) - { - if (!parentPath.EndsWith("/")) - { - parentPath += "/"; - } - - sb.Append(string.Format(_dirListingParentFormat, parentPath)); - } - - if (elements != null) - { - for (int i = 0; i < elements.Length; i++) - { - if (elements[i] is FileInfo) - { - FileInfo fi = (FileInfo) elements[i]; - sb.Append(string.Format(_dirListingFileFormat, - fi.LastWriteTime, fi.Length, fi.Name, fi.Name)); - } - else if (elements[i] is DirectoryInfo) - { - DirectoryInfo di = (DirectoryInfo) elements[i]; - sb.Append(string.Format(_dirListingDirFormat, - di.LastWriteTime, di.Name, di.Name)); - } - } - } - - sb.Append(_dirListingTail); - return sb.ToString(); - } - - public static string FormatErrorMessageBody(int statusCode, string appName) - { - string desc = HttpWorkerRequest.GetStatusDescription(statusCode); - - return string.Format(_httpErrorFormat1, desc) - + _httpStyle - + string.Format(_httpErrorFormat2, appName, statusCode, desc); - } - } -} \ No newline at end of file diff --git a/CassiniDev/Core/NtlmAuth.cs b/CassiniDev/Core/NtlmAuth.cs deleted file mode 100644 index 40ab7df51..000000000 --- a/CassiniDev/Core/NtlmAuth.cs +++ /dev/null @@ -1,179 +0,0 @@ -// ********************************************************************************** -// CassiniDev - http://cassinidev.codeplex.com -// -// Copyright (c) 2010 Sky Sanders. All rights reserved. -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// This source code is subject to terms and conditions of the Microsoft Public -// License (Ms-PL). A copy of the license can be found in the license.txt file -// included in this distribution. -// -// You must not remove this notice, or any other, from this software. -// -// ********************************************************************************** - -#region - -using System; -using System.Security; -using System.Security.Principal; - -#endregion - -namespace CassiniDev -{ - [SuppressUnmanagedCodeSecurity] - internal sealed class NtlmAuth : IDisposable - { - private readonly bool _credentialsHandleAcquired; - - private string _blob; - - private bool _completed; - - private Interop.SecHandle _credentialsHandle; - - private Interop.SecBuffer _inputBuffer; - private Interop.SecBufferDesc _inputBufferDesc; - - private Interop.SecBuffer _outputBuffer; - - private Interop.SecBufferDesc _outputBufferDesc; - - private Interop.SecHandle _securityContext; - - private bool _securityContextAcquired; - - private uint _securityContextAttributes; - - private SecurityIdentifier _sid; - - private long _timestamp; - - public NtlmAuth() - { - if ( - Interop.AcquireCredentialsHandle(null, "NTLM", 1, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, - ref _credentialsHandle, ref _timestamp) != 0) - { - throw new InvalidOperationException(); - } - _credentialsHandleAcquired = true; - } - - public string Blob - { - get { return _blob; } - } - - public bool Completed - { - get { return _completed; } - } - - public SecurityIdentifier SID - { - get { return _sid; } - } - - #region IDisposable Members - - void IDisposable.Dispose() - { - FreeUnmanagedResources(); - GC.SuppressFinalize(this); - } - - #endregion - - public unsafe bool Authenticate(string blobString) - { - _blob = null; - byte[] buffer = Convert.FromBase64String(blobString); - byte[] inArray = new byte[0x4000]; - fixed (void* ptrRef = &_securityContext) - { - fixed (void* ptrRef2 = &_inputBuffer) - { - fixed (void* ptrRef3 = &_outputBuffer) - { - fixed (void* ptrRef4 = buffer) - { - fixed (void* ptrRef5 = inArray) - { - IntPtr zero = IntPtr.Zero; - if (_securityContextAcquired) - { - zero = (IntPtr) ptrRef; - } - _inputBufferDesc.ulVersion = 0; - _inputBufferDesc.cBuffers = 1; - _inputBufferDesc.pBuffers = (IntPtr) ptrRef2; - _inputBuffer.cbBuffer = (uint) buffer.Length; - _inputBuffer.BufferType = 2; - _inputBuffer.pvBuffer = (IntPtr) ptrRef4; - _outputBufferDesc.ulVersion = 0; - _outputBufferDesc.cBuffers = 1; - _outputBufferDesc.pBuffers = (IntPtr) ptrRef3; - _outputBuffer.cbBuffer = (uint) inArray.Length; - _outputBuffer.BufferType = 2; - _outputBuffer.pvBuffer = (IntPtr) ptrRef5; - int num = Interop.AcceptSecurityContext(ref _credentialsHandle, zero, - ref _inputBufferDesc, 20, - 0, ref _securityContext, ref _outputBufferDesc, - ref _securityContextAttributes, ref _timestamp); - if (num == 0x90312) - { - _securityContextAcquired = true; - _blob = Convert.ToBase64String(inArray, 0, (int) _outputBuffer.cbBuffer); - } - else - { - if (num != 0) - { - return false; - } - IntPtr phToken = IntPtr.Zero; - if (Interop.QuerySecurityContextToken(ref _securityContext, ref phToken) != 0) - { - return false; - } - try - { - using (WindowsIdentity identity = new WindowsIdentity(phToken)) - { - _sid = identity.User; - } - } - finally - { - Interop.CloseHandle(phToken); - } - _completed = true; - } - } - } - } - } - } - return true; - } - - ~NtlmAuth() - { - FreeUnmanagedResources(); - } - - private void FreeUnmanagedResources() - { - if (_securityContextAcquired) - { - Interop.DeleteSecurityContext(ref _securityContext); - } - if (_credentialsHandleAcquired) - { - Interop.FreeCredentialsHandle(ref _credentialsHandle); - } - } - } -} \ No newline at end of file diff --git a/CassiniDev/Core/Request.cs b/CassiniDev/Core/Request.cs deleted file mode 100644 index 50f5c06d7..000000000 --- a/CassiniDev/Core/Request.cs +++ /dev/null @@ -1,1405 +0,0 @@ -// ********************************************************************************** -// CassiniDev - http://cassinidev.codeplex.com -// -// Copyright (c) 2010 Sky Sanders. All rights reserved. -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// This source code is subject to terms and conditions of the Microsoft Public -// License (Ms-PL). A copy of the license can be found in the license.txt file -// included in this distribution. -// -// You must not remove this notice, or any other, from this software. -// -// ********************************************************************************** - -#region - -using System; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Security; -using System.Security.Permissions; -using System.Text; -using System.Web; -using System.Web.Hosting; -using Microsoft.Win32.SafeHandles; - -#endregion - -namespace CassiniDev -{ - internal class Request : SimpleWorkerRequest - { - private const int MaxChunkLength = 64 * 1024; - - private const int MaxHeaderBytes = 32 * 1024; - - private static readonly char[] BadPathChars = new[] { '%', '>', '<', ':', '\\' }; - - private static readonly string[] DefaultFileNames = new[] { "default.aspx", "default.htm", "default.html" }; - - private static readonly char[] IntToHex = new[] - { - '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' - }; - - private static readonly string[] RestrictedDirs = new[] - { - "/bin", - "/app_browsers", - "/app_code", - "/app_data", - "/app_localresources", - "/app_globalresources", - "/app_webreferences" - }; - - private readonly IStackWalk _connectionPermission = new PermissionSet(PermissionState.Unrestricted); - private readonly Host _host; - private readonly Server _server; - - private string _allRawHeaders; - - private byte[] _body; - - private int _bodyLength; - - private Connection _connection; - - private int _contentLength; - - // security permission to Assert remoting calls to _connection - private int _endHeadersOffset; - - private string _filePath; - - private byte[] _headerBytes; - - private List _headerByteStrings; - - private bool _headersSent; - - // parsed request data - - private bool _isClientScriptPath; - - private string[] _knownRequestHeaders; - - private string _path; - - private string _pathInfo; - - private string _pathTranslated; - - private string _protocol; - - private string _queryString; - private byte[] _queryStringBytes; - - private List _responseBodyBytes; - - private StringBuilder _responseHeadersBuilder; - - private int _responseStatus; - - private bool _specialCaseStaticFileHeaders; - - private int _startHeadersOffset; - - private string[][] _unknownRequestHeaders; - - private string _url; - - private string _verb; - - public Request(Server server, Host host, Connection connection) - : base(String.Empty, String.Empty, null) - { - _connectionPermission = new PermissionSet(PermissionState.Unrestricted); - _server = server; - _host = host; - _connection = connection; - } - - public override void CloseConnection() - { - _connectionPermission.Assert(); - _connection.Close(); - } - - public override void EndOfRequest() - { - Connection conn = _connection; - if (conn != null) - { - _connection = null; - _server.OnRequestEnd(conn); - } - } - - public override void FlushResponse(bool finalFlush) - { - if (_responseStatus == 404 && !_headersSent && finalFlush && _verb == "GET") - { - // attempt directory listing - if (ProcessDirectoryListingRequest()) - { - return; - } - } - - _connectionPermission.Assert(); - - if (!_headersSent) - { - _connection.WriteHeaders(_responseStatus, _responseHeadersBuilder.ToString()); - - _headersSent = true; - } - for (int i = 0; i < _responseBodyBytes.Count; i++) - { - byte[] bytes = _responseBodyBytes[i]; - _connection.WriteBody(bytes, 0, bytes.Length); - } - - _responseBodyBytes = new List(); - - if (finalFlush) - { - _connection.Close(); - } - } - - public override string GetAppPath() - { - return _host.VirtualPath; - } - - public override string GetAppPathTranslated() - { - return _host.PhysicalPath; - } - - public override string GetFilePath() - { - return _filePath; - } - - public override string GetFilePathTranslated() - { - return _pathTranslated; - } - - public override string GetHttpVerbName() - { - return _verb; - } - - public override string GetHttpVersion() - { - return _protocol; - } - - public override string GetKnownRequestHeader(int index) - { - return _knownRequestHeaders[index]; - } - - public override string GetLocalAddress() - { - _connectionPermission.Assert(); - return _connection.LocalIP; - } - - public override int GetLocalPort() - { - return _host.Port; - } - - public override string GetPathInfo() - { - return _pathInfo; - } - - public override byte[] GetPreloadedEntityBody() - { - return _body; - } - - public override string GetQueryString() - { - return _queryString; - } - - public override byte[] GetQueryStringRawBytes() - { - return _queryStringBytes; - } - - public override string GetRawUrl() - { - return _url; - } - - public override string GetRemoteAddress() - { - _connectionPermission.Assert(); - return _connection.RemoteIP; - } - - public override int GetRemotePort() - { - return 0; - } - - public override string GetServerName() - { - string localAddress = GetLocalAddress(); - if (localAddress.Equals("127.0.0.1")) - { - return "localhost"; - } - return localAddress; - } - - public override string GetServerVariable(string name) - { - string processUser = string.Empty; - string str2 = name; - if (str2 == null) - { - return processUser; - } - if (!(str2 == "ALL_RAW")) - { - if (str2 != "SERVER_PROTOCOL") - { - if (str2 == "LOGON_USER") - { - if (GetUserToken() != IntPtr.Zero) - { - processUser = _host.GetProcessUser(); - } - return processUser; - } - if ((str2 == "AUTH_TYPE") && (GetUserToken() != IntPtr.Zero)) - { - processUser = "NTLM"; - } - return processUser; - } - } - else - { - return _allRawHeaders; - } - return _protocol; - } - - public override string GetUnknownRequestHeader(string name) - { - int n = _unknownRequestHeaders.Length; - - for (int i = 0; i < n; i++) - { - if (string.Compare(name, _unknownRequestHeaders[i][0], StringComparison.OrdinalIgnoreCase) == 0) - { - return _unknownRequestHeaders[i][1]; - } - } - - return null; - } - - public override string[][] GetUnknownRequestHeaders() - { - return _unknownRequestHeaders; - } - - /////////////////////////////////////////////////////////////////////////////////////////////// - // Implementation of HttpWorkerRequest - - public override string GetUriPath() - { - return _path; - } - - public override IntPtr GetUserToken() - { - return _host.GetProcessToken(); - } - - public override bool HeadersSent() - { - return _headersSent; - } - - public override bool IsClientConnected() - { - _connectionPermission.Assert(); - return _connection.Connected; - } - - public override bool IsEntireEntityBodyIsPreloaded() - { - return (_contentLength == _bodyLength); - } - - public override string MapPath(string path) - { - string mappedPath; - bool isClientScriptPath; - - if (string.IsNullOrEmpty(path) || path.Equals("/")) - { - // asking for the site root - mappedPath = _host.VirtualPath == "/" ? _host.PhysicalPath : Environment.SystemDirectory; - } - else if (_host.IsVirtualPathAppPath(path)) - { - // application path - mappedPath = _host.PhysicalPath; - } - else if (_host.IsVirtualPathInApp(path, out isClientScriptPath)) - { - if (isClientScriptPath) - { - mappedPath = _host.PhysicalClientScriptPath + - path.Substring(_host.NormalizedClientScriptPath.Length); - } - else - { - // inside app but not the app path itself - mappedPath = _host.PhysicalPath + path.Substring(_host.NormalizedVirtualPath.Length); - } - } - else - { - // outside of app -- make relative to app path - if (path.StartsWith("/", StringComparison.Ordinal)) - { - mappedPath = _host.PhysicalPath + path.Substring(1); - } - else - { - mappedPath = _host.PhysicalPath + path; - } - } - - mappedPath = mappedPath.Replace('/', '\\'); - - if (mappedPath.EndsWith("\\", StringComparison.Ordinal) && - !mappedPath.EndsWith(":\\", StringComparison.Ordinal)) - { - mappedPath = mappedPath.Substring(0, mappedPath.Length - 1); - } - - return mappedPath; - } - - [AspNetHostingPermission(SecurityAction.Assert, Level = AspNetHostingPermissionLevel.Medium)] - public void Process() - { - // read the request - if (!TryParseRequest()) - { - return; - } - - // 100 response to POST - if (_verb == "POST" && _contentLength > 0 && _bodyLength < _contentLength) - { - _connection.Write100Continue(); - } - if (!_host.RequireAuthentication || TryNtlmAuthenticate()) - { - // special case for client script - if (_isClientScriptPath) - { - _connection.WriteEntireResponseFromFile( - _host.PhysicalClientScriptPath + _path.Substring(_host.NormalizedClientScriptPath.Length), false); - return; - } - - // deny access to code, bin, etc. - if (IsRequestForRestrictedDirectory()) - { - _connection.WriteErrorAndClose(403); - return; - } - - // special case for a request to a directory (ensure / at the end and process default documents) - if (ProcessDirectoryRequest()) - { - return; - } - - PrepareResponse(); - - // Hand the processing over to HttpRuntime - HttpRuntime.ProcessRequest(this); - } - } - - public override int ReadEntityBody(byte[] buffer, int size) - { - int bytesRead = 0; - - _connectionPermission.Assert(); - byte[] bytes = _connection.ReadRequestBytes(size); - - if (bytes != null && bytes.Length > 0) - { - bytesRead = bytes.Length; - Buffer.BlockCopy(bytes, 0, buffer, 0, bytesRead); - } - - return bytesRead; - } - - public override void SendCalculatedContentLength(int contentLength) - { - if (!_headersSent) - { - _responseHeadersBuilder.Append("Content-Length: "); - _responseHeadersBuilder.Append(contentLength.ToString(CultureInfo.InvariantCulture)); - _responseHeadersBuilder.Append("\r\n"); - } - } - - public override void SendKnownResponseHeader(int index, string value) - { - if (_headersSent) - { - return; - } - - switch (index) - { - case HeaderServer: - case HeaderDate: - case HeaderConnection: - // ignore these - return; -/* case HeaderContentType: - if (value == "bytes") - { - // use this header to detect when we're processing a static file - _specialCaseStaticFileHeaders = true; - return; - } - break; - case HeaderExpires: - case HeaderLastModified: - if (_specialCaseStaticFileHeaders) - { - // NOTE: Ignore these for static files. These are generated - // by the StaticFileHandler, but they shouldn't be. - //return; - } - break;*/ - - // FIX: #12506 - case HeaderContentType: - - string contentType = null; - - if (value == "application/octet-stream") - { - // application/octet-stream is default for unknown so lets - // take a shot at determining the type. - // don't do this for other content-types as you are going to - // end up sending text/plain for endpoints that are handled by - // asp.net such as .aspx, .asmx, .axd, etc etc - contentType = Common.GetContentType(_pathTranslated); - } - value = contentType ?? value; - break; - } - - - _responseHeadersBuilder.Append(GetKnownResponseHeaderName(index)); - _responseHeadersBuilder.Append(": "); - _responseHeadersBuilder.Append(value); - _responseHeadersBuilder.Append("\r\n"); - - } - - public override void SendResponseFromFile(string filename, long offset, long length) - { - if (length == 0) - { - return; - } - - FileStream f = null; - try - { - f = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read); - SendResponseFromFileStream(f, offset, length); - } - finally - { - if (f != null) - { - f.Close(); - } - } - } - - public override void SendResponseFromFile(IntPtr handle, long offset, long length) - { - if (length == 0) - { - return; - } - - using (SafeFileHandle sfh = new SafeFileHandle(handle, false)) - { - using (FileStream f = new FileStream(sfh, FileAccess.Read)) - { - SendResponseFromFileStream(f, offset, length); - } - } - } - - public override void SendResponseFromMemory(byte[] data, int length) - { - if (length > 0) - { - byte[] bytes = new byte[length]; - - Buffer.BlockCopy(data, 0, bytes, 0, length); - _responseBodyBytes.Add(bytes); - } - } - - public override void SendStatus(int statusCode, string statusDescription) - { - _responseStatus = statusCode; - } - - public override void SendUnknownResponseHeader(string name, string value) - { - if (_headersSent) - return; - - _responseHeadersBuilder.Append(name); - _responseHeadersBuilder.Append(": "); - _responseHeadersBuilder.Append(value); - _responseHeadersBuilder.Append("\r\n"); - } - - private bool IsBadPath() - { - if (_path.IndexOfAny(BadPathChars) >= 0) - { - return true; - } - - if (CultureInfo.InvariantCulture.CompareInfo.IndexOf(_path, "..", CompareOptions.Ordinal) >= 0) - { - return true; - } - - if (CultureInfo.InvariantCulture.CompareInfo.IndexOf(_path, "//", CompareOptions.Ordinal) >= 0) - { - return true; - } - - return false; - } - - private bool IsRequestForRestrictedDirectory() - { - String p = CultureInfo.InvariantCulture.TextInfo.ToLower(_path); - - if (_host.VirtualPath != "/") - { - p = p.Substring(_host.VirtualPath.Length); - } - - foreach (String dir in RestrictedDirs) - { - if (p.StartsWith(dir, StringComparison.Ordinal)) - { - if (p.Length == dir.Length || p[dir.Length] == '/') - { - return true; - } - } - } - - return false; - } - - private void ParseHeaders() - { - _knownRequestHeaders = new string[RequestHeaderMaximum]; - - // construct unknown headers as array list of name1,value1,... - List headers = new List(); - - for (int i = 1; i < _headerByteStrings.Count; i++) - { - string s = _headerByteStrings[i].GetString(); - - int c = s.IndexOf(':'); - - if (c >= 0) - { - string name = s.Substring(0, c).Trim(); - string value = s.Substring(c + 1).Trim(); - - // remember - int knownIndex = GetKnownRequestHeaderIndex(name); - if (knownIndex >= 0) - { - _knownRequestHeaders[knownIndex] = value; - } - else - { - headers.Add(name); - headers.Add(value); - } - } - } - - // copy to array unknown headers - - int n = headers.Count / 2; - _unknownRequestHeaders = new string[n][]; - int j = 0; - - for (int i = 0; i < n; i++) - { - _unknownRequestHeaders[i] = new string[2]; - _unknownRequestHeaders[i][0] = headers[j++]; - _unknownRequestHeaders[i][1] = headers[j++]; - } - - // remember all raw headers as one string - - if (_headerByteStrings.Count > 1) - { - _allRawHeaders = Encoding.UTF8.GetString(_headerBytes, _startHeadersOffset, - _endHeadersOffset - _startHeadersOffset); - } - else - { - _allRawHeaders = String.Empty; - } - } - - private void ParsePostedContent() - { - _contentLength = 0; - _bodyLength = 0; - - string contentLengthValue = _knownRequestHeaders[HeaderContentLength]; - if (contentLengthValue != null) - { - try - { - _contentLength = Int32.Parse(contentLengthValue, CultureInfo.InvariantCulture); - } - // ReSharper disable EmptyGeneralCatchClause - catch - // ReSharper restore EmptyGeneralCatchClause - { - } - } - - if (_headerBytes.Length > _endHeadersOffset) - { - _bodyLength = _headerBytes.Length - _endHeadersOffset; - - if (_bodyLength > _contentLength) - { - _bodyLength = _contentLength; // don't read more than the content-length - } - - if (_bodyLength > 0) - { - _body = new byte[_bodyLength]; - Buffer.BlockCopy(_headerBytes, _endHeadersOffset, _body, 0, _bodyLength); - _connection.LogRequestBody(_body); - } - } - } - - private void ParseRequestLine() - { - ByteString requestLine = _headerByteStrings[0]; - ByteString[] elems = requestLine.Split(' '); - - if (elems == null || elems.Length < 2 || elems.Length > 3) - { - _connection.WriteErrorAndClose(400); - return; - } - - _verb = elems[0].GetString(); - - ByteString urlBytes = elems[1]; - _url = urlBytes.GetString(); - - _protocol = elems.Length == 3 ? elems[2].GetString() : "HTTP/1.0"; - - // query string - - int iqs = urlBytes.IndexOf('?'); - _queryStringBytes = iqs > 0 ? urlBytes.Substring(iqs + 1).GetBytes() : new byte[0]; - - iqs = _url.IndexOf('?'); - if (iqs > 0) - { - _path = _url.Substring(0, iqs); - _queryString = _url.Substring(iqs + 1); - } - else - { - _path = _url; - _queryStringBytes = new byte[0]; - } - - // url-decode path - - if (_path.IndexOf('%') >= 0) - { - _path = HttpUtility.UrlDecode(_path, Encoding.UTF8); - - iqs = _url.IndexOf('?'); - if (iqs >= 0) - { - _url = _path + _url.Substring(iqs); - } - else - { - _url = _path; - } - } - - // path info - - int lastDot = _path.LastIndexOf('.'); - int lastSlh = _path.LastIndexOf('/'); - - if (lastDot >= 0 && lastSlh >= 0 && lastDot < lastSlh) - { - int ipi = _path.IndexOf('/', lastDot); - _filePath = _path.Substring(0, ipi); - _pathInfo = _path.Substring(ipi); - } - else - { - _filePath = _path; - _pathInfo = String.Empty; - } - - _pathTranslated = MapPath(_filePath); - - _connection.LogRequest(_pathTranslated, _url); - } - - private void PrepareResponse() - { - _headersSent = false; - _responseStatus = 200; - _responseHeadersBuilder = new StringBuilder(); - _responseBodyBytes = new List(); - } - - private bool ProcessDirectoryListingRequest() - { - if (_verb != "GET") - { - return false; - } - - String dirPathTranslated = _pathTranslated; - - if (_pathInfo.Length > 0) - { - // directory path can never have pathInfo - dirPathTranslated = MapPath(_path); - } - - if (!Directory.Exists(dirPathTranslated)) - { - return false; - } - - // get all files and subdirs - FileSystemInfo[] infos = null; - try - { - infos = (new DirectoryInfo(dirPathTranslated)).GetFileSystemInfos(); - } - // ReSharper disable EmptyGeneralCatchClause - catch - // ReSharper restore EmptyGeneralCatchClause - { - } - - // determine if parent is appropriate - string parentPath = null; - - if (_path.Length > 1) - { - int i = _path.LastIndexOf('/', _path.Length - 2); - - parentPath = (i > 0) ? _path.Substring(0, i) : "/"; - if (!_host.IsVirtualPathInApp(parentPath)) - { - parentPath = null; - } - } - - _connection.WriteEntireResponseFromString(200, "Content-type: text/html; charset=utf-8\r\n", - Messages.FormatDirectoryListing(_path, parentPath, infos), - false); - return true; - } - - private bool ProcessDirectoryRequest() - { - String dirPathTranslated = _pathTranslated; - - if (_pathInfo.Length > 0) - { - // directory path can never have pathInfo - dirPathTranslated = MapPath(_path); - } - - if (!Directory.Exists(dirPathTranslated)) - { - return false; - } - - // have to redirect /foo to /foo/ to allow relative links to work - if (!_path.EndsWith("/", StringComparison.Ordinal)) - { - string newPath = _path + "/"; - string location = "Location: " + UrlEncodeRedirect(newPath) + "\r\n"; - string body = "Object moved\r\n" + - "

Object moved to here.

\r\n" + - "\r\n"; - - _connection.WriteEntireResponseFromString(302, location, body, false); - return true; - } - - // check for the default file - foreach (string filename in DefaultFileNames) - { - string defaultFilePath = dirPathTranslated + "\\" + filename; - - if (File.Exists(defaultFilePath)) - { - // pretend the request is for the default file path - _path += filename; - _filePath = _path; - _url = (_queryString != null) ? (_path + "?" + _queryString) : _path; - _pathTranslated = defaultFilePath; - return false; // go through normal processing - } - } - - return false; // go through normal processing - } - - private void ReadAllHeaders() - { - _headerBytes = null; - - do - { - if (!TryReadAllHeaders()) - { - // something bad happened - break; - } - } while (_endHeadersOffset < 0); // found \r\n\r\n - - // - // fixed: Item # 13290 - if (_headerByteStrings != null && _headerByteStrings.Count > 0) - { - _connection.LogRequestHeaders(string.Join(Environment.NewLine, _headerByteStrings.Select(b => b.GetString()).ToArray())); - } - - } - - private void Reset() - { - _headerBytes = null; - _startHeadersOffset = 0; - _endHeadersOffset = 0; - _headerByteStrings = null; - - _isClientScriptPath = false; - - _verb = null; - _url = null; - _protocol = null; - - _path = null; - _filePath = null; - _pathInfo = null; - _pathTranslated = null; - _queryString = null; - _queryStringBytes = null; - - _contentLength = 0; - _bodyLength = 0; - _body = null; - - _allRawHeaders = null; - _unknownRequestHeaders = null; - _knownRequestHeaders = null; - //_specialCaseStaticFileHeaders = false; - } - - private void SendResponseFromFileStream(Stream f, long offset, long length) - { - long fileSize = f.Length; - - if (length == -1) - { - length = fileSize - offset; - } - - if (length == 0 || offset < 0 || length > fileSize - offset) - { - return; - } - - if (offset > 0) - { - f.Seek(offset, SeekOrigin.Begin); - } - - if (length <= MaxChunkLength) - { - byte[] fileBytes = new byte[(int)length]; - int bytesRead = f.Read(fileBytes, 0, (int)length); - SendResponseFromMemory(fileBytes, bytesRead); - } - else - { - byte[] chunk = new byte[MaxChunkLength]; - int bytesRemaining = (int)length; - - while (bytesRemaining > 0) - { - int bytesToRead = (bytesRemaining < MaxChunkLength) ? bytesRemaining : MaxChunkLength; - int bytesRead = f.Read(chunk, 0, bytesToRead); - - SendResponseFromMemory(chunk, bytesRead); - bytesRemaining -= bytesRead; - - // flush to release keep memory - if ((bytesRemaining > 0) && (bytesRead > 0)) - { - FlushResponse(false); - } - } - } - } - - private void SkipAllPostedContent() - { - if ((_contentLength > 0) && (_bodyLength < _contentLength)) - { - byte[] buffer; - for (int i = _contentLength - _bodyLength; i > 0; i -= buffer.Length) - { - buffer = _connection.ReadRequestBytes(i); - if ((buffer == null) || (buffer.Length == 0)) - { - return; - } - } - } - } - - [SecurityPermission(SecurityAction.Assert, UnmanagedCode = true), - SecurityPermission(SecurityAction.Assert, ControlPrincipal = true)] - private bool TryNtlmAuthenticate() - { - try - { - using (NtlmAuth auth = new NtlmAuth()) - { - do - { - string blobString = null; - string extraHeaders = _knownRequestHeaders[0x18]; - if ((extraHeaders != null) && extraHeaders.StartsWith("NTLM ", StringComparison.Ordinal)) - { - blobString = extraHeaders.Substring(5); - } - if (blobString != null) - { - if (!auth.Authenticate(blobString)) - { - _connection.WriteErrorAndClose(0x193); - return false; - } - if (auth.Completed) - { - goto Label_009A; - } - extraHeaders = "WWW-Authenticate: NTLM " + auth.Blob + "\r\n"; - } - else - { - extraHeaders = "WWW-Authenticate: NTLM\r\n"; - } - SkipAllPostedContent(); - _connection.WriteErrorWithExtraHeadersAndKeepAlive(0x191, extraHeaders); - } while (TryParseRequest()); - return false; - Label_009A: - if (_host.GetProcessSid() != auth.SID) - { - _connection.WriteErrorAndClose(0x193); - return false; - } - } - } - catch - { - try - { - _connection.WriteErrorAndClose(500); - } - // ReSharper disable EmptyGeneralCatchClause - catch - // ReSharper restore EmptyGeneralCatchClause - { - } - return false; - } - return true; - } - - /// - /// TODO: defer response until request is written - /// - /// - private bool TryParseRequest() - { - Reset(); - - ReadAllHeaders(); - - if (_headerBytes == null || _endHeadersOffset < 0 || - _headerByteStrings == null || _headerByteStrings.Count == 0) - { - _connection.WriteErrorAndClose(400); - return false; - } - - ParseRequestLine(); - - // Check for bad path - if (IsBadPath()) - { - _connection.WriteErrorAndClose(400); - return false; - } - - // Check if the path is not well formed or is not for the current app - if (!_host.IsVirtualPathInApp(_path, out _isClientScriptPath)) - { - _connection.WriteErrorAndClose(404); - return false; - } - - ParseHeaders(); - - ParsePostedContent(); - - return true; - } - - private bool TryReadAllHeaders() - { - // read the first packet (up to 32K) - byte[] headerBytes = _connection.ReadRequestBytes(MaxHeaderBytes); - - if (headerBytes == null || headerBytes.Length == 0) - return false; - - if (_headerBytes != null) - { - // previous partial read - int len = headerBytes.Length + _headerBytes.Length; - if (len > MaxHeaderBytes) - return false; - - byte[] bytes = new byte[len]; - Buffer.BlockCopy(_headerBytes, 0, bytes, 0, _headerBytes.Length); - Buffer.BlockCopy(headerBytes, 0, bytes, _headerBytes.Length, headerBytes.Length); - _headerBytes = bytes; - } - else - { - _headerBytes = headerBytes; - } - - // start parsing - _startHeadersOffset = -1; - _endHeadersOffset = -1; - _headerByteStrings = new List(); - - // find the end of headers - ByteParser parser = new ByteParser(_headerBytes); - - for (; ; ) - { - ByteString line = parser.ReadLine(); - - if (line == null) - { - break; - } - - if (_startHeadersOffset < 0) - { - _startHeadersOffset = parser.CurrentOffset; - } - - if (line.IsEmpty) - { - _endHeadersOffset = parser.CurrentOffset; - break; - } - - _headerByteStrings.Add(line); - } - - return true; - } - - private static string UrlEncodeRedirect(string path) - { - // this method mimics the logic in HttpResponse.Redirect (which relies on internal methods) - - // count non-ascii characters - byte[] bytes = Encoding.UTF8.GetBytes(path); - int count = bytes.Length; - int countNonAscii = 0; - for (int i = 0; i < count; i++) - { - if ((bytes[i] & 0x80) != 0) - { - countNonAscii++; - } - } - - // encode all non-ascii characters using UTF-8 %XX - if (countNonAscii > 0) - { - // expand not 'safe' characters into %XX, spaces to +s - byte[] expandedBytes = new byte[count + countNonAscii * 2]; - int pos = 0; - for (int i = 0; i < count; i++) - { - byte b = bytes[i]; - - if ((b & 0x80) == 0) - { - expandedBytes[pos++] = b; - } - else - { - expandedBytes[pos++] = (byte)'%'; - expandedBytes[pos++] = (byte)IntToHex[(b >> 4) & 0xf]; - expandedBytes[pos++] = (byte)IntToHex[b & 0xf]; - } - } - - path = Encoding.ASCII.GetString(expandedBytes); - } - - // encode spaces into %20 - if (path.IndexOf(' ') >= 0) - { - path = path.Replace(" ", "%20"); - } - - return path; - } - - #region Nested type: ByteParser - - internal class ByteParser - { - private readonly byte[] _bytes; - - private int _pos; - - public ByteParser(byte[] bytes) - { - _bytes = bytes; - _pos = 0; - } - - public int CurrentOffset - { - get { return _pos; } - } - - public ByteString ReadLine() - { - ByteString line = null; - - for (int i = _pos; i < _bytes.Length; i++) - { - if (_bytes[i] == (byte)'\n') - { - int len = i - _pos; - if (len > 0 && _bytes[i - 1] == (byte)'\r') - { - len--; - } - - line = new ByteString(_bytes, _pos, len); - _pos = i + 1; - return line; - } - } - - if (_pos < _bytes.Length) - { - line = new ByteString(_bytes, _pos, _bytes.Length - _pos); - } - - _pos = _bytes.Length; - return line; - } - } - - #endregion - - #region Nested type: ByteString - - internal class ByteString - { - private readonly byte[] _bytes; - - private readonly int _length; - - private readonly int _offset; - - public ByteString(byte[] bytes, int offset, int length) - { - _bytes = bytes; - _offset = offset; - _length = length; - } - - public byte[] Bytes - { - get { return _bytes; } - } - - public bool IsEmpty - { - get { return (_bytes == null || _length == 0); } - } - - public byte this[int index] - { - get { return _bytes[_offset + index]; } - } - - public int Length - { - get { return _length; } - } - - public int Offset - { - get { return _offset; } - } - - public byte[] GetBytes() - { - byte[] bytes = new byte[_length]; - if (_length > 0) Buffer.BlockCopy(_bytes, _offset, bytes, 0, _length); - return bytes; - } - - public string GetString(Encoding enc) - { - if (IsEmpty) return string.Empty; - return enc.GetString(_bytes, _offset, _length); - } - - public string GetString() - { - return GetString(Encoding.UTF8); - } - - public int IndexOf(char ch) - { - return IndexOf(ch, 0); - } - - public int IndexOf(char ch, int offset) - { - for (int i = offset; i < _length; i++) - { - if (this[i] == (byte)ch) return i; - } - return -1; - } - - public ByteString[] Split(char sep) - { - List list = new List(); - - int pos = 0; - while (pos < _length) - { - int i = IndexOf(sep, pos); - if (i < 0) - { - break; - } - - list.Add(Substring(pos, i - pos)); - pos = i + 1; - - while (this[pos] == (byte)sep && pos < _length) - { - pos++; - } - } - - if (pos < _length) - list.Add(Substring(pos)); - - return list.ToArray(); - } - - public ByteString Substring(int offset, int len) - { - return new ByteString(_bytes, _offset + offset, len); - } - - public ByteString Substring(int offset) - { - return Substring(offset, _length - offset); - } - } - - #endregion - } -} \ No newline at end of file diff --git a/CassiniDev/Core/RequestEventArgs.cs b/CassiniDev/Core/RequestEventArgs.cs deleted file mode 100644 index ac2606200..000000000 --- a/CassiniDev/Core/RequestEventArgs.cs +++ /dev/null @@ -1,53 +0,0 @@ -// ********************************************************************************** -// CassiniDev - http://cassinidev.codeplex.com -// -// Copyright (c) 2010 Sky Sanders. All rights reserved. -// -// This source code is subject to terms and conditions of the Microsoft Public -// License (Ms-PL). A copy of the license can be found in the license.txt file -// included in this distribution. -// -// You must not remove this notice, or any other, from this software. -// -// ********************************************************************************** - -#region - -using System; -using CassiniDev.ServerLog; - -#endregion - -namespace CassiniDev -{ - public class RequestEventArgs : EventArgs - { - private readonly Guid _id; - - private readonly LogInfo _requestLog; - - private readonly LogInfo _responseLog; - - public RequestEventArgs(Guid id, LogInfo requestLog, LogInfo responseLog) - { - _requestLog = requestLog; - _responseLog = responseLog; - _id = id; - } - - public Guid Id - { - get { return _id; } - } - - public LogInfo RequestLog - { - get { return _requestLog; } - } - - public LogInfo ResponseLog - { - get { return _responseLog; } - } - } -} \ No newline at end of file diff --git a/CassiniDev/Core/Server.cs b/CassiniDev/Core/Server.cs deleted file mode 100644 index ff5e4791c..000000000 --- a/CassiniDev/Core/Server.cs +++ /dev/null @@ -1,523 +0,0 @@ -// ********************************************************************************** -// CassiniDev - http://cassinidev.codeplex.com -// -// Copyright (c) 2010 Sky Sanders. All rights reserved. -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// This source code is subject to terms and conditions of the Microsoft Public -// License (Ms-PL). A copy of the license can be found in the license.txt file -// included in this distribution. -// -// You must not remove this notice, or any other, from this software. -// -// ********************************************************************************** - -#region - -using System; -using System.Globalization; -using System.IO; -using System.Net; -using System.Net.Sockets; -using System.Reflection; -using System.Runtime.Remoting; -using System.Security.Permissions; -using System.Security.Principal; -using System.Threading; -using System.Web; -using System.Web.Hosting; -using CassiniDev.ServerLog; - -#endregion - -namespace CassiniDev -{ - [PermissionSet(SecurityAction.LinkDemand, Name = "Everything"), - PermissionSet(SecurityAction.InheritanceDemand, Name = "FullTrust")] - public class Server : MarshalByRefObject, IDisposable - { - private readonly ApplicationManager _appManager; - - private readonly bool _disableDirectoryListing; - - private readonly string _hostName; - - private readonly IPAddress _ipAddress; - - private readonly object _lockObject; - - private readonly string _physicalPath; - - private readonly int _port; - private readonly bool _requireAuthentication; - private readonly int _timeoutInterval; - private readonly string _virtualPath; - private bool _disposed; - - private Host _host; - - private IntPtr _processToken; - - private string _processUser; - - private int _requestCount; - - private bool _shutdownInProgress; - - private Socket _socket; - - private Timer _timer; - - public Server(int port, string virtualPath, string physicalPath) - : this(port, virtualPath, physicalPath, false, false) - { - } - - public Server(int port, string physicalPath) - : this(port, "/", physicalPath, IPAddress.Loopback) - { - } - - public Server(string physicalPath) - : this(CassiniNetworkUtils.GetAvailablePort(32768, 65535, IPAddress.Loopback, false), physicalPath) - { - } - - public Server(int port, string virtualPath, string physicalPath, IPAddress ipAddress, string hostName, - int timeout, bool requireAuthentication) - : this(port, virtualPath, physicalPath, ipAddress, hostName, timeout, requireAuthentication, false) - { - } - - public Server(int port, string virtualPath, string physicalPath, bool requireAuthentication) - : this(port, virtualPath, physicalPath, requireAuthentication, false) - { - } - - public Server(int port, string virtualPath, string physicalPath, IPAddress ipAddress, string hostName) - : this(port, virtualPath, physicalPath, ipAddress, hostName, 0, false, false) - { - } - - public Server(int port, string virtualPath, string physicalPath, IPAddress ipAddress, string hostName, - int timeout, bool requireAuthentication, bool disableDirectoryListing) - : this(port, virtualPath, physicalPath, requireAuthentication, disableDirectoryListing) - { - _ipAddress = ipAddress; - _hostName = hostName; - _timeoutInterval = timeout; - } - - public Server(int port, string virtualPath, string physicalPath, IPAddress ipAddress) - : this(port, virtualPath, physicalPath, ipAddress, null, 0, false, false) - { - } - - public Server(int port, string virtualPath, string physicalPath, bool requireAuthentication, - bool disableDirectoryListing) - { - _ipAddress = IPAddress.Loopback; - _requireAuthentication = requireAuthentication; - _disableDirectoryListing = disableDirectoryListing; - _lockObject = new object(); - _port = port; - _virtualPath = virtualPath; - _physicalPath = Path.GetFullPath(physicalPath); - _physicalPath = _physicalPath.EndsWith("\\", StringComparison.Ordinal) - ? _physicalPath - : _physicalPath + "\\"; - _appManager = ApplicationManager.GetApplicationManager(); - ObtainProcessToken(); - } - - public Server(string physicalPath, bool requireAuthentication) - : this( - CassiniNetworkUtils.GetAvailablePort(32768, 65535, IPAddress.Loopback, false), "/", physicalPath, - requireAuthentication) - { - } - - public Server(int port, string virtualPath, string physicalPath, IPAddress ipAddress, string hostName, - int timeout) - : this(port, virtualPath, physicalPath, ipAddress, hostName, timeout, false, false) - { - } - - public bool DisableDirectoryListing - { - get { return _disableDirectoryListing; } - } - - public bool RequireAuthentication - { - get { return _requireAuthentication; } - } - - public int TimeoutInterval - { - get { return _timeoutInterval; } - } - - public string HostName - { - get { return _hostName; } - } - - public IPAddress IPAddress - { - get { return _ipAddress; } - } - - public string PhysicalPath - { - get { return _physicalPath; } - } - - public int Port - { - get { return _port; } - } - - public string RootUrl - { - get - { - string hostname = _hostName; - if (string.IsNullOrEmpty(_hostName)) - { - if (_ipAddress.Equals(IPAddress.Loopback) || _ipAddress.Equals(IPAddress.IPv6Loopback) || - _ipAddress.Equals(IPAddress.Any) || _ipAddress.Equals(IPAddress.IPv6Any)) - { - hostname = "localhost"; - } - else - { - hostname = _ipAddress.ToString(); - } - } - - return _port != 80 - ? - String.Format("http://{0}:{1}{2}", hostname, _port, _virtualPath) - : - //FIX: #12017 - TODO:TEST - string.Format("http://{0}{1}", hostname, _virtualPath); - } - } - - public string VirtualPath - { - get { return _virtualPath; } - } - - #region IDisposable Members - - public void Dispose() - { - if (!_disposed) - { - ShutDown(); - } - _disposed = true; - GC.SuppressFinalize(this); - } - - #endregion - - public event EventHandler RequestComplete; - - public event EventHandler TimedOut; - - public IntPtr GetProcessToken() - { - return _processToken; - } - - public string GetProcessUser() - { - return _processUser; - } - - public void HostStopped() - { - _host = null; - } - - [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.Infrastructure)] - public override object InitializeLifetimeService() - { - // never expire the license - return null; - } - - // called at the end of request processing - // to disconnect the remoting proxy for Connection object - // and allow GC to pick it up - /// - /// - /// - public void OnRequestEnd(Connection conn) - { - try - { - OnRequestComplete(conn.Id, conn.RequestLog.Clone(), conn.ResponseLog.Clone()); - } - catch - { - // swallow - we don't want consumer killing the server - } - RemotingServices.Disconnect(conn); - DecrementRequestCount(); - } - - public void Start() - { - _socket = CreateSocketBindAndListen(AddressFamily.InterNetwork, _ipAddress, _port); - - //start the timer - DecrementRequestCount(); - - ThreadPool.QueueUserWorkItem(delegate - { - while (!_shutdownInProgress) - { - try - { - Socket acceptedSocket = _socket.Accept(); - - ThreadPool.QueueUserWorkItem(delegate - { - if (!_shutdownInProgress) - { - Connection conn = new Connection(this, acceptedSocket); - - if (conn.WaitForRequestBytes() == 0) - { - conn.WriteErrorAndClose(400); - return; - } - - Host host = GetHost(); - - if (host == null) - { - conn.WriteErrorAndClose(500); - return; - } - - IncrementRequestCount(); - host.ProcessRequest(conn); - } - }); - } - catch - { - Thread.Sleep(100); - } - } - }); - } - - - ~Server() - { - Dispose(); - } - - - private static Socket CreateSocketBindAndListen(AddressFamily family, IPAddress address, int port) - { - Socket socket = new Socket(family, SocketType.Stream, ProtocolType.Tcp); - socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true); - socket.Bind(new IPEndPoint(address, port)); - socket.Listen((int) SocketOptionName.MaxConnections); - return socket; - } - - /// - /// - /// - /// - /// - /// - /// - /// This is Dmitry's hack to enable running outside of GAC - private object CreateWorkerAppDomainWithHost(string virtualPath, string physicalPath, Type hostType) - { - // this creates worker app domain in a way that host doesn't need to be in GAC or bin - // using BuildManagerHost via private reflection - string uniqueAppString = string.Concat(virtualPath, physicalPath).ToLowerInvariant(); - string appId = (uniqueAppString.GetHashCode()).ToString("x", CultureInfo.InvariantCulture); - - // create BuildManagerHost in the worker app domain - //ApplicationManager appManager = ApplicationManager.GetApplicationManager(); - Type buildManagerHostType = typeof (HttpRuntime).Assembly.GetType("System.Web.Compilation.BuildManagerHost"); - IRegisteredObject buildManagerHost = _appManager.CreateObject(appId, buildManagerHostType, virtualPath, - physicalPath, false); - - // call BuildManagerHost.RegisterAssembly to make Host type loadable in the worker app domain - buildManagerHostType.InvokeMember("RegisterAssembly", - BindingFlags.Instance | BindingFlags.InvokeMethod | BindingFlags.NonPublic, - null, - buildManagerHost, - new object[] {hostType.Assembly.FullName, hostType.Assembly.Location}); - - // create Host in the worker app domain - return _appManager.CreateObject(appId, hostType, virtualPath, physicalPath, false); - } - - private void DecrementRequestCount() - { - _requestCount--; - - if (_requestCount < 1) - { - _requestCount = 0; - - if (_timeoutInterval > 0) - { - _timer = new Timer(TimeOut, null, _timeoutInterval, Timeout.Infinite); - } - } - } - - private Host GetHost() - { - if (_shutdownInProgress) - return null; - Host host = _host; - if (host == null) - { -#if NET40 - object obj2 = new object(); - bool flag = false; - try - { - Monitor.Enter(obj2 = _lockObject, ref flag); - host = _host; - if (host == null) - { - host = (Host)CreateWorkerAppDomainWithHost(_virtualPath, _physicalPath, typeof(Host)); - host.Configure(this, _port, _virtualPath, _physicalPath, _requireAuthentication, _disableDirectoryListing); - _host = host; - } - } - finally - { - if (flag) - { - Monitor.Exit(obj2); - } - } -#else - - lock (_lockObject) - { - host = _host; - if (host == null) - { - host = (Host) CreateWorkerAppDomainWithHost(_virtualPath, _physicalPath, typeof (Host)); - host.Configure(this, _port, _virtualPath, _physicalPath, _requireAuthentication, - _disableDirectoryListing); - _host = host; - } - } - -#endif - } - - return host; - } - - private void IncrementRequestCount() - { - _requestCount++; - _timer = null; - } - - - private void ObtainProcessToken() - { - if (Interop.ImpersonateSelf(2)) - { - Interop.OpenThreadToken(Interop.GetCurrentThread(), 0xf01ff, true, ref _processToken); - Interop.RevertToSelf(); - // ReSharper disable PossibleNullReferenceException - _processUser = WindowsIdentity.GetCurrent().Name; - // ReSharper restore PossibleNullReferenceException - } - } - - private void OnRequestComplete(Guid id, LogInfo requestLog, LogInfo responseLog) - { - EventHandler complete = RequestComplete; - - if (complete != null) - { - complete(this, new RequestEventArgs(id, requestLog, responseLog)); - } - } - - - public void ShutDown() - { - _shutdownInProgress = true; - - try - { - if (_socket != null) - { - _socket.Close(); - } - } - // ReSharper disable EmptyGeneralCatchClause - catch - // ReSharper restore EmptyGeneralCatchClause - { - } - finally - { - _socket = null; - } - - try - { - if (_host != null) - { - _host.Shutdown(); - } - - while (_host != null) - { - Thread.Sleep(100); - } - } - // ReSharper disable EmptyGeneralCatchClause - catch - // ReSharper restore EmptyGeneralCatchClause - { - } - finally - { - _host = null; - } - } - - private void TimeOut(object ignored) - { - TimeOut(); - } - - public void TimeOut() - { - ShutDown(); - OnTimeOut(); - } - - private void OnTimeOut() - { - EventHandler handler = TimedOut; - if (handler != null) handler(this, EventArgs.Empty); - } - } -} \ No newline at end of file diff --git a/CassiniDev/Logging/LogInfo.cs b/CassiniDev/Logging/LogInfo.cs deleted file mode 100644 index d36828953..000000000 --- a/CassiniDev/Logging/LogInfo.cs +++ /dev/null @@ -1,73 +0,0 @@ -// ********************************************************************************** -// CassiniDev - http://cassinidev.codeplex.com -// -// Copyright (c) 2010 Sky Sanders. All rights reserved. -// -// This source code is subject to terms and conditions of the Microsoft Public -// License (Ms-PL). A copy of the license can be found in the license.txt file -// included in this distribution. -// -// You must not remove this notice, or any other, from this software. -// -// ********************************************************************************** - -#region - -using System; - -#endregion - -namespace CassiniDev.ServerLog -{ - /// - /// TODO: get rid of status code and url in the database and simply parse the headers - /// - [Serializable] - public class LogInfo : ICloneable - { - public byte[] Body { get; set; } - - public Guid ConversationId { get; set; } - - public DateTime Created { get; set; } - - public string Exception { get; set; } - - public string Headers { get; set; } - - public string Identity { get; set; } - - public string PathTranslated { get; set; } - - public string PhysicalPath { get; set; } - - public long RowId { get; set; } - - public long RowType { get; set; } - - public long? StatusCode { get; set; } - - public string Url { get; set; } - - #region ICloneable Members - - object ICloneable.Clone() - { - return MemberwiseClone(); - } - - #endregion - - public LogInfo Clone() - { - LogInfo result = (LogInfo) ((ICloneable) this).Clone(); - if (Body != null) - { - result.Body = new byte[Body.Length]; - Body.CopyTo(result.Body, 0); - } - - return result; - } - } -} \ No newline at end of file diff --git a/CassiniDev/Misc/CommandLine.cs b/CassiniDev/Misc/CommandLine.cs deleted file mode 100644 index 55798ee7c..000000000 --- a/CassiniDev/Misc/CommandLine.cs +++ /dev/null @@ -1,100 +0,0 @@ -// ********************************************************************************** -// CassiniDev - http://cassinidev.codeplex.com -// -// Copyright (c) 2010 Sky Sanders. All rights reserved. -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// This source code is subject to terms and conditions of the Microsoft Public -// License (Ms-PL). A copy of the license can be found in the license.txt file -// included in this distribution. -// -// You must not remove this notice, or any other, from this software. -// -// ********************************************************************************** - -#region - -using System; -using System.Collections; -using System.Collections.Specialized; - -#endregion - -namespace CassiniDev.UIComponents -{ - public sealed class CommandLine - { - #region Fields - - private readonly string[] _arguments; - - private readonly bool _showHelp; - private IDictionary _options; - - #endregion - - #region Constructors - - public CommandLine(string[] args) - { - ArrayList list = new ArrayList(); - for (int i = 0; i < args.Length; i++) - { - char ch = args[i][0]; - if ((ch != '/') && (ch != '-')) - { - list.Add(args[i]); - } - else - { - int index = args[i].IndexOf(':'); - if (index == -1) - { - string strA = args[i].Substring(1); - if ((string.Compare(strA, "help", StringComparison.OrdinalIgnoreCase) == 0) || strA.Equals("?")) - { - _showHelp = true; - } - else - { - Options[strA] = string.Empty; - } - } - else - { - Options[args[i].Substring(1, index - 1)] = args[i].Substring(index + 1); - } - } - } - _arguments = (string[]) list.ToArray(typeof (string)); - } - - #endregion - - #region Properties - - public string[] Arguments - { - get { return _arguments; } - } - - public IDictionary Options - { - get - { - if (_options == null) - { - _options = new HybridDictionary(true); - } - return _options; - } - } - - public bool ShowHelp - { - get { return _showHelp; } - } - - #endregion - } -} \ No newline at end of file diff --git a/CassiniDev/Misc/CommandLineArguments.cs b/CassiniDev/Misc/CommandLineArguments.cs deleted file mode 100644 index a80d95658..000000000 --- a/CassiniDev/Misc/CommandLineArguments.cs +++ /dev/null @@ -1,443 +0,0 @@ -// ********************************************************************************** -// CassiniDev - http://cassinidev.codeplex.com -// -// Copyright (c) 2010 Sky Sanders. All rights reserved. -// -// This source code is subject to terms and conditions of the Microsoft Public -// License (Ms-PL). A copy of the license can be found in the license.txt file -// included in this distribution. -// -// You must not remove this notice, or any other, from this software. -// -// ********************************************************************************** - -#region - -using System; -using System.Collections.Generic; -using System.IO; -using System.Net; -using System.Text; -using System.Threading; - -#endregion - -namespace CassiniDev -{ - /// - /// Command line arguments - /// - /// fixed 5/24/10 - quoted embedded spaces in ToString - /// - public class CommandLineArguments - { - #region Properties - - [Argument(ArgumentType.AtMostOnce, ShortName = "ah", DefaultValue = false, - HelpText = "If true add entry to Windows hosts file. Requires write permissions to hosts file.")] public - bool AddHost; - - [Argument(ArgumentType.AtMostOnce, ShortName = "a", LongName = "path", - HelpText = "Physical location of content.")] public string - ApplicationPath; - - [Argument(ArgumentType.AtMostOnce, LongName = "log", DefaultValue = false, HelpText = "Enable logging.")] public - bool EnableLogging; - - [Argument(ArgumentType.AtMostOnce, ShortName = "h", LongName = "host", - HelpText = "Host name used for app root url. Optional unless AddHost is true.")] public string HostName; - - [Argument(ArgumentType.AtMostOnce, ShortName = "i", LongName = "ip", - HelpText = "IP address to listen to. Ignored if IPMode != Specific")] public string IPAddress; - - [Argument(ArgumentType.AtMostOnce, ShortName = "im", DefaultValue = IPMode.Loopback, HelpText = "", - LongName = "ipMode")] public - IPMode IPMode; - - [Argument(ArgumentType.AtMostOnce, ShortName = "v6", DefaultValue = false, - HelpText = "If IPMode 'Any' or 'LoopBack' are specified use the V6 address", LongName = "ipV6")] public bool - IPv6; - - - [Argument(ArgumentType.AtMostOnce, LongName = "nodirlist", DefaultValue = false, - HelpText = "Disable diretory listing")] public bool Nodirlist; - - [Argument(ArgumentType.AtMostOnce, LongName = "ntlm", DefaultValue = false, HelpText = "Run as current identity" - )] public bool Ntlm; - - - [Argument(ArgumentType.AtMostOnce, ShortName = "p", LongName = "port", - HelpText = "Port to listen to. Ignored if PortMode=FirstAvailable.", DefaultValue = 0)] public int Port; - - [Argument(ArgumentType.AtMostOnce, ShortName = "pm", HelpText = "", LongName = "portMode", - DefaultValue = PortMode.FirstAvailable)] public PortMode PortMode; - - [Argument(ArgumentType.AtMostOnce, ShortName = "pre", DefaultValue = 65535, LongName = "highPort", - HelpText = "End of port range. Ignored if PortMode != FirstAvailable")] public int PortRangeEnd = 9000; - - [Argument(ArgumentType.AtMostOnce, ShortName = "prs", DefaultValue = 32768, LongName = "lowPort", - HelpText = "Start of port range. Ignored if PortMode != FirstAvailable")] public int PortRangeStart = - 8080; - - [DefaultArgument(ArgumentType.AtMostOnce, DefaultValue = RunMode.Server, HelpText = "[Server|Hostsfile]")] public RunMode RunMode; - [Argument(ArgumentType.AtMostOnce, LongName = "silent", DefaultValue = false, HelpText = "Fail silently")] public bool Silent; - - [Argument(ArgumentType.AtMostOnce, ShortName = "t", DefaultValue = 0, LongName = "timeout", - HelpText = "Length of time, in ms, to wait for a request before stopping the server. 0 = no timeout.")] public int TimeOut; - - [Argument(ArgumentType.AtMostOnce, ShortName = "v", LongName = "vpath", DefaultValue = "/", - HelpText = "Optional. default value '/'" - )] public string VirtualPath = "/"; - - [Argument(ArgumentType.AtMostOnce, ShortName = "vs", DefaultValue = false, - HelpText = "If true run in Visual Studio Development Server mode - readonly UI with single option to quit.." - )] public - bool VisualStudio; - - [Argument(ArgumentType.AtMostOnce, ShortName = "w", DefaultValue = 0, LongName = "wait", - HelpText = - "Length of time, in ms, to wait for a specific port before throwing an exception or exiting. 0 = don't wait." - )] public int WaitForPort; - - #endregion - - public string[] ToArgs() - { - List result = new List(); - if (RunMode != RunMode.Server) - { - result.Add(string.Format("{0}", RunMode)); - } - if (!string.IsNullOrEmpty(ApplicationPath)) - { - result.Add(string.Format("/a:{0}", ApplicationPath.Contains("") ? String.Format("\"{0}\"", ApplicationPath) : ApplicationPath)); - } - result.Add(string.Format("/v:{0}", VirtualPath.Contains("") ? String.Format("\"{0}\"", VirtualPath) : VirtualPath)); - - if (!string.IsNullOrEmpty(HostName)) - { - result.Add(string.Format("/h:{0}", HostName.Contains("") ? String.Format("\"{0}\"", HostName) : HostName)); - } - if (AddHost) - { - result.Add("/ah"); - } - - if (IPMode != IPMode.Loopback) - { - result.Add(string.Format("/im:{0}", IPMode)); - } - - if (!string.IsNullOrEmpty(IPAddress)) - { - result.Add(string.Format("/i:{0}", IPAddress)); - } - - if (IPv6) - { - result.Add("/v6"); - } - - if (VisualStudio) - { - result.Add("/vs"); - } - - if (PortMode != PortMode.FirstAvailable) - { - result.Add(string.Format("/pm:{0}", PortMode)); - } - - if (Port != 0) - { - result.Add(string.Format("/p:{0}", Port)); - } - - if (PortRangeStart != 32768) - { - result.Add(string.Format("/prs:{0}", PortRangeStart)); - } - if (PortRangeEnd != 65535) - { - result.Add(string.Format("/pre:{0}", PortRangeEnd)); - } - if (TimeOut > 0) - { - result.Add(string.Format("/t:{0}", TimeOut)); - } - if (WaitForPort > 0) - { - result.Add(string.Format("/w:{0}", WaitForPort)); - } - - if (Ntlm) - { - result.Add("/ntlm"); - } - if (Silent) - { - result.Add("/silent"); - } - if (Nodirlist) - { - result.Add("/nodirlist"); - } - if (EnableLogging) - { - result.Add("/log"); - } - - return result.ToArray(); - } - public override string ToString() - { - return string.Join(" ", ToArgs()); - //StringBuilder sb = new StringBuilder(); - //if (RunMode != RunMode.Server) - //{ - // sb.AppendFormat("{0}", RunMode); - //} - //if (!string.IsNullOrEmpty(ApplicationPath)) - //{ - // sb.AppendFormat(" /a:{0}", ApplicationPath.Contains(" ") ? String.Format("\"{0}\"", ApplicationPath) : ApplicationPath); - //} - //sb.AppendFormat(" /v:{0}", VirtualPath.Contains(" ") ? String.Format("\"{0}\"", VirtualPath) : VirtualPath); - - //if (!string.IsNullOrEmpty(HostName)) - //{ - // sb.AppendFormat(" /h:{0}", HostName.Contains(" ") ? String.Format("\"{0}\"", HostName) : HostName); - //} - //if (AddHost) - //{ - // sb.Append(" /ah"); - //} - - //if (IPMode != IPMode.Loopback) - //{ - // sb.AppendFormat(" /im:{0}", IPMode); - //} - - //if (!string.IsNullOrEmpty(IPAddress)) - //{ - // sb.AppendFormat(" /i:{0}", IPAddress); - //} - - //if (IPv6) - //{ - // sb.Append(" /v6"); - //} - - //if (VisualStudio) - //{ - // sb.Append(" /vs"); - //} - - //if (PortMode != PortMode.FirstAvailable) - //{ - // sb.AppendFormat(" /pm:{0}", PortMode); - //} - - //if (Port != 0) - //{ - // sb.AppendFormat(" /p:{0}", Port); - //} - - //if (PortRangeStart != 32768) - //{ - // sb.AppendFormat(" /prs:{0}", PortRangeStart); - //} - //if (PortRangeEnd != 65535) - //{ - // sb.AppendFormat(" /pre:{0}", PortRangeEnd); - //} - //if (TimeOut > 0) - //{ - // sb.AppendFormat(" /t:{0}", TimeOut); - //} - //if (WaitForPort > 0) - //{ - // sb.AppendFormat(" /w:{0}", WaitForPort); - //} - - //if (Ntlm) - //{ - // sb.Append(" /ntlm"); - //} - //if (Silent) - //{ - // sb.Append(" /silent"); - //} - //if (Nodirlist) - //{ - // sb.Append(" /nodirlist"); - //} - //if (EnableLogging) - //{ - // sb.Append(" /log"); - //} - //return sb.ToString().Trim(); - } - - /// - /// - internal void Validate() - { - if (string.IsNullOrEmpty(ApplicationPath)) - { - throw new CassiniException(SR.ErrApplicationPathIsNull, ErrorField.ApplicationPath); - } - - try - { - ApplicationPath = Path.GetFullPath(ApplicationPath); - } - catch - { - } - if (!Directory.Exists(ApplicationPath)) - { - throw new CassiniException(SR.WebdevDirNotExist, ErrorField.ApplicationPath); - } - - ApplicationPath = ApplicationPath.Trim('\"').TrimEnd('\\'); - - - if (!string.IsNullOrEmpty(VirtualPath)) - { - VirtualPath = VirtualPath.Trim('\"'); - VirtualPath = VirtualPath.Trim('/'); - VirtualPath = "/" + VirtualPath; - } - else - { - VirtualPath = "/"; - } - - - if (!VirtualPath.StartsWith("/")) - { - VirtualPath = "/" + VirtualPath; - } - - - if (AddHost && string.IsNullOrEmpty(HostName)) - { - throw new CassiniException(SR.ErrInvalidHostname, ErrorField.HostName); - } - - - IPAddress = ParseIP(IPMode, IPv6, IPAddress).ToString(); - - - if (VisualStudio) // then STOP HERE. - { - // It is fortunate that in order to provide api parity with WebDev - // we do not need to port scan. Visual Studio balks and refuses to - // attach if we monkey around and open ports. - Port = Port == 0 ? 80 : Port; - PortMode = PortMode.Specific; - return; - } - - - switch (PortMode) - { - case PortMode.FirstAvailable: - - if (PortRangeStart < 1) - { - throw new CassiniException(SR.ErrInvalidPortRangeValue, ErrorField.PortRangeStart); - } - - if (PortRangeEnd < 1) - { - throw new CassiniException(SR.ErrInvalidPortRangeValue, ErrorField.PortRangeEnd); - } - - if (PortRangeStart > PortRangeEnd) - { - throw new CassiniException(SR.ErrPortRangeEndMustBeEqualOrGreaterThanPortRangeSta, - ErrorField.PortRange); - } - Port = CassiniNetworkUtils.GetAvailablePort(PortRangeStart, PortRangeEnd, - System.Net.IPAddress.Parse(IPAddress), true); - - if (Port == 0) - { - throw new CassiniException(SR.ErrNoAvailablePortFound, ErrorField.PortRange); - } - - break; - - case PortMode.Specific: - - if ((Port < 1) || (Port > 0xffff)) - { - throw new CassiniException(SR.ErrPortOutOfRange, ErrorField.Port); - } - - - // start waiting.... - //TODO: design this hack away.... why am I waiting in a validation method? - int now = Environment.TickCount; - - // wait until either 1) the specified port is available or 2) the specified amount of time has passed - while (Environment.TickCount < now + WaitForPort && - CassiniNetworkUtils.GetAvailablePort(Port, Port, System.Net.IPAddress.Parse(IPAddress), true) != - Port) - { - Thread.Sleep(100); - } - - // is the port available? - if (CassiniNetworkUtils.GetAvailablePort(Port, Port, System.Net.IPAddress.Parse(IPAddress), true) != - Port) - { - throw new CassiniException(SR.ErrPortIsInUse, ErrorField.Port); - } - - - break; - default: - - throw new CassiniException(SR.ErrInvalidPortMode, ErrorField.None); - } - } - - - /// - /// Converts CommandLineArgument values to an IP address if possible. - /// Throws Exception if not. - /// - /// - /// - /// - /// - /// If IPMode is invalid - /// If IPMode is 'Specific' and ipString is invalid - public static IPAddress ParseIP(IPMode ipmode, bool v6, string ipString) - { - IPAddress ip; - switch (ipmode) - { - case IPMode.Loopback: - - ip = v6 ? System.Net.IPAddress.IPv6Loopback : System.Net.IPAddress.Loopback; - break; - case IPMode.Any: - ip = v6 ? System.Net.IPAddress.IPv6Any : System.Net.IPAddress.Any; - break; - case IPMode.Specific: - - if (!System.Net.IPAddress.TryParse(ipString, out ip)) - { - throw new CassiniException(SR.ErrInvalidIPAddress, ErrorField.IPAddress); - } - break; - default: - throw new CassiniException(SR.ErrInvalidIPMode, ErrorField.None); - } - return ip; - } - } -} \ No newline at end of file diff --git a/CassiniDev/Misc/CommandLineParser.cs b/CassiniDev/Misc/CommandLineParser.cs deleted file mode 100644 index 0aa1bb4e1..000000000 --- a/CassiniDev/Misc/CommandLineParser.cs +++ /dev/null @@ -1,1585 +0,0 @@ -// ********************************************************************************** -// CassiniDev - http://cassinidev.codeplex.com -// -// Copyright (c) 2010 Sky Sanders. All rights reserved. -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// This source code is subject to terms and conditions of the Microsoft Public -// License (Ms-PL). A copy of the license can be found in the license.txt file -// included in this distribution. -// -// You must not remove this notice, or any other, from this software. -// -// ********************************************************************************** - -#region - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Reflection; -using System.Text; -using System.Text.RegularExpressions; - -#endregion - -namespace CassiniDev -{ - /// - /// Parser for command line arguments. - /// - /// The parser specification is infered from the instance fields of the object - /// specified as the destination of the parse. - /// Valid argument types are: int, uint, string, bool, enums - /// Also argument types of Array of the above types are also valid. - /// - /// Error checking options can be controlled by adding a ArgumentAttribute - /// to the instance fields of the destination object. - /// - /// At most one field may be marked with the DefaultArgumentAttribute - /// indicating that arguments without a '-' or '/' prefix will be parsed as that argument. - /// - /// If not specified then the parser will infer default options for parsing each - /// instance field. The default long name of the argument is the field name. The - /// default short name is the first character of the long name. Long names and explicitly - /// specified short names must be unique. Default short names will be used provided that - /// the default short name does not conflict with a long name or an explicitly - /// specified short name. - /// - /// Arguments which are array types are collection arguments. Collection - /// arguments can be specified multiple times. - /// - /// - /// Usage - /// ----- - /// - /// Parsing command line arguments to a console application is a common problem. - /// This library handles the common task of reading arguments from a command line - /// and filling in the values in a type. - /// - /// To use this library, define a class whose fields represent the data that your - /// application wants to receive from arguments on the command line. Then call - /// CommandLine.ParseArguments() to fill the object with the data - /// from the command line. Each field in the class defines a command line argument. - /// The type of the field is used to validate the data read from the command line. - /// The name of the field defines the name of the command line option. - /// - /// The parser can handle fields of the following types: - /// - /// - string - /// - int - /// - uint - /// - bool - /// - enum - /// - array of the above type - /// - /// For example, suppose you want to read in the argument list for wc (word count). - /// wc takes three optional boolean arguments: -l, -w, and -c and a list of files. - /// - /// You could parse these arguments using the following code: - /// - /// class WCArguments - /// { - /// public bool lines; - /// public bool words; - /// public bool chars; - /// public string[] files; - /// } - /// - /// class WC - /// { - /// static void Main(string[] args) - /// { - /// if (CommandLine.ParseArgumentsWithUsage(args, parsedArgs)) - /// { - /// // insert application code here - /// } - /// } - /// } - /// - /// So you could call this aplication with the following command line to count - /// lines in the foo and bar files: - /// - /// wc.exe /lines /files:foo /files:bar - /// - /// The program will display the following usage message when bad command line - /// arguments are used: - /// - /// wc.exe -x - /// - /// Unrecognized command line argument '-x' - /// /lines[+|-] short form /l - /// /words[+|-] short form /w - /// /chars[+|-] short form /c - /// /files:<string> short form /f - /// @<file> Read response file for more options - /// - /// That was pretty easy. However, you realy want to omit the "/files:" for the - /// list of files. The details of field parsing can be controled using custom - /// attributes. The attributes which control parsing behaviour are: - /// - /// ArgumentAttribute - /// - controls short name, long name, required, allow duplicates, default value - /// and help text - /// DefaultArgumentAttribute - /// - allows omition of the "/name". - /// - This attribute is allowed on only one field in the argument class. - /// - /// So for the wc.exe program we want this: - /// - /// using System; - /// using Utilities; - /// - /// class WCArguments - /// { - /// [Argument(ArgumentType.AtMostOnce, HelpText="Count number of lines in the input text.")] - /// public bool lines; - /// [Argument(ArgumentType.AtMostOnce, HelpText="Count number of words in the input text.")] - /// public bool words; - /// [Argument(ArgumentType.AtMostOnce, HelpText="Count number of chars in the input text.")] - /// public bool chars; - /// [DefaultArgument(ArgumentType.MultipleUnique, HelpText="Input files to count.")] - /// public string[] files; - /// } - /// - /// class WC - /// { - /// static void Main(string[] args) - /// { - /// WCArguments parsedArgs = new WCArguments(); - /// if (CommandLine.ParseArgumentsWithUsage(args, parsedArgs)) - /// { - /// // insert application code here - /// } - /// } - /// } - /// - /// - /// - /// So now we have the command line we want: - /// - /// wc.exe /lines foo bar - /// - /// This will set lines to true and will set files to an array containing the - /// strings "foo" and "bar". - /// - /// The new usage message becomes: - /// - /// wc.exe -x - /// - /// Unrecognized command line argument '-x' - /// /lines[+|-] Count number of lines in the input text. (short form /l) - /// /words[+|-] Count number of words in the input text. (short form /w) - /// /chars[+|-] Count number of chars in the input text. (short form /c) - /// @<file> Read response file for more options - /// <files> Input files to count. (short form /f) - /// - /// If you want more control over how error messages are reported, how /help is - /// dealt with, etc you can instantiate the CommandLine.Parser class. - /// - /// - /// - /// Cheers, - /// Peter Hallam - /// C# Compiler Developer - /// Microsoft Corp. - /// - /// - /// - /// - /// Release Notes - /// ------------- - /// - /// 10/02/2002 Initial Release - /// 10/14/2002 Bug Fix - /// 01/08/2003 Bug Fix in @ include files - /// 10/23/2004 Added user specified help text, formatting of help text to - /// screen width. Added ParseHelp for /?. - /// 11/23/2004 Added support for default values. - /// 02/23/2005 Fix bug with short name and default arguments. - /// - /// 12/24/2009 sky: Added ushort as valid argument type. - /// 12/27/2009 sky: todo: expose out and err to enable use in forms app. - /// 12/29/2009 sky: added ArgumentsAttribute and GetGenericUsageString to allow attaching generic help text - /// 01/01/2010 sky: split classes into seperate files - /// 01/01/2010 sky: cleaned up Parser.cs - /// 05/22/2010 sky: major cleanup - more to come. - /// - public sealed class CommandLineParser - { - /// - /// The System Defined new line string. - /// - public const string NewLine = "\r\n"; - - private const int SpaceBeforeParam = 2; - - private const int StdOutputHandle = -11; - - private readonly Hashtable _argumentMap; - - private readonly ArrayList _arguments; - - private readonly Type _argumentSpecification; - - private readonly Argument _defaultArgument; - - private readonly ErrorReporter _reporter; - - /// - /// Don't ever call this. - /// - // ReSharper disable UnusedMember.Local - private CommandLineParser() - // ReSharper restore UnusedMember.Local - { - //noop - } - - /// - /// Creates a new command line argument parser. - /// - /// The type of object to parse. - /// The destination for parse errors. - public CommandLineParser(Type argumentSpecification, ErrorReporter reporter) - { - _argumentSpecification = argumentSpecification; - _reporter = reporter; - _arguments = new ArrayList(); - _argumentMap = new Hashtable(); - - foreach (FieldInfo field in argumentSpecification.GetFields()) - { - if (!field.IsStatic && !field.IsInitOnly && !field.IsLiteral) - { - ArgumentAttribute attribute = GetAttribute(field); - if (attribute is DefaultArgumentAttribute) - { - Debug.Assert(_defaultArgument == null); - _defaultArgument = new Argument(attribute, field, reporter); - } - else - { - _arguments.Add(new Argument(attribute, field, reporter)); - } - } - } - - // add explicit names to map - foreach (Argument argument in _arguments) - { - Debug.Assert(!_argumentMap.ContainsKey(argument.LongName)); - _argumentMap[argument.LongName] = argument; - if (argument.ExplicitShortName) - { - if (!string.IsNullOrEmpty(argument.ShortName)) - { - Debug.Assert(!_argumentMap.ContainsKey(argument.ShortName)); - _argumentMap[argument.ShortName] = argument; - } - else - { - argument.ClearShortName(); - } - } - } - - // add implicit names which don't collide to map - foreach (Argument argument in _arguments) - { - if (!argument.ExplicitShortName) - { - if (!string.IsNullOrEmpty(argument.ShortName) && !_argumentMap.ContainsKey(argument.ShortName)) - _argumentMap[argument.ShortName] = argument; - else - argument.ClearShortName(); - } - } - } - - /// - /// Does this parser have a default argument. - /// - /// Does this parser have a default argument. - public bool HasDefaultArgument - { - get { return _defaultArgument != null; } - } - - /// - /// Returns a Usage string for command line argument parsing. - /// Use ArgumentAttributes to control parsing behaviour. - /// Formats the output to the width of the current console window. - /// - /// The type of the arguments to display usage for. - /// Printable string containing a user friendly description of command line arguments. - public static string ArgumentsUsage(Type argumentType) - { - int screenWidth = GetConsoleWindowWidth(); - if (screenWidth == 0) - screenWidth = 80; - return ArgumentsUsage(argumentType, screenWidth); - } - - /// - /// Returns a Usage string for command line argument parsing. - /// Use ArgumentAttributes to control parsing behaviour. - /// - /// The type of the arguments to display usage for. - /// The number of columns to format the output to. - /// Printable string containing a user friendly description of command line arguments. - public static string ArgumentsUsage(Type argumentType, int columns) - { - return (new CommandLineParser(argumentType, null)).GetUsageString(columns); - } - - /// - /// Returns the number of columns in the current console window - /// - /// Returns the number of columns in the current console window - public static int GetConsoleWindowWidth() - { - Interop.CONSOLE_SCREEN_BUFFER_INFO csbi = new Interop.CONSOLE_SCREEN_BUFFER_INFO(); - -#pragma warning disable 168 - int rc = Interop.GetConsoleScreenBufferInfo(Interop.GetStdHandle(StdOutputHandle), ref csbi); -#pragma warning restore 168 - int screenWidth = csbi.dwSize.x; - return screenWidth; - } - - /// - /// A user firendly usage string describing the command line argument syntax. - /// - public string GetUsageString(int screenWidth) - { - ArgumentHelpStrings[] strings = GetAllHelpStrings(); - - int maxParamLen = 0; - foreach (ArgumentHelpStrings helpString in strings) - { - maxParamLen = Math.Max(maxParamLen, helpString.syntax.Length); - } - - const int minimumNumberOfCharsForHelpText = 10; - const int minimumHelpTextColumn = 5; - const int minimumScreenWidth = minimumHelpTextColumn + minimumNumberOfCharsForHelpText; - - int idealMinimumHelpTextColumn = maxParamLen + SpaceBeforeParam; - screenWidth = Math.Max(screenWidth, minimumScreenWidth); - int helpTextColumn = screenWidth < (idealMinimumHelpTextColumn + minimumNumberOfCharsForHelpText) - ? minimumHelpTextColumn - : idealMinimumHelpTextColumn; - - const string newLine = "\n"; - StringBuilder builder = new StringBuilder(); - - // 01/01/2010 sky - string genericUsage = GetGenericUsageString(_argumentSpecification, screenWidth); - if (!string.IsNullOrEmpty(genericUsage)) - { - builder.AppendLine(genericUsage); - } - - foreach (ArgumentHelpStrings helpStrings in strings) - { - // add syntax string - int syntaxLength = helpStrings.syntax.Length; - builder.Append(helpStrings.syntax); - - // start help text on new line if syntax string is too long - int currentColumn = syntaxLength; - if (syntaxLength >= helpTextColumn) - { - builder.Append(newLine); - currentColumn = 0; - } - - // add help text broken on spaces - int charsPerLine = screenWidth - helpTextColumn; - int index = 0; - while (index < helpStrings.help.Length) - { - // tab to start column - builder.Append(' ', helpTextColumn - currentColumn); - currentColumn = helpTextColumn; - - // find number of chars to display on this line - int endIndex = index + charsPerLine; - if (endIndex >= helpStrings.help.Length) - { - // rest of text fits on this line - endIndex = helpStrings.help.Length; - } - else - { - endIndex = helpStrings.help.LastIndexOf(' ', endIndex - 1, - Math.Min(endIndex - index, charsPerLine)); - if (endIndex <= index) - { - // no spaces on this line, append full set of chars - endIndex = index + charsPerLine; - } - } - - // add chars - builder.Append(helpStrings.help, index, endIndex - index); - index = endIndex; - - // do new line - AddNewLine(newLine, builder, ref currentColumn); - - // don't start a new line with spaces - while (index < helpStrings.help.Length && helpStrings.help[index] == ' ') - index++; - } - - // add newline if there's no help text - if (helpStrings.help.Length == 0) - { - builder.Append(newLine); - } - } - - return builder.ToString(); - } - - /// - /// Searches a StringBuilder for a character - /// - /// The text to search. - /// The character value to search for. - /// The index to stat searching at. - /// The index of the first occurence of value or -1 if it is not found. - public static int IndexOf(StringBuilder text, char value, int startIndex) - { - for (int index = startIndex; index < text.Length; index++) - { - if (text[index] == value) - return index; - } - - return -1; - } - - /// - /// Searches a StringBuilder for a character in reverse - /// - /// The text to search. - /// The character to search for. - /// The index to start the search at. - /// The index of the last occurence of value in text or -1 if it is not found. - public static int LastIndexOf(StringBuilder text, char value, int startIndex) - { - for (int index = Math.Min(startIndex, text.Length - 1); index >= 0; index--) - { - if (text[index] == value) - return index; - } - - return -1; - } - - /// - /// Parses an argument list. - /// - /// The arguments to parse. - /// The destination of the parsed arguments. - /// true if no parse errors were encountered. - public bool Parse(string[] args, object destination) - { - bool hadError = ParseArgumentList(args, destination); - - // check for missing required arguments - foreach (Argument arg in _arguments) - { - hadError |= arg.Finish(destination); - } - if (_defaultArgument != null) - { - hadError |= _defaultArgument.Finish(destination); - } - - return !hadError; - } - - /// - /// Parses Command Line Arguments. - /// Errors are output on Console.Error. - /// Use ArgumentAttributes to control parsing behaviour. - /// - /// The actual arguments. - /// The resulting parsed arguments. - /// true if no errors were detected. - public static bool ParseArguments(string[] arguments, object destination) - { - return ParseArguments(arguments, destination, Console.Error.WriteLine); - } - - /// - /// Parses Command Line Arguments. - /// Use ArgumentAttributes to control parsing behaviour. - /// - /// The actual arguments. - /// The resulting parsed arguments. - /// The destination for parse errors. - /// true if no errors were detected. - public static bool ParseArguments(string[] arguments, object destination, ErrorReporter reporter) - { - CommandLineParser parser = new CommandLineParser(destination.GetType(), reporter); - return parser.Parse(arguments, destination); - } - - /// - /// Parses Command Line Arguments. Displays usage message to Console.Out - /// if /?, /help or invalid arguments are encounterd. - /// Errors are output on Console.Error. - /// Use ArgumentAttributes to control parsing behaviour. - /// - /// The actual arguments. - /// The resulting parsed arguments. - /// true if no errors were detected. - public static bool ParseArgumentsWithUsage(string[] arguments, object destination) - { - if (ParseHelp(arguments) || !ParseArguments(arguments, destination)) - { - // error encountered in arguments. Display usage message - Console.Write(ArgumentsUsage(destination.GetType())); - return false; - } - - return true; - } - - /// - /// Checks if a set of arguments asks for help. - /// - /// Args to check for help. - /// Returns true if args contains /? or /help. - public static bool ParseHelp(string[] args) - { - CommandLineParser helpParser = new CommandLineParser(typeof (HelpArgument), NullErrorReporter); - HelpArgument helpArgument = new HelpArgument(); - helpParser.Parse(args, helpArgument); - return helpArgument.help; - } - - private static void AddNewLine(string newLine, StringBuilder builder, ref int currentColumn) - { - builder.Append(newLine); - currentColumn = 0; - } - - private static object DefaultValue(ArgumentAttribute attribute) - { - return (attribute == null || !attribute.HasDefaultValue) ? null : attribute.DefaultValue; - } - - private static Type ElementType(FieldInfo field) - { - return IsCollectionType(field.FieldType) ? field.FieldType.GetElementType() : null; - } - - private static bool ExplicitShortName(ArgumentAttribute attribute) - { - return (attribute != null && !attribute.DefaultShortName); - } - - private static ArgumentType Flags(ArgumentAttribute attribute, FieldInfo field) - { - if (attribute != null) - { - return attribute.Type; - } - - return IsCollectionType(field.FieldType) ? ArgumentType.MultipleUnique : ArgumentType.AtMostOnce; - } - - private ArgumentHelpStrings[] GetAllHelpStrings() - { - ArgumentHelpStrings[] strings = new ArgumentHelpStrings[NumberOfParametersToDisplay()]; - - int index = 0; - foreach (Argument arg in _arguments) - { - strings[index] = GetHelpStrings(arg); - index++; - } - strings[index++] = new ArgumentHelpStrings("@", "Read response file for more options"); - if (_defaultArgument != null) - { - strings[index] = GetHelpStrings(_defaultArgument); - } - - return strings; - } - - private static ArgumentAttribute GetAttribute(ICustomAttributeProvider field) - { - object[] attributes = field.GetCustomAttributes(typeof (ArgumentAttribute), false); - if (attributes.Length == 1) - return (ArgumentAttribute) attributes[0]; - - Debug.Assert(attributes.Length == 0); - return null; - } - - /// - /// 01/01/2010 sky - /// - private static string GetGenericUsageString(ICustomAttributeProvider type, int cols) - { - object[] attributes = type.GetCustomAttributes(typeof (ArgumentsAttribute), true); - if (attributes.Length == 0 || !((ArgumentsAttribute) attributes[0]).HasHelpText) - { - return string.Empty; - } - - StringBuilder sb = new StringBuilder(); - string usage = ((ArgumentsAttribute) attributes[0]).HelpText; - // simple width formatter - string[] lines = Regex.Split(usage, Environment.NewLine); - foreach (string line in lines) - { - string[] words = Regex.Split(line, " "); - string currentLine = string.Empty; - foreach (string word in words) - { - if (currentLine.Length + word.Length + 1 > cols) - { - // start new line - sb.AppendLine(currentLine); - currentLine = word + " "; - } - else - { - currentLine += (word + " "); - } - } - sb.AppendLine(currentLine); - sb.Append(Environment.NewLine); - } - return sb.ToString(); - } - - private static ArgumentHelpStrings GetHelpStrings(Argument arg) - { - return new ArgumentHelpStrings(arg.SyntaxHelp, arg.FullHelpText); - } - - private static bool HasHelpText(ArgumentAttribute attribute) - { - return (attribute != null && attribute.HasHelpText); - } - - private static string HelpText(ArgumentAttribute attribute) - { - return attribute == null ? null : attribute.HelpText; - } - - private static bool IsCollectionType(Type type) - { - return type.IsArray; - } - - private static bool IsValidElementType(Type type) - { - //SKY:12/25/09 - added ushort - return type != null && ( - type == typeof (int) || - type == typeof (uint) || - type == typeof (ushort) || - type == typeof (string) || - type == typeof (bool) || - type.IsEnum); - } - - private bool LexFileArguments(string fileName, out string[] argumentsOut) - { - string args; - - try - { - using (FileStream file = new FileStream(fileName, FileMode.Open, FileAccess.Read)) - { - args = (new StreamReader(file)).ReadToEnd(); - } - } - catch (Exception e) - { - _reporter(string.Format("Error: Can't open command line argument file '{0}' : '{1}'", fileName, - e.Message)); - argumentsOut = null; - return false; - } - - bool hadError = false; - ArrayList argArray = new ArrayList(); - StringBuilder currentArg = new StringBuilder(); - bool inQuotes = false; - int index = 0; - - // while (index < args.Length) - try - { - while (true) - { - // skip whitespace - while (char.IsWhiteSpace(args[index])) - { - index += 1; - } - - // # - comment to end of line - if (args[index] == '#') - { - index += 1; - while (args[index] != '\n') - { - index += 1; - } - continue; - } - - // do one argument - do - { - if (args[index] == '\\') - { - int cSlashes = 1; - index += 1; - while (index == args.Length && args[index] == '\\') - { - cSlashes += 1; - } - - if (index == args.Length || args[index] != '"') - { - currentArg.Append('\\', cSlashes); - } - else - { - currentArg.Append('\\', (cSlashes >> 1)); - if (0 != (cSlashes & 1)) - { - currentArg.Append('"'); - } - else - { - inQuotes = !inQuotes; - } - } - } - else if (args[index] == '"') - { - inQuotes = !inQuotes; - index += 1; - } - else - { - currentArg.Append(args[index]); - index += 1; - } - } while (!char.IsWhiteSpace(args[index]) || inQuotes); - argArray.Add(currentArg.ToString()); - currentArg.Length = 0; - } - } - catch (IndexOutOfRangeException) - { - // got EOF - if (inQuotes) - { - _reporter(string.Format("Error: Unbalanced '\"' in command line argument file '{0}'", fileName)); - hadError = true; - } - else if (currentArg.Length > 0) - { - // valid argument can be terminated by EOF - argArray.Add(currentArg.ToString()); - } - } - - argumentsOut = (string[]) argArray.ToArray(typeof (string)); - return hadError; - } - - private static string LongName(ArgumentAttribute attribute, FieldInfo field) - { - return (attribute == null || attribute.DefaultLongName) ? field.Name : attribute.LongName; - } - - private static void NullErrorReporter(string message) - { - } - - private int NumberOfParametersToDisplay() - { - int numberOfParameters = _arguments.Count + 1; - if (HasDefaultArgument) - { - numberOfParameters += 1; - } - return numberOfParameters; - } - - /// - /// Parses an argument list into an object - /// - /// - /// - /// true if an error occurred - private bool ParseArgumentList(IEnumerable args, object destination) - { - bool hadError = false; - if (args != null) - { - foreach (string argument in args) - { - if (argument.Length > 0) - { - switch (argument[0]) - { - case '-': - case '/': - int endIndex = argument.IndexOfAny(new[] {':', '+', '-'}, 1); - string option = argument.Substring(1, - endIndex == -1 ? argument.Length - 1 : endIndex - 1); - string optionArgument; - if (option.Length + 1 == argument.Length) - { - optionArgument = null; - } - else if (argument.Length > 1 + option.Length && argument[1 + option.Length] == ':') - { - optionArgument = argument.Substring(option.Length + 2); - } - else - { - optionArgument = argument.Substring(option.Length + 1); - } - - Argument arg = (Argument) _argumentMap[option]; - if (arg == null) - { - ReportUnrecognizedArgument(argument); - hadError = true; - } - else - { - hadError |= !arg.SetValue(optionArgument, destination); - } - break; - case '@': - string[] nestedArguments; - hadError |= LexFileArguments(argument.Substring(1), out nestedArguments); - hadError |= ParseArgumentList(nestedArguments, destination); - break; - default: - if (_defaultArgument != null) - { - hadError |= !_defaultArgument.SetValue(argument, destination); - } - else - { - ReportUnrecognizedArgument(argument); - hadError = true; - } - break; - } - } - } - } - - return hadError; - } - - private void ReportUnrecognizedArgument(string argument) - { - _reporter(string.Format("Unrecognized command line argument '{0}'", argument)); - } - - private static string ShortName(ArgumentAttribute attribute, FieldInfo field) - { - if (attribute is DefaultArgumentAttribute) - return null; - if (!ExplicitShortName(attribute)) - return LongName(attribute, field).Substring(0, 1); - return attribute.ShortName; - } - - #region Nested type: Argument - - [DebuggerDisplay("Name = {LongName}")] - private class Argument - { - private readonly ArrayList _collectionValues; - private readonly object _defaultValue; - private readonly Type _elementType; - private readonly bool _explicitShortName; - private readonly FieldInfo _field; - private readonly ArgumentType _flags; - private readonly bool _hasHelpText; - private readonly string _helpText; - private readonly bool _isDefault; - private readonly string _longName; - private readonly ErrorReporter _reporter; - private bool _seenValue; - private string _shortName; - - public Argument(ArgumentAttribute attribute, FieldInfo field, ErrorReporter reporter) - { - _longName = CommandLineParser.LongName(attribute, field); - _explicitShortName = CommandLineParser.ExplicitShortName(attribute); - _shortName = CommandLineParser.ShortName(attribute, field); - _hasHelpText = CommandLineParser.HasHelpText(attribute); - _helpText = CommandLineParser.HelpText(attribute); - _defaultValue = CommandLineParser.DefaultValue(attribute); - _elementType = ElementType(field); - _flags = Flags(attribute, field); - _field = field; - _seenValue = false; - _reporter = reporter; - _isDefault = attribute != null && attribute is DefaultArgumentAttribute; - - if (IsCollection) - { - _collectionValues = new ArrayList(); - } - - Debug.Assert(!string.IsNullOrEmpty(_longName)); - Debug.Assert(!_isDefault || !ExplicitShortName); - Debug.Assert(!IsCollection || AllowMultiple, "Collection arguments must have allow multiple"); - Debug.Assert(!Unique || IsCollection, "Unique only applicable to collection arguments"); - Debug.Assert(IsValidElementType(Type) || IsCollectionType(Type)); - Debug.Assert((IsCollection && IsValidElementType(_elementType)) || - (!IsCollection && _elementType == null)); - Debug.Assert(!(IsRequired && HasDefaultValue), "Required arguments cannot have default value"); - Debug.Assert(!HasDefaultValue || (_defaultValue.GetType() == field.FieldType), - "Type of default value must match field type"); - } - - private Type ValueType - { - get { return IsCollection ? _elementType : Type; } - } - - public string LongName - { - get { return _longName; } - } - - public bool ExplicitShortName - { - get { return _explicitShortName; } - } - - public string ShortName - { - get { return _shortName; } - } - - private bool HasShortName - { - get { return _shortName != null; } - } - - private bool HasHelpText - { - get { return _hasHelpText; } - } - - private string HelpText - { - get { return _helpText; } - } - - private object DefaultValue - { - get { return _defaultValue; } - } - - private bool HasDefaultValue - { - get { return null != _defaultValue; } - } - - public string FullHelpText - { - get - { - StringBuilder builder = new StringBuilder(); - if (HasHelpText) - { - builder.Append(HelpText); - } - if (HasDefaultValue) - { - if (builder.Length > 0) - builder.Append(" "); - builder.Append("Default value:'"); - AppendValue(builder, DefaultValue); - builder.Append('\''); - } - if (HasShortName) - { - if (builder.Length > 0) - builder.Append(" "); - builder.Append("(short form /"); - builder.Append(ShortName); - builder.Append(")"); - } - return builder.ToString(); - } - } - - public string SyntaxHelp - { - get - { - StringBuilder builder = new StringBuilder(); - - if (IsDefault) - { - builder.Append("<"); - builder.Append(LongName); - builder.Append(">"); - } - else - { - builder.Append("/"); - builder.Append(LongName); - Type valueType = ValueType; - if (valueType == typeof (int)) - { - builder.Append(":"); - } - else if (valueType == typeof (uint)) - { - builder.Append(":"); - } - else if (valueType == typeof (bool)) - { - builder.Append("[+|-]"); - } - else if (valueType == typeof (string)) - { - builder.Append(":"); - } - else - { - Debug.Assert(valueType.IsEnum); - - builder.Append(":{"); - bool first = true; - foreach (FieldInfo info in valueType.GetFields()) - { - if (info.IsStatic) - { - if (first) - first = false; - else - builder.Append('|'); - builder.Append(info.Name); - } - } - builder.Append('}'); - } - } - - return builder.ToString(); - } - } - - private bool IsRequired - { - get { return 0 != (_flags & ArgumentType.Required); } - } - - private bool SeenValue - { - get { return _seenValue; } - } - - private bool AllowMultiple - { - get { return 0 != (_flags & ArgumentType.Multiple); } - } - - private bool Unique - { - get { return 0 != (_flags & ArgumentType.Unique); } - } - - private Type Type - { - get { return _field.FieldType; } - } - - private bool IsCollection - { - get { return IsCollectionType(Type); } - } - - private bool IsDefault - { - get { return _isDefault; } - } - - public bool Finish(object destination) - { - if (SeenValue) - { - if (IsCollection) - { - _field.SetValue(destination, _collectionValues.ToArray(_elementType)); - } - } - else - { - if (HasDefaultValue) - { - _field.SetValue(destination, DefaultValue); - } - } - - return ReportMissingRequiredArgument(); - } - - private bool ReportMissingRequiredArgument() - { - if (IsRequired && !SeenValue) - { - if (IsDefault) - _reporter(string.Format("Missing required argument '<{0}>'.", LongName)); - else - _reporter(string.Format("Missing required argument '/{0}'.", LongName)); - return true; - } - return false; - } - - private void ReportDuplicateArgumentValue(string value) - { - _reporter(string.Format("Duplicate '{0}' argument '{1}'", LongName, value)); - } - - public bool SetValue(string value, object destination) - { - if (SeenValue && !AllowMultiple) - { - _reporter(string.Format("Duplicate '{0}' argument", LongName)); - return false; - } - _seenValue = true; - - object newValue; - - if (!ParseValue(ValueType, value, out newValue)) - { - return false; - } - - if (IsCollection) - { - if (Unique && _collectionValues.Contains(newValue)) - { - ReportDuplicateArgumentValue(value); - return false; - } - _collectionValues.Add(newValue); - } - else - { - _field.SetValue(destination, newValue); - } - - return true; - } - - private void ReportBadArgumentValue(string value) - { - _reporter(string.Format("'{0}' is not a valid value for the '{1}' command line option", value, LongName)); - } - - private bool ParseValue(Type type, string stringData, out object value) - { - // null is only valid for bool variables - // empty string is never valid - if (!string.IsNullOrEmpty(stringData) || type == typeof (bool)) - { - try - { - do //omed loop - { - if (type == typeof (string)) - { - value = stringData; - return true; - } - - if (type == typeof (bool)) - { - if (stringData == null || stringData == "+") - { - value = true; - return true; - } - - if (stringData == "-") - { - value = false; - return true; - } - break; - } - - // from this point on, a null or empty string is invalid - if (string.IsNullOrEmpty(stringData)) - { - break; - } - - if (type == typeof (int)) - { - value = int.Parse(stringData); - return true; - } - - if (type == typeof (uint)) - { - value = int.Parse(stringData); - return true; - } - - //SKY:12/25/09 - added ushort - if (type == typeof (ushort)) - { - value = ushort.Parse(stringData); - return true; - } - - Debug.Assert(type.IsEnum); - - bool valid = false; - - foreach (string name in Enum.GetNames(type)) - { - if (string.Compare(name, stringData, StringComparison.InvariantCultureIgnoreCase) == 0) - { - valid = true; - break; - } - } - if (valid) - { - value = Enum.Parse(type, stringData, true); - return true; - } - } while (false); - } - // ReSharper disable EmptyGeneralCatchClause - catch - // ReSharper restore EmptyGeneralCatchClause - { - // catch parse errors - } - } - - ReportBadArgumentValue(stringData); - value = null; - return false; - } - - private static void AppendValue(StringBuilder builder, object value) - { - //SKY:12/25/09 - add ushort - if (value is string || value is int || value is uint || value is ushort || value.GetType().IsEnum) - { - builder.Append(value.ToString()); - } - else if (value is bool) - { - builder.Append((bool) value ? "+" : "-"); - } - else - { - bool first = true; - foreach (object o in (Array) value) - { - if (!first) - { - builder.Append(", "); - } - AppendValue(builder, o); - first = false; - } - } - } - - public void ClearShortName() - { - _shortName = null; - } - } - - #endregion - - #region Nested type: ArgumentHelpStrings - - private struct ArgumentHelpStrings - { - public readonly string help; - public readonly string syntax; - - public ArgumentHelpStrings(string syntax, string help) - { - this.syntax = syntax; - this.help = help; - } - } - - #endregion - - #region Nested type: HelpArgument - - private class HelpArgument - { - [Argument(ArgumentType.AtMostOnce, ShortName = "?")] public bool help; - } - - #endregion - } - - /// - /// A delegate used in error reporting. - /// - public delegate void ErrorReporter(string message); - - /// - /// Indicates that this argument is the default argument. - /// '/' or '-' prefix only the argument value is specified. - /// The ShortName property should not be set for DefaultArgumentAttribute - /// instances. The LongName property is used for usage text only and - /// does not affect the usage of the argument. - /// - [AttributeUsage(AttributeTargets.Field)] - public class DefaultArgumentAttribute : ArgumentAttribute - { - /// - /// Indicates that this argument is the default argument. - /// - /// Specifies the error checking to be done on the argument. - public DefaultArgumentAttribute(ArgumentType type) - : base(type) - { - } - } - - /// - /// Used to control parsing of command line arguments. - /// - [Flags] - public enum ArgumentType - { - /// - /// Indicates that this field is required. An error will be displayed - /// if it is not present when parsing arguments. - /// - Required = 0x01, - /// - /// Only valid in conjunction with Multiple. - /// Duplicate values will result in an error. - /// - Unique = 0x02, - /// - /// Inidicates that the argument may be specified more than once. - /// Only valid if the argument is a collection - /// - Multiple = 0x04, - - /// - /// The default type for non-collection arguments. - /// The argument is not required, but an error will be reported if it is specified more than once. - /// - AtMostOnce = 0x00, - - /// - /// For non-collection arguments, when the argument is specified more than - /// once no error is reported and the value of the argument is the last - /// value which occurs in the argument list. - /// - LastOccurenceWins = Multiple, - - /// - /// The default type for collection arguments. - /// The argument is permitted to occur multiple times, but duplicate - /// values will cause an error to be reported. - /// - MultipleUnique = Multiple | Unique, - } - - /// - /// Allows attaching generic help text to arguments class - /// - /// 12/29/09 sky: added - /// - [AttributeUsage(AttributeTargets.Class)] - public class ArgumentsAttribute : Attribute - { - private string _helpText; - - /// - /// Returns true if the argument has help text specified. - /// - public bool HasHelpText - { - get { return null != _helpText; } - } - - /// - /// The help text for the argument. - /// - public string HelpText - { - get { return _helpText; } - set { _helpText = value; } - } - } - - /// - /// Allows control of command line parsing. - /// Attach this attribute to instance fields of types used - /// as the destination of command line argument parsing. - /// - [AttributeUsage(AttributeTargets.Field)] - public class ArgumentAttribute : Attribute - { - #region Fields - - private readonly ArgumentType _type; - private object _defaultValue; - - private string _helpText; - - private string _longName; - - private string _shortName; - - #endregion - - #region Constructors - - /// - /// Allows control of command line parsing. - /// - /// Specifies the error checking to be done on the argument. - public ArgumentAttribute(ArgumentType type) - { - _type = type; - } - - #endregion - - #region Properties - - /// - /// Returns true if the argument did not have an explicit long name specified. - /// - public bool DefaultLongName - { - get { return null == _longName; } - } - - /// - /// Returns true if the argument did not have an explicit short name specified. - /// - public bool DefaultShortName - { - get { return null == _shortName; } - } - - /// - /// The default value of the argument. - /// - public object DefaultValue - { - get { return _defaultValue; } - set { _defaultValue = value; } - } - - /// - /// Returns true if the argument has a default value. - /// - public bool HasDefaultValue - { - get { return null != _defaultValue; } - } - - /// - /// Returns true if the argument has help text specified. - /// - public bool HasHelpText - { - get { return null != _helpText; } - } - - /// - /// The help text for the argument. - /// - public string HelpText - { - get { return _helpText; } - set { _helpText = value; } - } - - /// - /// The long name of the argument. - /// Set to null means use the default long name. - /// The long name for every argument must be unique. - /// It is an error to specify a long name of String.Empty. - /// - public string LongName - { - get - { - Debug.Assert(!DefaultLongName); - return _longName; - } - set - { - Debug.Assert(value != ""); - _longName = value; - } - } - - /// - /// The short name of the argument. - /// Set to null means use the default short name if it does not - /// conflict with any other parameter name. - /// Set to String.Empty for no short name. - /// This property should not be set for DefaultArgumentAttributes. - /// - public string ShortName - { - get { return _shortName; } - set - { - Debug.Assert(value == null || !(this is DefaultArgumentAttribute)); - _shortName = value; - } - } - - /// - /// The error checking to be done on the argument. - /// - public ArgumentType Type - { - get { return _type; } - } - - #endregion - } -} \ No newline at end of file diff --git a/CassiniDev/Misc/Common.cs b/CassiniDev/Misc/Common.cs deleted file mode 100644 index 6ba35d0cf..000000000 --- a/CassiniDev/Misc/Common.cs +++ /dev/null @@ -1,1783 +0,0 @@ -// ********************************************************************************** -// CassiniDev - http://cassinidev.codeplex.com -// -// Copyright (c) 2010 Sky Sanders. All rights reserved. -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// This source code is subject to terms and conditions of the Microsoft Public -// License (Ms-PL). A copy of the license can be found in the license.txt file -// included in this distribution. -// -// You must not remove this notice, or any other, from this software. -// -// ********************************************************************************** - -#region - -using System; -using System.Collections.Generic; -using System.Data; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Runtime.InteropServices; -using System.Text; -using System.Web.UI; - -#endregion - -namespace CassiniDev -{ - internal static class Common - { - public static string ConvertToHexView(this byte[] value, int numBytesPerRow) - { - if (value == null) return null; - - List hexSplit = BitConverter.ToString(value) - .Replace('-', ' ') - .Trim() - .SplitIntoChunks(numBytesPerRow*3) - .ToList(); - - int byteAddress = 0; - StringBuilder sb = new StringBuilder(); - - for (int i = 0; i < hexSplit.Count; i++) - { - sb.AppendLine(byteAddress.ToString("X4") + ":\t" + hexSplit[i]); - byteAddress += numBytesPerRow; - } - - return sb.ToString(); - } - - public static string GetAspVersion() - { - string version = null; - try - { - Type type = typeof (Page); - Assembly assembly = Assembly.GetAssembly(type); - - object[] customAttributes = assembly.GetCustomAttributes(typeof (AssemblyFileVersionAttribute), true); - if ((customAttributes != null) && (customAttributes.GetLength(0) > 0)) - { - version = ((AssemblyFileVersionAttribute) customAttributes[0]).Version; - } - else - { - version = assembly.GetName().Version.ToString(); - } - } - // ReSharper disable EmptyGeneralCatchClause - catch - // ReSharper restore EmptyGeneralCatchClause - { - } - return version; - } - - /// - /// CassiniDev FIX: #12506 - /// - /// - /// - public static string GetContentType(string fileName) - { - if (!File.Exists(fileName)) - { - return null; - } - - string contentType; - - FileInfo info = new FileInfo(fileName); - string extension = info.Extension.ToLowerInvariant(); - - switch (extension) - { - //NOTE: these are fallbacks - and should be refined as needed - // Only if the request does not already know - // the content-type will this switch be hit - meaning that - // served content-types for extensions listed here may not match - // as this method may not be polled. - - case ".svgz": - contentType = "image/svg+xml"; - break; - - // from registry - last resort - verified mappings follow - - case ".3g2": - contentType = "video/3gpp2"; - break; - case ".3gp": - contentType = "video/3gpp"; - break; - case ".3gp2": - contentType = "video/3gpp2"; - break; - case ".3gpp": - contentType = "video/3gpp"; - break; - case ".adt": - contentType = "audio/vnd.dlna.adts"; - break; - case ".amr": - contentType = "audio/AMR"; - break; - case ".addin": - contentType = "text/xml"; - break; - case ".evr": - contentType = "audio/evrc-qcp"; - break; - case ".evrc": - contentType = "audio/evrc-qcp"; - break; - case ".ssisdeploymentmanifest": - contentType = "text/xml"; - break; - case ".xoml": - contentType = "text/plain"; - break; - case ".aac": - contentType = "audio/aac"; - break; - case ".ac3": - contentType = "audio/ac3"; - break; - case ".accda": - contentType = "application/msaccess"; - break; - case ".accdb": - contentType = "application/msaccess"; - break; - case ".accdc": - contentType = "application/msaccess"; - break; - case ".accde": - contentType = "application/msaccess"; - break; - case ".accdr": - contentType = "application/msaccess"; - break; - case ".accdt": - contentType = "application/msaccess"; - break; - case ".acrobatsecuritysettings": - contentType = "application/vnd.adobe.acrobat-security-settings"; - break; - case ".ad": - contentType = "text/plain"; - break; - case ".ade": - contentType = "application/msaccess"; - break; - case ".adobebridge": - contentType = "application/x-bridge-url"; - break; - case ".adp": - contentType = "application/msaccess"; - break; - case ".adts": - contentType = "audio/vnd.dlna.adts"; - break; - case ".amc": - contentType = "application/x-mpeg"; - break; - case ".application": - contentType = "application/x-ms-application"; - break; - case ".asa": - contentType = "application/xml"; - break; - case ".asax": - contentType = "application/xml"; - break; - case ".ascx": - contentType = "application/xml"; - break; - - case ".ashx": - contentType = "application/xml"; - break; - case ".asm": - contentType = "text/plain"; - break; - case ".asmx": - contentType = "application/xml"; - break; - case ".aspx": - contentType = "application/xml"; - break; - case ".awf": - contentType = "application/vnd.adobe.workflow"; - break; - case ".biz": - contentType = "text/xml"; - break; - - case ".c2r": - contentType = "text/vnd-ms.click2record+xml"; - break; - case ".caf": - contentType = "audio/x-caf"; - break; - - case ".cc": - contentType = "text/plain"; - break; - case ".cd": - contentType = "text/plain"; - break; - case ".cdda": - contentType = "audio/aiff"; - break; - - case ".config": - contentType = "application/xml"; - break; - case ".contact": - contentType = "text/x-ms-contact"; - break; - case ".coverage": - contentType = "application/xml"; - break; - case ".cpp": - contentType = "text/plain"; - break; - case ".cs": - contentType = "text/plain"; - break; - case ".csdproj": - contentType = "text/plain"; - break; - case ".csproj": - contentType = "text/plain"; - break; - - case ".csv": - contentType = "application/vnd.ms-excel"; - break; - case ".cur": - contentType = "text/plain"; - break; - case ".cxx": - contentType = "text/plain"; - break; - case ".datasource": - contentType = "application/xml"; - break; - case ".dbproj": - contentType = "text/plain"; - break; - case ".dcd": - contentType = "text/xml"; - break; - case ".dd": - contentType = "text/plain"; - break; - case ".def": - contentType = "text/plain"; - break; - - case ".design": - contentType = "image/design"; - break; - case ".dgml": - contentType = "application/xml"; - break; - case ".dib": - contentType = "image/bmp"; - break; - case ".dif": - contentType = "video/x-dv"; - break; - case ".docm": - contentType = "application/vnd.ms-word.document.macroEnabled.12"; - break; - case ".docx": - contentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document"; - break; - case ".dotm": - contentType = "application/vnd.ms-word.template.macroEnabled.12"; - break; - case ".dotx": - contentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.template"; - break; - case ".dsp": - contentType = "text/plain"; - break; - case ".dsprototype": - contentType = "text/plain"; - break; - case ".dsw": - contentType = "text/plain"; - break; - case ".dtd": - contentType = "application/xml-dtd"; - break; - case ".dtsconfig": - contentType = "text/xml"; - break; - case ".dv": - contentType = "video/x-dv"; - break; - case ".dwfx": - contentType = "model/vnd.dwfx+xps"; - break; - case ".easmx": - contentType = "model/vnd.easmx+xps"; - break; - case ".edrwx": - contentType = "model/vnd.edrwx+xps"; - break; - case ".eprtx": - contentType = "model/vnd.eprtx+xps"; - break; - case ".fdf": - contentType = "application/vnd.fdf"; - break; - case ".filters": - contentType = "Application/xml"; - break; - case ".flc": - contentType = "video/flc"; - break; - case ".fo": - contentType = "text/xml"; - break; - case ".fsscript": - contentType = "application/fsharp-script"; - break; - case ".fsx": - contentType = "application/fsharp-script"; - break; - case ".generictest": - contentType = "application/xml"; - break; - case ".group": - contentType = "text/x-ms-group"; - break; - case ".gsm": - contentType = "audio/x-gsm"; - break; - case ".hpp": - contentType = "text/plain"; - break; - case ".hxa": - contentType = "application/xml"; - break; - case ".hxc": - contentType = "application/xml"; - break; - case ".hxd": - contentType = "application/octet-stream"; - break; - case ".hxe": - contentType = "application/xml"; - break; - case ".hxf": - contentType = "application/xml"; - break; - case ".hxh": - contentType = "application/octet-stream"; - break; - case ".hxi": - contentType = "application/octet-stream"; - break; - case ".hxk": - contentType = "application/xml"; - break; - case ".hxq": - contentType = "application/octet-stream"; - break; - case ".hxr": - contentType = "application/octet-stream"; - break; - case ".hxs": - contentType = "application/octet-stream"; - break; - case ".hxt": - contentType = "application/xml"; - break; - case ".hxv": - contentType = "application/xml"; - break; - case ".hxw": - contentType = "application/octet-stream"; - break; - case ".hxx": - contentType = "text/plain"; - break; - case ".i": - contentType = "text/plain"; - break; - case ".idl": - contentType = "text/plain"; - break; - case ".inc": - contentType = "text/plain"; - break; - case ".inl": - contentType = "text/plain"; - break; - case ".ipproj": - contentType = "text/plain"; - break; - case ".iqy": - contentType = "text/x-ms-iqy"; - break; - case ".ismv": - contentType = "video/ismv"; - break; - case ".jsx": - contentType = "text/plain"; - break; - case ".jsxbin": - contentType = "text/plain"; - break; - case ".jtx": - contentType = "application/x-jtx+xps"; - break; - case ".ldd": - contentType = "text/plain"; - break; - case ".library-ms": - contentType = "application/windows-library+xml"; - break; - case ".loadtest": - contentType = "application/xml"; - break; - case ".lsaprototype": - contentType = "text/plain"; - break; - case ".lst": - contentType = "text/plain"; - break; - case ".m1v": - contentType = "video/mpeg"; - break; - case ".m2t": - contentType = "video/vnd.dlna.mpeg-tts"; - break; - case ".m2ts": - contentType = "video/vnd.dlna.mpeg-tts"; - break; - case ".m2v": - contentType = "video/mpeg"; - break; - case ".m4a": - contentType = "audio/mp4"; - break; - case ".m4b": - contentType = "audio/x-m4b"; - break; - case ".m4p": - contentType = "audio/x-m4p"; - break; - case ".m4v": - contentType = "video/x-m4v"; - break; - case ".mac": - contentType = "image/x-macpaint"; - break; - case ".mak": - contentType = "text/plain"; - break; - case ".map": - contentType = "text/plain"; - break; - case ".master": - contentType = "application/xml"; - break; - case ".mda": - contentType = "application/msaccess"; - break; - case ".mde": - contentType = "application/msaccess"; - break; - case ".mdp": - contentType = "text/plain"; - break; - case ".mfp": - contentType = "application/x-shockwave-flash"; - break; - case ".mk": - contentType = "text/plain"; - break; - case ".mod": - contentType = "video/mpeg"; - break; - case ".mp2v": - contentType = "video/mpeg"; - break; - case ".mp4": - contentType = "video/mp4"; - break; - case ".mp4v": - contentType = "video/mp4"; - break; - case ".mpf": - contentType = "application/vnd.ms-mediapackage"; - break; - case ".mqv": - contentType = "video/quicktime"; - break; - case ".mts": - contentType = "video/vnd.dlna.mpeg-tts"; - break; - case ".mtx": - contentType = "application/xml"; - break; - case ".mxp": - contentType = "application/x-mmxp"; - break; - case ".nix": - contentType = "application/x-mix-transfer"; - break; - case ".odc": - contentType = "text/x-ms-odc"; - break; - case ".odh": - contentType = "text/plain"; - break; - case ".odl": - contentType = "text/plain"; - break; - case ".odp": - contentType = "application/vnd.oasis.opendocument.presentation"; - break; - case ".ods": - contentType = "application/vnd.oasis.opendocument.spreadsheet"; - break; - case ".odt": - contentType = "application/vnd.oasis.opendocument.text"; - break; - case ".orderedtest": - contentType = "application/xml"; - break; - case ".osdx": - contentType = "application/opensearchdescription+xml"; - break; - case ".pct": - contentType = "image/pict"; - break; - case ".pcx": - contentType = "image/x-pcx"; - break; - - case ".pdfxml": - contentType = "application/vnd.adobe.pdfxml"; - break; - case ".pdx": - contentType = "application/vnd.adobe.pdx"; - break; - case ".pic": - contentType = "image/pict"; - break; - case ".pict": - contentType = "image/pict"; - break; - case ".pkgdef": - contentType = "text/plain"; - break; - case ".pkgundef": - contentType = "text/plain"; - break; - case ".png": - contentType = "image/png"; - break; - case ".pnt": - contentType = "image/x-macpaint"; - break; - case ".pntg": - contentType = "image/x-macpaint"; - break; - case ".potm": - contentType = "application/vnd.ms-powerpoint.template.macroEnabled.12"; - break; - case ".potx": - contentType = "application/vnd.openxmlformats-officedocument.presentationml.template"; - break; - case ".ppa": - contentType = "application/vnd.ms-powerpoint"; - break; - case ".ppam": - contentType = "application/vnd.ms-powerpoint.addin.macroEnabled.12"; - break; - case ".ppsm": - contentType = "application/vnd.ms-powerpoint.slideshow.macroEnabled.12"; - break; - case ".ppsx": - contentType = "application/vnd.openxmlformats-officedocument.presentationml.slideshow"; - break; - case ".pptm": - contentType = "application/vnd.ms-powerpoint.presentation.macroEnabled.12"; - break; - case ".pptx": - contentType = "application/vnd.openxmlformats-officedocument.presentationml.presentation"; - break; - case ".psc1": - contentType = "application/PowerShell"; - break; - case ".psess": - contentType = "application/xml"; - break; - case ".pwz": - contentType = "application/vnd.ms-powerpoint"; - break; - case ".pxr": - contentType = "image/pxr"; - break; - case ".qcp": - contentType = "audio/vnd.qcelp"; - break; - case ".qht": - contentType = "text/x-html-insertion"; - break; - case ".qhtm": - contentType = "text/x-html-insertion"; - break; - case ".qti": - contentType = "image/x-quicktime"; - break; - case ".qtif": - contentType = "image/x-quicktime"; - break; - case ".qtl": - contentType = "application/x-quicktimeplayer"; - break; - case ".rat": - contentType = "application/rat-file"; - break; - case ".raw": - contentType = "application/octet-stream"; - break; - - case ".rc": - contentType = "text/plain"; - break; - case ".rc2": - contentType = "text/plain"; - break; - case ".rct": - contentType = "text/plain"; - break; - case ".rdf": - contentType = "text/xml"; - break; - case ".rdlc": - contentType = "application/xml"; - break; - case ".rels": - contentType = "application/vnd.ms-package.relationships+xml"; - break; - case ".resx": - contentType = "application/xml"; - break; - case ".rgs": - contentType = "text/plain"; - break; - case ".rjt": - contentType = "application/vnd.rn-realsystem-rjt"; - break; - case ".rm": - contentType = "application/vnd.rn-realmedia"; - break; - case ".rmf": - contentType = "application/vnd.adobe.rmf"; - break; - case ".rmj": - contentType = "application/vnd.rn-realsystem-rmj"; - break; - case ".rmm": - contentType = "audio/x-pn-realaudio"; - break; - case ".rmp": - contentType = "application/vnd.rn-rn_music_package"; - break; - case ".rms": - contentType = "application/vnd.rn-realaudio-secure"; - break; - case ".rmvb": - contentType = "application/vnd.rn-realmedia-vbr"; - break; - case ".rmx": - contentType = "application/vnd.rn-realsystem-rmx"; - break; - case ".rnx": - contentType = "application/vnd.rn-realplayer"; - break; - case ".rp": - contentType = "image/vnd.rn-realpix"; - break; - case ".rpm": - contentType = "audio/x-pn-realaudio-plugin"; - break; - case ".rqy": - contentType = "text/x-ms-rqy"; - break; - case ".rsml": - contentType = "application/vnd.rn-rsml"; - break; - case ".rt": - contentType = "text/vnd.rn-realtext"; - break; - case ".rtsp": - contentType = "application/x-rtsp"; - break; - case ".ruleset": - contentType = "application/xml"; - break; - case ".rv": - contentType = "video/vnd.rn-realvideo"; - break; - case ".s": - contentType = "text/plain"; - break; - case ".sd": - contentType = "text/plain"; - break; - case ".sd2": - contentType = "audio/x-sd2"; - break; - case ".sdm": - contentType = "text/plain"; - break; - case ".sdmdocument": - contentType = "text/plain"; - break; - case ".sdp": - contentType = "application/sdp"; - break; - case ".sdv": - contentType = "video/sd-video"; - break; - case ".searchConnector-ms": - contentType = "application/windows-search-connector+xml"; - break; - case ".settings": - contentType = "application/xml"; - break; - case ".sgi": - contentType = "image/x-sgi"; - break; - case ".shtml": - contentType = "text/html"; - break; - case ".sitemap": - contentType = "application/xml"; - break; - case ".skin": - contentType = "application/xml"; - break; - case ".sldm": - contentType = "application/vnd.ms-powerpoint.slide.macroEnabled.12"; - break; - case ".sldx": - contentType = "application/vnd.openxmlformats-officedocument.presentationml.slide"; - break; - case ".slk": - contentType = "application/vnd.ms-excel"; - break; - case ".sln": - contentType = "text/plain"; - break; - case ".slupkg-ms": - contentType = "application/x-ms-license"; - break; - case ".smi": - contentType = "application/smil"; - break; - case ".smil": - contentType = "application/smil"; - break; - case ".snippet": - contentType = "application/xml"; - break; - case ".sol": - contentType = "text/plain"; - break; - case ".sor": - contentType = "text/plain"; - break; - case ".srf": - contentType = "text/plain"; - break; - case ".svc": - contentType = "application/xml"; - break; - case ".tga": - contentType = "image/x-targa"; - break; - case ".targa": - contentType = "image/x-targa"; - break; - case ".testrunconfig": - contentType = "application/xml"; - break; - case ".testsettings": - contentType = "application/xml"; - break; - case ".thmx": - contentType = "application/vnd.ms-officetheme"; - break; - case ".tlh": - contentType = "text/plain"; - break; - case ".tli": - contentType = "text/plain"; - break; - case ".trx": - contentType = "application/xml"; - break; - case ".ts": - contentType = "video/vnd.dlna.mpeg-tts"; - break; - case ".tts": - contentType = "video/vnd.dlna.mpeg-tts"; - break; - case ".user": - contentType = "text/plain"; - break; - case ".vb": - contentType = "text/plain"; - break; - case ".vbdproj": - contentType = "text/plain"; - break; - case ".vbproj": - contentType = "text/plain"; - break; - case ".vcproj": - contentType = "Application/xml"; - break; - case ".vcxproj": - contentType = "Application/xml"; - break; - case ".vddproj": - contentType = "text/plain"; - break; - case ".vdp": - contentType = "text/plain"; - break; - case ".vdproj": - contentType = "text/plain"; - break; - case ".vdx": - contentType = "application/vnd.visio"; - break; - case ".vscontent": - contentType = "application/xml"; - break; - case ".vsct": - contentType = "text/xml"; - break; - case ".vsd": - contentType = "application/vnd.visio"; - break; - case ".vsi": - contentType = "application/ms-vsi"; - break; - case ".vsix": - contentType = "application/vsix"; - break; - case ".vsixlangpack": - contentType = "text/xml"; - break; - case ".vsixmanifest": - contentType = "text/xml"; - break; - case ".vsl": - contentType = "application/vnd.visio"; - break; - case ".vsmdi": - contentType = "application/xml"; - break; - case ".vspscc": - contentType = "text/plain"; - break; - case ".vss": - contentType = "application/vnd.visio"; - break; - case ".vsscc": - contentType = "text/plain"; - break; - case ".vssettings": - contentType = "text/xml"; - break; - case ".vssscc": - contentType = "text/plain"; - break; - case ".vst": - contentType = "application/vnd.visio"; - break; - case ".vstemplate": - contentType = "text/xml"; - break; - case ".vsto": - contentType = "application/x-ms-vsto"; - break; - case ".vsu": - contentType = "application/vnd.visio"; - break; - case ".vsw": - contentType = "application/vnd.visio"; - break; - case ".vsx": - contentType = "application/vnd.visio"; - break; - case ".vtx": - contentType = "application/vnd.visio"; - break; - case ".wax": - contentType = "audio/x-ms-wax"; - break; - case ".wbk": - contentType = "application/msword"; - break; - case ".wdp": - contentType = "image/vnd.ms-photo"; - break; - case ".webtest": - contentType = "application/xml"; - break; - case ".wiq": - contentType = "application/xml"; - break; - case ".wiz": - contentType = "application/msword"; - break; - case ".wm": - contentType = "video/x-ms-wm"; - break; - case ".wma": - contentType = "audio/x-ms-wma"; - break; - case ".wmd": - contentType = "application/x-ms-wmd"; - break; - case ".wmv": - contentType = "video/x-ms-wmv"; - break; - case ".wmx": - contentType = "video/x-ms-wmx"; - break; - case ".wmz": - contentType = "application/x-ms-wmz"; - break; - case ".wpl": - contentType = "application/vnd.ms-wpl"; - break; - case ".wsc": - contentType = "text/scriptlet"; - break; - case ".wsdl": - contentType = "application/xml"; - break; - case ".wvx": - contentType = "video/x-ms-wvx"; - break; - case ".xaml": - contentType = "application/xaml+xml"; - break; - case ".xbap": - contentType = "application/x-ms-xbap"; - break; - case ".xbrl": - contentType = "text/xml"; - break; - case ".xdp": - contentType = "application/vnd.adobe.xdp+xml"; - break; - case ".xdr": - contentType = "application/xml"; - break; - case ".xej": - contentType = "application/xej+xml"; - break; - case ".xel": - contentType = "application/xel+xml"; - break; - case ".xesc": - contentType = "application/x-ms-wmv"; - break; - case ".xfd": - contentType = "application/vnd.adobe.xfd+xml"; - break; - case ".xfdf": - contentType = "application/vnd.adobe.xfdf"; - break; - case ".xht": - contentType = "application/xhtml+xml"; - break; - case ".xhtml": - contentType = "application/xhtml+xml"; - break; - case ".xlam": - contentType = "application/vnd.ms-excel.addin.macroEnabled.12"; - break; - case ".xlk": - contentType = "application/vnd.ms-excel"; - break; - case ".xll": - contentType = "application/vnd.ms-excel"; - break; - case ".xlsb": - contentType = "application/vnd.ms-excel.sheet.binary.macroEnabled.12"; - break; - case ".xlsm": - contentType = "application/vnd.ms-excel.sheet.macroEnabled.12"; - break; - case ".xlsx": - contentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; - break; - case ".xltm": - contentType = "application/vnd.ms-excel.template.macroEnabled.12"; - break; - case ".xltx": - contentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.template"; - break; - case ".xml": - contentType = "application/xml"; - break; - case ".xmta": - contentType = "application/xml"; - break; - case ".xpr": - contentType = "image/xpr"; - break; - case ".xps": - contentType = "application/vnd.ms-xpsdocument"; - break; - case ".xrm-ms": - contentType = "text/xml"; - break; - case ".xsc": - contentType = "application/xml"; - break; - case ".xsd": - contentType = "application/xml"; - break; - case ".xsl": - contentType = "text/xml"; - break; - case ".xslt": - contentType = "application/xml"; - break; - case ".xss": - contentType = "application/xml"; - break; - - // standard mappings from http://www.w3schools.com/media/media_mimeref.asp - - case ".323": - contentType = "text/h323"; - break; - case ".acx": - contentType = "application/internet-property-stream"; - break; - case ".ai": - contentType = "application/postscript"; - break; - case ".aif": - contentType = "audio/x-aiff"; - break; - case ".aifc": - contentType = "audio/x-aiff"; - break; - case ".aiff": - contentType = "audio/x-aiff"; - break; - case ".asf": - contentType = "video/x-ms-asf"; - break; - case ".asr": - contentType = "video/x-ms-asf"; - break; - case ".asx": - contentType = "video/x-ms-asf"; - break; - case ".au": - contentType = "audio/basic"; - break; - case ".avi": - contentType = "video/x-msvideo"; - break; - case ".axs": - contentType = "application/olescript"; - break; - case ".bas": - contentType = "text/plain"; - break; - case ".bcpio": - contentType = "application/x-bcpio"; - break; - case ".bin": - contentType = "application/octet-stream"; - break; - case ".bmp": - contentType = "image/bmp"; - break; - case ".c": - contentType = "text/plain"; - break; - case ".cat": - contentType = "application/vnd.ms-pkiseccat"; - break; - case ".cdf": - contentType = "application/x-cdf"; - break; - case ".cer": - contentType = "application/x-x509-ca-cert"; - break; - case ".class": - contentType = "application/octet-stream"; - break; - case ".clp": - contentType = "application/x-msclip"; - break; - case ".cmx": - contentType = "image/x-cmx"; - break; - case ".cod": - contentType = "image/cis-cod"; - break; - case ".cpio": - contentType = "application/x-cpio"; - break; - case ".crd": - contentType = "application/x-mscardfile"; - break; - case ".crl": - contentType = "application/pkix-crl"; - break; - case ".crt": - contentType = "application/x-x509-ca-cert"; - break; - case ".csh": - contentType = "application/x-csh"; - break; - case ".css": - contentType = "text/css"; - break; - case ".dcr": - contentType = "application/x-director"; - break; - case ".der": - contentType = "application/x-x509-ca-cert"; - break; - case ".dir": - contentType = "application/x-director"; - break; - case ".dll": - contentType = "application/x-msdownload"; - break; - case ".dms": - contentType = "application/octet-stream"; - break; - case ".doc": - contentType = "application/msword"; - break; - case ".dot": - contentType = "application/msword"; - break; - case ".dvi": - contentType = "application/x-dvi"; - break; - case ".dxr": - contentType = "application/x-director"; - break; - case ".eps": - contentType = "application/postscript"; - break; - case ".etx": - contentType = "text/x-setext"; - break; - case ".evy": - contentType = "application/envoy"; - break; - case ".exe": - contentType = "application/octet-stream"; - break; - case ".fif": - contentType = "application/fractals"; - break; - case ".flr": - contentType = "x-world/x-vrml"; - break; - case ".gif": - contentType = "image/gif"; - break; - case ".gtar": - contentType = "application/x-gtar"; - break; - case ".gz": - contentType = "application/x-gzip"; - break; - case ".h": - contentType = "text/plain"; - break; - case ".hdf": - contentType = "application/x-hdf"; - break; - case ".hlp": - contentType = "application/winhlp"; - break; - case ".hqx": - contentType = "application/mac-binhex40"; - break; - case ".hta": - contentType = "application/hta"; - break; - case ".htc": - contentType = "text/x-component"; - break; - case ".htm": - contentType = "text/html"; - break; - case ".html": - contentType = "text/html"; - break; - case ".htt": - contentType = "text/webviewhtml"; - break; - case ".ico": - contentType = "image/x-icon"; - break; - case ".ief": - contentType = "image/ief"; - break; - case ".iii": - contentType = "application/x-iphone"; - break; - case ".ins": - contentType = "application/x-internet-signup"; - break; - case ".isp": - contentType = "application/x-internet-signup"; - break; - case ".jfif": - contentType = "image/pipeg"; - break; - case ".jpe": - contentType = "image/jpeg"; - break; - case ".jpeg": - contentType = "image/jpeg"; - break; - case ".jpg": - contentType = "image/jpeg"; - break; - case ".js": - contentType = "application/x-javascript"; - break; - case ".latex": - contentType = "application/x-latex"; - break; - case ".lha": - contentType = "application/octet-stream"; - break; - case ".lsf": - contentType = "video/x-la-asf"; - break; - case ".lsx": - contentType = "video/x-la-asf"; - break; - case ".lzh": - contentType = "application/octet-stream"; - break; - case ".m13": - contentType = "application/x-msmediaview"; - break; - case ".m14": - contentType = "application/x-msmediaview"; - break; - case ".m3u": - contentType = "audio/x-mpegurl"; - break; - case ".man": - contentType = "application/x-troff-man"; - break; - case ".mdb": - contentType = "application/x-msaccess"; - break; - case ".me": - contentType = "application/x-troff-me"; - break; - case ".mht": - contentType = "message/rfc822"; - break; - case ".mhtml": - contentType = "message/rfc822"; - break; - case ".mid": - contentType = "audio/mid"; - break; - case ".mny": - contentType = "application/x-msmoney"; - break; - case ".mov": - contentType = "video/quicktime"; - break; - case ".movie": - contentType = "video/x-sgi-movie"; - break; - case ".mp2": - contentType = "video/mpeg"; - break; - case ".mp3": - contentType = "audio/mpeg"; - break; - case ".mpa": - contentType = "video/mpeg"; - break; - case ".mpe": - contentType = "video/mpeg"; - break; - case ".mpeg": - contentType = "video/mpeg"; - break; - case ".mpg": - contentType = "video/mpeg"; - break; - case ".mpp": - contentType = "application/vnd.ms-project"; - break; - case ".mpv2": - contentType = "video/mpeg"; - break; - case ".ms": - contentType = "application/x-troff-ms"; - break; - case ".msg": - contentType = "application/vnd.ms-outlook"; - break; - case ".mvb": - contentType = "application/x-msmediaview"; - break; - case ".nc": - contentType = "application/x-netcdf"; - break; - case ".nws": - contentType = "message/rfc822"; - break; - case ".oda": - contentType = "application/oda"; - break; - case ".p10": - contentType = "application/pkcs10"; - break; - case ".p12": - contentType = "application/x-pkcs12"; - break; - case ".p7b": - contentType = "application/x-pkcs7-certificates"; - break; - case ".p7c": - contentType = "application/x-pkcs7-mime"; - break; - case ".p7m": - contentType = "application/x-pkcs7-mime"; - break; - case ".p7r": - contentType = "application/x-pkcs7-certreqresp"; - break; - case ".p7s": - contentType = "application/x-pkcs7-signature"; - break; - case ".pbm": - contentType = "image/x-portable-bitmap"; - break; - case ".pdf": - contentType = "application/pdf"; - break; - case ".pfx": - contentType = "application/x-pkcs12"; - break; - case ".pgm": - contentType = "image/x-portable-graymap"; - break; - case ".pko": - contentType = "application/ynd.ms-pkipko"; - break; - case ".pma": - contentType = "application/x-perfmon"; - break; - case ".pmc": - contentType = "application/x-perfmon"; - break; - case ".pml": - contentType = "application/x-perfmon"; - break; - case ".pmr": - contentType = "application/x-perfmon"; - break; - case ".pmw": - contentType = "application/x-perfmon"; - break; - case ".pnm": - contentType = "image/x-portable-anymap"; - break; - case ".pot": - contentType = "application/vnd.ms-powerpoint"; - break; - case ".pot,": - contentType = "application/vnd.ms-powerpoint"; - break; - case ".ppm": - contentType = "image/x-portable-pixmap"; - break; - case ".pps": - contentType = "application/vnd.ms-powerpoint"; - break; - case ".ppt": - contentType = "application/vnd.ms-powerpoint"; - break; - case ".prf": - contentType = "application/pics-rules"; - break; - case ".ps": - contentType = "application/postscript"; - break; - case ".pub": - contentType = "application/x-mspublisher"; - break; - case ".qt": - contentType = "video/quicktime"; - break; - case ".ra": - contentType = "audio/x-pn-realaudio"; - break; - case ".ram": - contentType = "audio/x-pn-realaudio"; - break; - case ".ras": - contentType = "image/x-cmu-raster"; - break; - case ".rgb": - contentType = "image/x-rgb"; - break; - case ".rmi": - contentType = "audio/mid"; - break; - case ".roff": - contentType = "application/x-troff"; - break; - case ".rtf": - contentType = "application/rtf"; - break; - case ".rtx": - contentType = "text/richtext"; - break; - case ".scd": - contentType = "application/x-msschedule"; - break; - case ".sct": - contentType = "text/scriptlet"; - break; - case ".setpay": - contentType = "application/set-payment-initiation"; - break; - case ".setreg": - contentType = "application/set-registration-initiation"; - break; - case ".sh": - contentType = "application/x-sh"; - break; - case ".shar": - contentType = "application/x-shar"; - break; - case ".sit": - contentType = "application/x-stuffit"; - break; - case ".snd": - contentType = "audio/basic"; - break; - case ".spc": - contentType = "application/x-pkcs7-certificates"; - break; - case ".spl": - contentType = "application/futuresplash"; - break; - case ".src": - contentType = "application/x-wais-source"; - break; - case ".sst": - contentType = "application/vnd.ms-pkicertstore"; - break; - case ".stl": - contentType = "application/vnd.ms-pkistl"; - break; - case ".stm": - contentType = "text/html"; - break; - case ".sv4cpio": - contentType = "application/x-sv4cpio"; - break; - case ".sv4crc": - contentType = "application/x-sv4crc"; - break; - case ".svg": - contentType = "image/svg+xml"; - break; - case ".swf": - contentType = "application/x-shockwave-flash"; - break; - case ".t": - contentType = "application/x-troff"; - break; - case ".tar": - contentType = "application/x-tar"; - break; - case ".tcl": - contentType = "application/x-tcl"; - break; - case ".tex": - contentType = "application/x-tex"; - break; - case ".texi": - contentType = "application/x-texinfo"; - break; - case ".texinfo": - contentType = "application/x-texinfo"; - break; - case ".tgz": - contentType = "application/x-compressed"; - break; - case ".tif": - contentType = "image/tiff"; - break; - case ".tiff": - contentType = "image/tiff"; - break; - case ".tr": - contentType = "application/x-troff"; - break; - case ".trm": - contentType = "application/x-msterminal"; - break; - case ".tsv": - contentType = "text/tab-separated-values"; - break; - case ".txt": - contentType = "text/plain"; - break; - case ".uls": - contentType = "text/iuls"; - break; - case ".ustar": - contentType = "application/x-ustar"; - break; - case ".vcf": - contentType = "text/x-vcard"; - break; - case ".vrml": - contentType = "x-world/x-vrml"; - break; - case ".wav": - contentType = "audio/x-wav"; - break; - case ".wcm": - contentType = "application/vnd.ms-works"; - break; - case ".wdb": - contentType = "application/vnd.ms-works"; - break; - case ".wks": - contentType = "application/vnd.ms-works"; - break; - case ".wmf": - contentType = "application/x-msmetafile"; - break; - case ".wps": - contentType = "application/vnd.ms-works"; - break; - case ".wri": - contentType = "application/x-mswrite"; - break; - case ".wrl": - contentType = "x-world/x-vrml"; - break; - case ".wrz": - contentType = "x-world/x-vrml"; - break; - case ".xaf": - contentType = "x-world/x-vrml"; - break; - case ".xbm": - contentType = "image/x-xbitmap"; - break; - case ".xla": - contentType = "application/vnd.ms-excel"; - break; - case ".xlc": - contentType = "application/vnd.ms-excel"; - break; - case ".xlm": - contentType = "application/vnd.ms-excel"; - break; - case ".xls": - contentType = "application/vnd.ms-excel"; - break; - case ".xlt": - contentType = "application/vnd.ms-excel"; - break; - case ".xlw": - contentType = "application/vnd.ms-excel"; - break; - case ".xof": - contentType = "x-world/x-vrml"; - break; - case ".xpm": - contentType = "image/x-xpixmap"; - break; - case ".xwd": - contentType = "image/x-xwindowdump"; - break; - case ".z": - contentType = "application/x-compress"; - break; - case ".zip": - contentType = "application/zip"; - break; - - default: - // this should be used as a last resort only. i.e. svg files return text/xml - contentType = GetMimeFromFile(fileName); - break; - } - return contentType; - } - - public static T GetValueOrDefault(this IDataRecord row, string fieldName) - { - int ordinal = row.GetOrdinal(fieldName); - return row.GetValueOrDefault(ordinal); - } - - public static T GetValueOrDefault(this IDataRecord row, int ordinal) - { - return (T) (row.IsDBNull(ordinal) ? default(T) : row.GetValue(ordinal)); - } - - public static byte[] StreamToBytes(this Stream input) - { - int capacity = input.CanSeek ? (int) input.Length : 0; - using (MemoryStream output = new MemoryStream(capacity)) - { - int readLength; - byte[] buffer = new byte[4096]; - - do - { - readLength = input.Read(buffer, 0, buffer.Length); - output.Write(buffer, 0, readLength); - } while (readLength != 0); - - return output.ToArray(); - } - } - - /// - /// CassiniDev FIX: #12506 - /// - /// - /// - private static string GetMimeFromFile(string file) - { - IntPtr mimeout; - if (!File.Exists(file)) - return null; - //throw new FileNotFoundException(file + " not found"); - - int maxContent = (int) new FileInfo(file).Length; - if (maxContent > 4096) maxContent = 4096; - FileStream fs = File.OpenRead(file); - - byte[] buf = new byte[maxContent]; - fs.Read(buf, 0, maxContent); - fs.Close(); - int result = Interop.FindMimeFromData(IntPtr.Zero, file, buf, maxContent, null, 0, out mimeout, 0); - - if (result != 0) - throw Marshal.GetExceptionForHR(result); - string mime = Marshal.PtrToStringUni(mimeout); - Marshal.FreeCoTaskMem(mimeout); - return mime; - } - - private static IList SplitIntoChunks(this string text, int chunkSize) - { - List chunks = new List(); - int offset = 0; - while (offset < text.Length) - { - int size = Math.Min(chunkSize, text.Length - offset); - chunks.Add(text.Substring(offset, size)); - offset += size; - } - return chunks; - } - } - - public enum RunState - { - Idle = 0, - Running - } - - public enum PortMode - { - FirstAvailable = 0, - Specific - } - - public enum ErrorField - { - None, - ApplicationPath, - VirtualPath, - HostName, - IsAddHost, - IPAddress, - IPAddressAny, - IPAddressLoopBack, - Port, - PortRangeStart, - PortRangeEnd, - PortRange - } - - public enum IPMode - { - Loopback = 0, - Any, - Specific - } - - public enum RunMode - { - Server, - Hostsfile - } - - internal class CassiniException : Exception - { - public CassiniException(string message, ErrorField field, Exception innerException) - : base(message, innerException) - { - Field = field; - } - - public CassiniException(string message, ErrorField field) - : this(message, field, null) - { - } - - public ErrorField Field { get; set; } - } -} \ No newline at end of file diff --git a/CassiniDev/Misc/HostsFile.cs b/CassiniDev/Misc/HostsFile.cs deleted file mode 100644 index b8a828b7f..000000000 --- a/CassiniDev/Misc/HostsFile.cs +++ /dev/null @@ -1,118 +0,0 @@ -// ********************************************************************************** -// CassiniDev - http://cassinidev.codeplex.com -// -// Copyright (c) 2010 Sky Sanders. All rights reserved. -// -// This source code is subject to terms and conditions of the Microsoft Public -// License (Ms-PL). A copy of the license can be found in the license.txt file -// included in this distribution. -// -// You must not remove this notice, or any other, from this software. -// -// ********************************************************************************** - -#region - -using System; -using System.Diagnostics; -using System.IO; -using System.Reflection; -using System.Text.RegularExpressions; - -#endregion - -namespace CassiniDev -{ - public static class HostsFile - { - /// - /// - /// - /// - /// - /// - public static int AddHostEntry(string ipAddress, string hostname) - { - try - { - SetHostsEntry(true, ipAddress, hostname); - return 0; - } - // ReSharper disable EmptyGeneralCatchClause - catch - // ReSharper restore EmptyGeneralCatchClause - { - } - string executablePath = Assembly.GetExecutingAssembly().Location; - return StartElevated(executablePath, string.Format("Hostsfile /ah+ /h:{0} /i:{1}", hostname, ipAddress)); - } - - /// - /// - /// - /// - /// - /// - public static int RemoveHostEntry(string ipAddress, string hostname) - { - try - { - SetHostsEntry(false, ipAddress, hostname); - return 0; - } - // ReSharper disable EmptyGeneralCatchClause - catch - // ReSharper restore EmptyGeneralCatchClause - { - } - string executablePath = Assembly.GetExecutingAssembly().Location; - return StartElevated(executablePath, string.Format("Hostsfile /ah- /h:{0} /i:{1}", hostname, ipAddress)); - } - - private static void SetHostsEntry(bool addHost, string ipAddress, string hostname) - { - // limitation: while windows allows mulitple entries for a single host, we currently allow only one - string windir = Environment.GetEnvironmentVariable("SystemRoot") ?? @"c:\windows"; - string hostsFilePath = Path.Combine(windir, @"system32\drivers\etc\hosts"); - - string hostsFileContent = File.ReadAllText(hostsFilePath); - - hostsFileContent = Regex.Replace(hostsFileContent, - string.Format(@"\r\n^\s*[\d\w\.:]+\s{0}\s#\sadded\sby\scassini$", - hostname), "", RegexOptions.Multiline); - - if (addHost) - { - hostsFileContent += string.Format("\r\n{0} {1} # added by cassini", ipAddress, hostname); - } - - File.WriteAllText(hostsFilePath, hostsFileContent); - } - - private static int StartElevated(string filename, string args) - { - ProcessStartInfo startInfo = new ProcessStartInfo - { - UseShellExecute = true, - WorkingDirectory = Environment.CurrentDirectory, - FileName = filename, - Arguments = args, - Verb = "runas" - }; - try - { - Process p = Process.Start(startInfo); - if (p != null) - { - p.WaitForExit(); - return p.ExitCode; - } - return -2; - } - catch - { - return -2; - } - } - } -} \ No newline at end of file diff --git a/CassiniDev/Misc/Interop.cs b/CassiniDev/Misc/Interop.cs deleted file mode 100644 index 4c118f2d3..000000000 --- a/CassiniDev/Misc/Interop.cs +++ /dev/null @@ -1,160 +0,0 @@ -// ********************************************************************************** -// CassiniDev - http://cassinidev.codeplex.com -// -// Copyright (c) 2010 Sky Sanders. All rights reserved. -// -// This source code is subject to terms and conditions of the Microsoft Public -// License (Ms-PL). A copy of the license can be found in the license.txt file -// included in this distribution. -// -// You must not remove this notice, or any other, from this software. -// -// ********************************************************************************** - -#region - -using System; -using System.Runtime.InteropServices; - -#endregion - -namespace CassiniDev -{ - internal static class Interop - { - #region Structs - - [DllImport("SECUR32.DLL", CharSet = CharSet.Unicode)] - public static extern int AcceptSecurityContext(ref SecHandle phCredential, IntPtr phContext, - ref SecBufferDesc pInput, uint fContextReq, uint TargetDataRep, - ref SecHandle phNewContext, ref SecBufferDesc pOutput, - ref uint pfContextAttr, ref long ptsTimeStamp); - - [DllImport("SECUR32.DLL", CharSet = CharSet.Unicode)] - public static extern int AcquireCredentialsHandle(string pszPrincipal, string pszPackage, uint fCredentialUse, - IntPtr pvLogonID, IntPtr pAuthData, IntPtr pGetKeyFn, - IntPtr pvGetKeyArgument, ref SecHandle phCredential, - ref long ptsExpiry); - - [DllImport("KERNEL32.DLL", CharSet = CharSet.Unicode)] - public static extern int CloseHandle(IntPtr phToken); - - [DllImport("SECUR32.DLL", CharSet = CharSet.Unicode)] - public static extern int DeleteSecurityContext(ref SecHandle phContext); - - /// - /// FIX: #12506 - /// - [DllImport("urlmon.dll", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = false)] - public static extern int FindMimeFromData(IntPtr pBC, [MarshalAs(UnmanagedType.LPWStr)] string pwzUrl, - [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.I1, - SizeParamIndex = 3)] byte[] pBuffer, int cbSize, - [MarshalAs(UnmanagedType.LPWStr)] string pwzMimeProposed, - int dwMimeFlags, out IntPtr ppwzMimeOut, int dwReserved); - - [DllImport("SECUR32.DLL", CharSet = CharSet.Unicode)] - public static extern int FreeCredentialsHandle(ref SecHandle phCredential); - - [DllImport("kernel32.dll", EntryPoint = "GetConsoleScreenBufferInfo", SetLastError = true, - CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)] - public static extern int GetConsoleScreenBufferInfo(int hConsoleOutput, - ref CONSOLE_SCREEN_BUFFER_INFO lpConsoleScreenBufferInfo); - - [DllImport("KERNEL32.DLL", SetLastError = true)] - public static extern IntPtr GetCurrentThread(); - - [DllImport("kernel32.dll", EntryPoint = "GetStdHandle", SetLastError = true, CharSet = CharSet.Auto, - CallingConvention = CallingConvention.StdCall)] - public static extern int GetStdHandle(int nStdHandle); - - [DllImport("ADVAPI32.DLL", SetLastError = true)] - public static extern bool ImpersonateSelf(int level); - - [DllImport("ADVAPI32.DLL", SetLastError = true)] - public static extern int OpenThreadToken(IntPtr thread, int access, bool openAsSelf, ref IntPtr hToken); - - [DllImport("SECUR32.DLL", CharSet = CharSet.Unicode)] - public static extern int QuerySecurityContextToken(ref SecHandle phContext, ref IntPtr phToken); - - [DllImport("ADVAPI32.DLL", SetLastError = true)] - public static extern int RevertToSelf(); - - #region Nested type: CONSOLE_SCREEN_BUFFER_INFO - - public struct CONSOLE_SCREEN_BUFFER_INFO - { - internal COORD dwCursorPosition; - internal COORD dwMaximumWindowSize; - internal COORD dwSize; - internal SMALL_RECT srWindow; - internal Int16 wAttributes; - } - - #endregion - - #region Nested type: COORD - - public struct COORD - { - internal Int16 x; - internal Int16 y; - } - - #endregion - - #region Nested type: SecBuffer - - [StructLayout(LayoutKind.Sequential)] - public struct SecBuffer - { - // ReSharper disable InconsistentNaming - public uint cbBuffer; - public uint BufferType; - public IntPtr pvBuffer; - // ReSharper restore InconsistentNaming - } - - #endregion - - #region Nested type: SecBufferDesc - - [StructLayout(LayoutKind.Sequential)] - public struct SecBufferDesc - { - // ReSharper disable InconsistentNaming - public uint ulVersion; - public uint cBuffers; - public IntPtr pBuffers; - // ReSharper restore InconsistentNaming - } - - #endregion - - #region Nested type: SecHandle - - [StructLayout(LayoutKind.Sequential)] - public struct SecHandle - { - // ReSharper disable InconsistentNaming - public IntPtr dwLower; - public IntPtr dwUpper; - // ReSharper restore InconsistentNaming - } - - #endregion - - #region Nested type: SMALL_RECT - - public struct SMALL_RECT - { - internal Int16 Bottom; - internal Int16 Left; - internal Int16 Right; - internal Int16 Top; - } - - #endregion - - #endregion - } -} \ No newline at end of file diff --git a/CassiniDev/Misc/NetworkUtils.cs b/CassiniDev/Misc/NetworkUtils.cs deleted file mode 100644 index dc647d48a..000000000 --- a/CassiniDev/Misc/NetworkUtils.cs +++ /dev/null @@ -1,221 +0,0 @@ -// ********************************************************************************** -// CassiniDev - http://cassinidev.codeplex.com -// -// Copyright (c) 2010 Sky Sanders. All rights reserved. -// -// This source code is subject to terms and conditions of the Microsoft Public -// License (Ms-PL). A copy of the license can be found in the license.txt file -// included in this distribution. -// -// You must not remove this notice, or any other, from this software. -// -// ********************************************************************************** - -#region - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Net.NetworkInformation; -using System.Text.RegularExpressions; -using System.Threading; - -#endregion - -namespace CassiniDev -{ - public static class CassiniNetworkUtils - { - public static IPAddress[] GetLocalAddresses() - { - string strHostName = Dns.GetHostName(); - IPHostEntry ipEntry = Dns.GetHostEntry(strHostName); - return ipEntry.AddressList; - } - - /// - /// Returns first available port on the specified IP address. - /// The port scan excludes ports that are open on ANY loopback adapter. - /// - /// If the address upon which a port is requested is an 'ANY' address all - /// ports that are open on ANY IP are excluded. - /// - /// - /// - /// The IP address upon which to search for available port. - /// If true includes ports in TIME_WAIT state in results. - /// TIME_WAIT state is typically cool down period for recently released ports. - /// - public static int GetAvailablePort(int rangeStart, int rangeEnd, IPAddress ip, bool includeIdlePorts) - { - IPGlobalProperties ipProps = IPGlobalProperties.GetIPGlobalProperties(); - - // if the ip we want a port on is an 'any' or loopback port we need to exclude all ports that are active on any IP - Func isIpAnyOrLoopBack = i => IPAddress.Any.Equals(i) || - IPAddress.IPv6Any.Equals(i) || - IPAddress.Loopback.Equals(i) || - IPAddress.IPv6Loopback. - Equals(i); - // get all active ports on specified IP. - List excludedPorts = new List(); - - // if a port is open on an 'any' or 'loopback' interface then include it in the excludedPorts - excludedPorts.AddRange(from n in ipProps.GetActiveTcpConnections() - where - n.LocalEndPoint.Port >= rangeStart && - n.LocalEndPoint.Port <= rangeEnd && ( - isIpAnyOrLoopBack(ip) || - n.LocalEndPoint.Address.Equals(ip) || - isIpAnyOrLoopBack(n.LocalEndPoint.Address)) && - (!includeIdlePorts || n.State != TcpState.TimeWait) - select (ushort) n.LocalEndPoint.Port); - - excludedPorts.AddRange(from n in ipProps.GetActiveTcpListeners() - where n.Port >= rangeStart && n.Port <= rangeEnd && ( - isIpAnyOrLoopBack(ip) || - n.Address.Equals(ip) || - isIpAnyOrLoopBack(n.Address)) - select (ushort) n.Port); - - excludedPorts.AddRange(from n in ipProps.GetActiveUdpListeners() - where n.Port >= rangeStart && n.Port <= rangeEnd && ( - isIpAnyOrLoopBack(ip) || - n.Address.Equals(ip) || - isIpAnyOrLoopBack(n.Address)) - select (ushort) n.Port); - - excludedPorts.Sort(); - - for (int port = rangeStart; port <= rangeEnd; port++) - { - if (!excludedPorts.Contains((ushort) port)) - { - return port; - } - } - - return 0; - } - - /// - /// Returns the first IPV4 address available for this host. - /// This is typically an external IP - /// - /// - public static IPAddress GetExternalIPV4() - { - return GetIPAdresses().ToList() - .FirstOrDefault(i => i.ToString().IndexOf(":") == -1); - } - - /// - /// - /// - public static string GetHostName() - { - return Dns.GetHostName(); - } - - /// - /// Gets all IP addresses for this host - /// - public static IPAddress[] GetIPAdresses() - { - return Dns.GetHostEntry(GetHostName()).AddressList; - } - - /// - /// Gently polls specified IP:Port to determine if it is available. - /// - /// - /// - public static bool IsPortAvailable(IPAddress ipAddress, int port) - { - bool portAvailable = false; - - for (int i = 0; i < 5; i++) - { - portAvailable = GetAvailablePort(port, port, ipAddress, true) == port; - if (portAvailable) - { - break; - } - // be a little patient and wait for the port if necessary, - // the previous occupant may have just vacated - Thread.Sleep(100); - } - return portAvailable; - } - - /// - /// Combine the RootUrl of the running web application with the relative url - /// specified. - /// - /// - /// - /// - public static string NormalizeUrl(string rootUrl, string relativeUrl) - { - relativeUrl = relativeUrl.TrimStart(new[] {'/'}); - - if (!rootUrl.EndsWith("/")) - { - rootUrl += "/"; - } - return new Uri(rootUrl + relativeUrl).ToString(); - } - - /// - /// - /// - /// - public static IPAddress ParseIPString(string ipString) - { - if (string.IsNullOrEmpty(ipString)) - { - ipString = "loopback"; - } - ipString = ipString.Trim().ToLower(); - switch (ipString) - { - case "any": - return IPAddress.Any; - case "loopback": - return IPAddress.Loopback; - case "ipv6any": - return IPAddress.IPv6Any; - case "ipv6loopback": - return IPAddress.IPv6Loopback; - default: - IPAddress result; - IPAddress.TryParse(ipString, out result); - return result; - } - } - - /// - /// - /// Hostnames are composed of series of labels concatenated with dots, as are all domain names[1]. - /// For example, "en.wikipedia.org" is a hostname. Each label must be between 1 and 63 characters long, - /// and the entire hostname has a maximum of 255 characters. - /// - /// The Internet standards (Request for Comments) for protocols mandate that component hostname - /// labels may contain only the ASCII letters 'a' through 'z' (in a case-insensitive manner), the digits - /// '0' through '9', and the hyphen. The original specification of hostnames in RFC 952, mandated that - /// labels could not start with a digit or with a hyphen, and must not end with a hyphen. However, a - /// subsequent specification (RFC 1123) permitted hostname labels to start with digits. No other symbols, - /// punctuation characters, or blank spaces are permitted. - /// - /// - /// - /// http://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_host_names - public static bool ValidateHostName(string hostname) - { - Regex hostnameRx = - new Regex( - @"^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])$"); - return hostnameRx.IsMatch(hostname); - } - } -} \ No newline at end of file diff --git a/CassiniDev/Misc/ServiceInstaller.cs b/CassiniDev/Misc/ServiceInstaller.cs deleted file mode 100644 index a12bf4f63..000000000 --- a/CassiniDev/Misc/ServiceInstaller.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.ComponentModel; -using System.Configuration.Install; -using System.Linq; -using System.ServiceProcess; -using System.Text; -using System.Configuration; -namespace CassiniDev -{ - - - [RunInstaller(true)] - public sealed class MyServiceInstallerProcess : ServiceProcessInstaller - { - public MyServiceInstallerProcess() - { - this.Account = ServiceAccount.NetworkService; - - } - } - [RunInstaller(true)] - public sealed class MyServiceInstaller : ServiceInstaller - { - public MyServiceInstaller() - { - - - this.Description = "CassiniDev"; - this.DisplayName = "CassiniDev"; - this.ServiceName = "CassiniDev"; - this.StartType = System.ServiceProcess.ServiceStartMode.Automatic; - } - } - -} diff --git a/CassiniDev/Program.cs b/CassiniDev/Program.cs deleted file mode 100644 index bd3526de1..000000000 --- a/CassiniDev/Program.cs +++ /dev/null @@ -1,386 +0,0 @@ -// ********************************************************************************** -// CassiniDev - http://cassinidev.codeplex.com -// -// Copyright (c) Sky Sanders. All rights reserved. -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// This source code is subject to terms and conditions of the Microsoft Public -// License (Ms-PL). A copy of the license can be found in the license.htm file -// included in this distribution. -// -// You must not remove this notice, or any other, from this software. -// -// ********************************************************************************** - -#region - -using System; -using System.Collections; -using System.Configuration.Install; -using System.Globalization; -using System.IO; -using System.Reflection; -using System.Threading; -using System.Windows.Forms; -using CassiniDev.UIComponents; - -#endregion - -namespace CassiniDev -{ - public sealed class Program - { - - - [STAThread, LoaderOptimization(LoaderOptimization.MultiDomainHost)] - public static int Main(string[] cmdLine) - { - Server server = null; - - if (cmdLine != null && cmdLine.Length > 0) - { - bool isVS = Assembly.GetExecutingAssembly() - .GetName().Name.StartsWith("WEBDEV.WEBSERVER", StringComparison.OrdinalIgnoreCase); - - CommandLineArguments args = new CommandLineArguments(); - - if (!CommandLineParser.ParseArgumentsWithUsage(cmdLine, args)) - { - if (isVS) - { - // will display vs usage and return a code that VS understands - return ValidateForVS(cmdLine); - } - - string usage = CommandLineParser.ArgumentsUsage(typeof(CommandLineArguments), 120); - ShowMessage(usage, MessageBoxIcon.Asterisk); - return 0; - } - - - if (args.RunMode == RunMode.Hostsfile) - { - SetHostsFile(args); - return 0; - } - - - // now we validate for us. - int returnValue = -1; - string message = null; - - try - { - args.VisualStudio = isVS; - args.Validate(); - } - catch (CassiniException ex) - { - switch (ex.Message) - { - case SR.ErrNoAvailablePortFound: - case SR.ErrApplicationPathIsNull: - message = ex.Message; - break; - case SR.ErrInvalidIPMode: - message = SR.GetString(ex.Message, args.IPMode); - break; - case SR.ErrInvalidPortMode: - message = SR.GetString(ex.Message, args.PortMode); - break; - case SR.ErrPortIsInUse: - message = SR.GetString(ex.Message, args.Port); - break; - case SR.ErrPortRangeEndMustBeEqualOrGreaterThanPortRangeSta: - message = SR.GetString(ex.Message, args.PortRangeStart, args.PortRangeEnd); - break; - case SR.ErrInvalidPortRangeValue: - message = SR.GetString(ex.Message, - ex.Field == ErrorField.PortRangeStart - ? "start " + args.PortRangeStart - : "end " + args.PortRangeEnd); - break; - case SR.ErrInvalidHostname: - message = SR.GetString(ex.Message, args.HostName); - break; - case SR.WebdevDirNotExist: - message = SR.GetString(ex.Message, args.ApplicationPath); - returnValue = -2; - break; - case SR.ErrPortOutOfRange: - message = SR.GetString(ex.Message, args.Port); - break; - } - - if (!args.Silent) - { - ShowMessage(message, MessageBoxIcon.Asterisk); - } - return returnValue; - } - catch (Exception exception) - { - if (!args.Silent) - { - ShowMessage(SR.GetString(SR.ErrFailedToStartCassiniDevServerOnPortError, args.Port, - exception.Message, exception.HelpLink), MessageBoxIcon.Error); - } - return -1; - } - - - - server = new Server(args.Port, args.VirtualPath, args.ApplicationPath, args.Ntlm, args.Nodirlist); - - - if (args.AddHost) - { - HostsFile.AddHostEntry(server.IPAddress.ToString(), server.HostName); - } - - try - { - server.Start(); - } - catch (Exception exception) - { - if (!args.Silent) - { - ShowMessage(SR.GetString(SR.ErrFailedToStartCassiniDevServerOnPortError, args.Port, - exception.Message, exception.HelpLink), MessageBoxIcon.Error); - } - return -4; - } - - } - - using (FormView form = new FormView(server)) - { - Application.Run(form); - } - - return 0; - } - - private static void ShowMessage(string msg, MessageBoxIcon icon) - { - if (Thread.CurrentThread.CurrentUICulture.TextInfo.IsRightToLeft) - { - MessageBox.Show(msg, SR.GetString(SR.WebdevName), MessageBoxButtons.OK, icon, - MessageBoxDefaultButton.Button1, MessageBoxOptions.RtlReading); - } - else - { - MessageBox.Show(msg, SR.GetString(SR.WebdevName), MessageBoxButtons.OK, icon); - } - } - - private static void ShowMessage(string msg) - { - if (Thread.CurrentThread.CurrentUICulture.TextInfo.IsRightToLeft) - { - MessageBox.Show(msg, SR.GetString(SR.WebdevName), MessageBoxButtons.OK, MessageBoxIcon.Hand, - MessageBoxDefaultButton.Button1, MessageBoxOptions.RtlReading); - } - else - { - MessageBox.Show(msg, SR.GetString(SR.WebdevName), MessageBoxButtons.OK, MessageBoxIcon.Hand); - } - } - - /// - /// TODO: update usage will all arguments and present on a legible substrate. - /// - private static void ShowUsage() - { - ShowMessage(SR.GetString(SR.WebdevUsagestr1) + SR.GetString(SR.WebdevUsagestr2) + - SR.GetString(SR.WebdevUsagestr3) + - SR.GetString(SR.WebdevUsagestr4) + SR.GetString(SR.WebdevUsagestr5) + - SR.GetString(SR.WebdevUsagestr6) + - SR.GetString(SR.WebdevUsagestr7), MessageBoxIcon.Asterisk); - } - - - /// - /// Keeping the VS validation to return codes that it likes. - /// - /// - /// - private static int ValidateForVS(string[] args) - { - CommandLine line = new CommandLine(args); - - bool flag = line.Options["silent"] != null; - - if (!flag && line.ShowHelp) - { - ShowUsage(); - return 0; - } - - string virtualPath = (string)line.Options["vpath"]; - - if (virtualPath != null) - { - virtualPath = virtualPath.Trim(); - } - - // we are being a bit generous here as CommandLineArguments can handle these sitchiashuns - if (string.IsNullOrEmpty(virtualPath)) - { - virtualPath = "/"; - } - - else if (!virtualPath.StartsWith("/", StringComparison.Ordinal)) - { - if (!flag) - { - ShowUsage(); - } - return -1; - } - - string path = (string)line.Options["path"]; - - if (path != null) - { - path = path.Trim(); - } - - if (string.IsNullOrEmpty(path)) - { - if (!flag) - { - ShowUsage(); - } - return -1; - } - - path = Path.GetFullPath(path); - - if (!Directory.Exists(path)) - { - if (!flag) - { - ShowMessage(SR.GetString(SR.WebdevDirNotExist, new object[] { path })); - } - return -2; - } - - int port = 0; - - string s = (string)line.Options["port"]; - - if (s != null) - { - s = s.Trim(); - } - - if (!string.IsNullOrEmpty(s)) - { - try - { - port = int.Parse(s, CultureInfo.InvariantCulture); - if ((port < 1) || (port > 0xffff)) - { - if (!flag) - { - ShowUsage(); - } - return -1; - } - - } - catch - { - if (!flag) - { - ShowMessage(SR.GetString(SR.WebdevInvalidPort, new object[] { s })); - } - return -3; - } - } - - if (!flag) - { - ShowUsage(); - } - - return 0; - } - - - private static void SetHostsFile(CommandLineArguments sargs) - { - try - { - if (sargs.AddHost) - { - HostsFile.AddHostEntry(sargs.IPAddress, sargs.HostName); - } - else - { - HostsFile.RemoveHostEntry(sargs.IPAddress, sargs.HostName); - } - } - catch (UnauthorizedAccessException) - { - Environment.Exit(-1); - } - catch - { - Environment.Exit(-2); - } - } - - - - } - - internal sealed class ServiceUtil - { - /// - /// http://stackoverflow.com/questions/1449994/inno-setup-for-windows-service - /// http://groups.google.co.uk/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/4d45e9ea5471cba4/4519371a77ed4a74 - /// - /// - /// - public static void Install(bool undo, string[] args) - { - try - { - Console.WriteLine(undo ? "uninstalling" : "installing"); - using (AssemblyInstaller inst = new AssemblyInstaller(typeof(Program).Assembly, args)) - { - IDictionary state = new Hashtable(); - inst.UseNewContext = true; - try - { - if (undo) - { - inst.Uninstall(state); - } - else - { - inst.Install(state); - inst.Commit(state); - } - } - catch - { - try - { - inst.Rollback(state); - } - catch { } - throw; - } - } - } - catch (Exception ex) - { - Console.Error.WriteLine(ex.Message); - } - } - } -} \ No newline at end of file diff --git a/CassiniDev/Properties/AssemblyInfo.cs b/CassiniDev/Properties/AssemblyInfo.cs deleted file mode 100644 index 13a4100b0..000000000 --- a/CassiniDev/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Reflection; -using System.Resources; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Security.Permissions; - -[assembly: AssemblyTitle("CassiniDev")] -[assembly: AssemblyDescription("Cassini For Developers")] -[assembly: AssemblyCompany("Salient Solutions")] -[assembly: AssemblyProduct("CassiniDev")] -[assembly: AssemblyCopyright("\x00a9 Sky Sanders/\x00a9 Microsoft Corporation. All rights reserved.")] -[assembly: NeutralResourcesLanguage("en-US")] -[assembly: AssemblyVersion("3.5.1.8")] -[assembly: AssemblyFileVersion("3.5.1.8")] -[assembly: ComVisible(false)] -[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] -[assembly: SecurityPermission(SecurityAction.RequestMinimum)] -[assembly: CLSCompliant(true)] diff --git a/CassiniDev/Properties/AssemblyInfo4.cs b/CassiniDev/Properties/AssemblyInfo4.cs deleted file mode 100644 index 8d9c630b0..000000000 --- a/CassiniDev/Properties/AssemblyInfo4.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Reflection; -using System.Resources; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Security.Permissions; - -[assembly: AssemblyTitle("CassiniDev")] -[assembly: AssemblyDescription("Cassini For Developers")] -[assembly: AssemblyCompany("Salient Solutions")] -[assembly: AssemblyProduct("CassiniDev")] -[assembly: AssemblyCopyright("\x00a9 Sky Sanders/\x00a9 Microsoft Corporation. All rights reserved.")] -[assembly: NeutralResourcesLanguage("en-US")] -[assembly: AssemblyVersion("4.0.1.8")] -[assembly: AssemblyFileVersion("4.0.1.8")] -[assembly: ComVisible(false)] -[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] -[assembly: SecurityPermission(SecurityAction.RequestMinimum)] -[assembly: CLSCompliant(true)] diff --git a/CassiniDev/Resources/CassiniDev.resx b/CassiniDev/Resources/CassiniDev.resx deleted file mode 100644 index 067380c9a..000000000 --- a/CassiniDev/Resources/CassiniDev.resx +++ /dev/null @@ -1,254 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Directory Listing -- {0} - - - CassiniDev Server - - - Server Error in '{0}' Application. - - - Version Information - - - HTTP Error {0} - {1}. - - - The directory '{0}' does not exist. - - - CassiniDev Server failed to start listening on port {0}. - Error message: - {1} - - - Invalid port'{0}' - - - CassiniDev Server - - - CassiniDev Server - Port {0} - - - Open in Web Browser - - - Run ASP.NET applications locally. - - - Show Details - - - Stop - - - CassiniDev Server Usage: - - - - WebDev.WebServer /port:<port number> /path:<physical path> [/vpath:<virtual path>] - - - - - port number: - [Optional] An unused port number between 1 and 65535. - The default is 80 (usable if you do not also have IIS listening on the same port). - - - - - physical path: - A valid directory name where the Web application is rooted. - - - - - virtual path: - [Optional] The virtual path or application root in the form of '/<app name>'. - The default is simply '/'. - - - - - Example: -WebDev.WebServer /port:8080 /path:"c:\inetpub\wwwroot\MyApp" /vpath:"/MyApp" - - - - - You can then access the Web application using a URL of the form: - http://localhost:8080/MyApp - - - CassiniDev Server - Port {0} - Log Viewer - - - In memory logging is enabled. - -Events are only captured when the Log window is visible -and all data will be lost when this window is closed. - -Install the latest System.Data.SQLite package to enable -log persistence. - - - ASP.Net Version: {0} - - - Start - - - ApplicationPath is null - - - Failed to start CassiniDev Server on Port:{0} Error:{1} {2} - - - Invalid Hostname {0} - - - Invalid IP Address {0} - - - Invalid IPMode {0} - - - Invalid PortMode - - - Invalid port range value {0} - - - No available port found. - - - Port is in use {0} - - - Port out of range: {0} - - - Port range end must be equal or greater than port range start {0} {1} - - \ No newline at end of file diff --git a/CassiniDev/Resources/SR.cs b/CassiniDev/Resources/SR.cs deleted file mode 100644 index 1101656c8..000000000 --- a/CassiniDev/Resources/SR.cs +++ /dev/null @@ -1,164 +0,0 @@ -// ********************************************************************************** -// CassiniDev - http://cassinidev.codeplex.com -// -// Copyright (c) Sky Sanders. All rights reserved. -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// This source code is subject to terms and conditions of the Microsoft Public -// License (Ms-PL). A copy of the license can be found in the license.htm file -// included in this distribution. -// -// You must not remove this notice, or any other, from this software. -// -// ********************************************************************************** - -#region - -using System; -using System.Globalization; -using System.Reflection; -using System.Resources; -using System.Threading; - -#endregion - -namespace CassiniDev -{ - internal sealed class SR - { - - internal const string ErrInvalidIPMode="SR.ErrInvalidIPMode"; - internal const string ErrInvalidIPAddress = "ErrInvalidIPAddress"; - internal const string ErrInvalidPortMode = "ErrInvalidPortMode"; - internal const string ErrPortIsInUse = "ErrPortIsInUse"; - internal const string ErrNoAvailablePortFound = "ErrNoAvailablePortFound"; - internal const string ErrPortRangeEndMustBeEqualOrGreaterThanPortRangeSta = - "ErrPortRangeEndMustBeEqualOrGreaterThanPortRangeSta"; - internal const string ErrInvalidPortRangeValue = "ErrInvalidPortRangeValue"; - internal const string ErrInvalidHostname = "ErrInvalidHostname"; - - internal const string ErrFailedToStartCassiniDevServerOnPortError = - "ErrFailedToStartCassiniDevServerOnPortError"; - internal const string ErrApplicationPathIsNull = "ErrApplicationPathIsNull"; - internal const string ErrPortOutOfRange = "ErrPortOutOfRange"; - - internal const string WebdevAspNetVersion = "WebdevAspNetVersion"; - - internal const string WebdevDirListing = "WebdevDirListing"; - - internal const string WebdevDirNotExist = "WebdevDirNotExist"; - - internal const string WebdevErrorListeningPort = "WebdevErrorListeningPort"; - - internal const string WebdevHttpError = "WebdevHttpError"; - - internal const string WebdevInMemoryLogging = "WebdevInMemoryLogging"; - - internal const string WebdevInvalidPort = "WebdevInvalidPort"; - - internal const string WebdevLogViewerNameWithPort = "WebdevLogViewerNameWithPort"; - - internal const string WebdevName = "WebdevName"; - - internal const string WebdevNameWithPort = "WebdevNameWithPort"; - - internal const string WebdevOpenInBrowser = "WebdevOpenInBrowser"; - - internal const string WebdevRunAspNetLocally = "WebdevRunAspNetLocally"; - - internal const string WebdevServerError = "WebdevServerError"; - - internal const string WebdevShowDetail = "WebdevShowDetail"; - - internal const string WebdevStop = "WebdevStop"; - - internal const string WebdevUsagestr1 = "WebdevUsagestr1"; - - internal const string WebdevUsagestr2 = "WebdevUsagestr2"; - - internal const string WebdevUsagestr3 = "WebdevUsagestr3"; - - internal const string WebdevUsagestr4 = "WebdevUsagestr4"; - - internal const string WebdevUsagestr5 = "WebdevUsagestr5"; - - internal const string WebdevUsagestr6 = "WebdevUsagestr6"; - - internal const string WebdevUsagestr7 = "WebdevUsagestr7"; - - internal const string WebdevVersionInfo = "WebdevVersionInfo"; - - internal const string WebdevVwdName = "WebdevVwdName"; - - private static SR _loader; - - private readonly ResourceManager _resources; - public const string WebdevStart = "WebdevStart"; - - internal SR() - { - Type t = GetType(); - Assembly thisAssembly = t.Assembly; - string stringResourcesName = t.Namespace + ".Resources.CassiniDev"; - _resources = new ResourceManager(stringResourcesName, thisAssembly); - } - - private static CultureInfo Culture - { - get { return null; } - } - - public static ResourceManager Resources - { - get { return GetLoader()._resources; } - } - - public static string GetString(string name) - { - SR loader = GetLoader(); - if (loader == null) - { - return null; - } - return loader._resources.GetString(name, Culture); - } - - public static string GetString(string name, params object[] args) - { - SR loader = GetLoader(); - if (loader == null) - { - return null; - } - string format = loader._resources.GetString(name, Culture); - if ((args == null) || (args.Length <= 0)) - { - return format; - } - for (int i = 0; i < args.Length; i++) - { - string str2 = args[i] as string; - if ((str2 != null) && (str2.Length > 0x400)) - { - args[i] = str2.Substring(0, 0x3fd) + "..."; - } - } - if (string.IsNullOrEmpty(format)) - { - return string.Empty; - } - return string.Format(CultureInfo.CurrentCulture, format, args); - } - - private static SR GetLoader() - { - if (_loader == null) - { - SR sr = new SR(); - Interlocked.CompareExchange(ref _loader, sr, null); - } - return _loader; - } - - } -} \ No newline at end of file diff --git a/CassiniDev/Resources/preferences-web-browser-shortcuts.ico b/CassiniDev/Resources/preferences-web-browser-shortcuts.ico deleted file mode 100644 index 472a8ede1..000000000 Binary files a/CassiniDev/Resources/preferences-web-browser-shortcuts.ico and /dev/null differ diff --git a/CassiniDev/Views/BodyView.Designer.cs b/CassiniDev/Views/BodyView.Designer.cs deleted file mode 100644 index 3f039539a..000000000 --- a/CassiniDev/Views/BodyView.Designer.cs +++ /dev/null @@ -1,187 +0,0 @@ -namespace CassiniDev.ServerLog -{ - partial class BodyView - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.pictureBox1 = new System.Windows.Forms.PictureBox(); - this.tabControl1 = new System.Windows.Forms.TabControl(); - this.TextViewTab = new System.Windows.Forms.TabPage(); - this.TextViewTextBox = new System.Windows.Forms.RichTextBox(); - this.HexViewTab = new System.Windows.Forms.TabPage(); - this.HexViewTextBox = new System.Windows.Forms.RichTextBox(); - this.ImageViewTab = new System.Windows.Forms.TabPage(); - this.tabPage1 = new System.Windows.Forms.TabPage(); - this.richTextBox1 = new System.Windows.Forms.RichTextBox(); - this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); - this.tabControl1.SuspendLayout(); - this.TextViewTab.SuspendLayout(); - this.HexViewTab.SuspendLayout(); - this.ImageViewTab.SuspendLayout(); - this.tabPage1.SuspendLayout(); - this.SuspendLayout(); - // - // pictureBox1 - // - this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill; - this.pictureBox1.Location = new System.Drawing.Point(4, 4); - this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(271, 123); - this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; - this.pictureBox1.TabIndex = 0; - this.pictureBox1.TabStop = false; - // - // tabControl1 - // - this.tabControl1.Controls.Add(this.TextViewTab); - this.tabControl1.Controls.Add(this.HexViewTab); - this.tabControl1.Controls.Add(this.ImageViewTab); - this.tabControl1.Controls.Add(this.tabPage1); - this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; - this.tabControl1.Location = new System.Drawing.Point(0, 0); - this.tabControl1.Name = "tabControl1"; - this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(287, 157); - this.tabControl1.TabIndex = 2; - // - // TextViewTab - // - this.TextViewTab.Controls.Add(this.TextViewTextBox); - this.TextViewTab.Location = new System.Drawing.Point(4, 22); - this.TextViewTab.Name = "TextViewTab"; - this.TextViewTab.Padding = new System.Windows.Forms.Padding(3); - this.TextViewTab.Size = new System.Drawing.Size(279, 131); - this.TextViewTab.TabIndex = 1; - this.TextViewTab.Text = "TextView"; - this.TextViewTab.UseVisualStyleBackColor = true; - // - // TextViewTextBox - // - this.TextViewTextBox.Dock = System.Windows.Forms.DockStyle.Fill; - this.TextViewTextBox.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.TextViewTextBox.Location = new System.Drawing.Point(3, 3); - this.TextViewTextBox.Name = "TextViewTextBox"; - this.TextViewTextBox.ReadOnly = true; - this.TextViewTextBox.Size = new System.Drawing.Size(273, 125); - this.TextViewTextBox.TabIndex = 0; - this.TextViewTextBox.Text = ""; - this.toolTip1.SetToolTip(this.TextViewTextBox, "CTRL+ Mouse Wheel to Zoom"); - this.TextViewTextBox.WordWrap = false; - // - // HexViewTab - // - this.HexViewTab.Controls.Add(this.HexViewTextBox); - this.HexViewTab.Location = new System.Drawing.Point(4, 22); - this.HexViewTab.Name = "HexViewTab"; - this.HexViewTab.Padding = new System.Windows.Forms.Padding(3); - this.HexViewTab.Size = new System.Drawing.Size(279, 131); - this.HexViewTab.TabIndex = 0; - this.HexViewTab.Text = "HexView"; - this.HexViewTab.UseVisualStyleBackColor = true; - // - // HexViewTextBox - // - this.HexViewTextBox.Dock = System.Windows.Forms.DockStyle.Fill; - this.HexViewTextBox.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.HexViewTextBox.Location = new System.Drawing.Point(3, 3); - this.HexViewTextBox.Name = "HexViewTextBox"; - this.HexViewTextBox.ReadOnly = true; - this.HexViewTextBox.Size = new System.Drawing.Size(273, 125); - this.HexViewTextBox.TabIndex = 1; - this.HexViewTextBox.Text = ""; - this.toolTip1.SetToolTip(this.HexViewTextBox, "CTRL+ Mouse Wheel to Zoom"); - this.HexViewTextBox.WordWrap = false; - // - // ImageViewTab - // - this.ImageViewTab.AutoScroll = true; - this.ImageViewTab.Controls.Add(this.pictureBox1); - this.ImageViewTab.Location = new System.Drawing.Point(4, 22); - this.ImageViewTab.Name = "ImageViewTab"; - this.ImageViewTab.Padding = new System.Windows.Forms.Padding(4); - this.ImageViewTab.Size = new System.Drawing.Size(279, 131); - this.ImageViewTab.TabIndex = 2; - this.ImageViewTab.Text = "ImageView"; - this.ImageViewTab.UseVisualStyleBackColor = true; - // - // tabPage1 - // - this.tabPage1.Controls.Add(this.richTextBox1); - this.tabPage1.Location = new System.Drawing.Point(4, 22); - this.tabPage1.Name = "tabPage1"; - this.tabPage1.Size = new System.Drawing.Size(279, 131); - this.tabPage1.TabIndex = 3; - this.tabPage1.Text = "TODO"; - this.tabPage1.UseVisualStyleBackColor = true; - // - // richTextBox1 - // - this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Fill; - this.richTextBox1.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.richTextBox1.Location = new System.Drawing.Point(0, 0); - this.richTextBox1.Name = "richTextBox1"; - this.richTextBox1.ReadOnly = true; - this.richTextBox1.Size = new System.Drawing.Size(279, 131); - this.richTextBox1.TabIndex = 2; - this.richTextBox1.Text = "Expose extension API, probably via MEF, to enable incremental implemention of add" + - "itional views, e.g. a PDF view, a XAML view"; - this.toolTip1.SetToolTip(this.richTextBox1, "CTRL+ Mouse Wheel to Zoom"); - // - // BodyView - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.SystemColors.GradientActiveCaption; - this.Controls.Add(this.tabControl1); - this.Name = "BodyView"; - this.Size = new System.Drawing.Size(287, 157); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); - this.tabControl1.ResumeLayout(false); - this.TextViewTab.ResumeLayout(false); - this.HexViewTab.ResumeLayout(false); - this.ImageViewTab.ResumeLayout(false); - this.tabPage1.ResumeLayout(false); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.PictureBox pictureBox1; - private System.Windows.Forms.TabControl tabControl1; - private System.Windows.Forms.TabPage HexViewTab; - private System.Windows.Forms.RichTextBox HexViewTextBox; - private System.Windows.Forms.TabPage TextViewTab; - private System.Windows.Forms.RichTextBox TextViewTextBox; - private System.Windows.Forms.TabPage ImageViewTab; - private System.Windows.Forms.ToolTip toolTip1; - private System.Windows.Forms.TabPage tabPage1; - private System.Windows.Forms.RichTextBox richTextBox1; - } -} diff --git a/CassiniDev/Views/BodyView.cs b/CassiniDev/Views/BodyView.cs deleted file mode 100644 index 0068c817b..000000000 --- a/CassiniDev/Views/BodyView.cs +++ /dev/null @@ -1,77 +0,0 @@ -// ********************************************************************************** -// CassiniDev - http://cassinidev.codeplex.com -// -// Copyright (c) Sky Sanders. All rights reserved. -// -// This source code is subject to terms and conditions of the Microsoft Public -// License (Ms-PL). A copy of the license can be found in the license.htm file -// included in this distribution. -// -// You must not remove this notice, or any other, from this software. -// -// ********************************************************************************** - -#region - -using System; -using System.ComponentModel; -using System.Drawing; -using System.IO; -using System.Text; -using System.Windows.Forms; - -#endregion - -namespace CassiniDev.ServerLog -{ - [DefaultBindingProperty("Value")] - public partial class BodyView : UserControl - { - private byte[] _value; - - public BodyView() - { - InitializeComponent(); - pictureBox1.SizeMode = PictureBoxSizeMode.Zoom; - } - - public Byte[] Value - { - get { return _value; } - set - { - _value = value; - ClearDisplay(); - if (_value != null) - { - HexViewTextBox.Text = _value.ConvertToHexView(8); - TextViewTextBox.Text = Encoding.UTF8.GetString(_value); - try - { - using (MemoryStream s = new MemoryStream(_value)) - { - pictureBox1.Image = Image.FromStream(s); - } - pictureBox1.Visible = true; - } - // ReSharper disable EmptyGeneralCatchClause - catch - // ReSharper restore EmptyGeneralCatchClause - { - } - } - } - } - - private void ClearDisplay() - { - if (pictureBox1.Image != null) - { - pictureBox1.Image.Dispose(); - pictureBox1.Image = null; - } - HexViewTextBox.Text = ""; - TextViewTextBox.Text = ""; - } - } -} \ No newline at end of file diff --git a/CassiniDev/Views/BodyView.resx b/CassiniDev/Views/BodyView.resx deleted file mode 100644 index 9454f3d77..000000000 --- a/CassiniDev/Views/BodyView.resx +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 17, 17 - - \ No newline at end of file diff --git a/CassiniDev/Views/FormView.Designer.cs b/CassiniDev/Views/FormView.Designer.cs deleted file mode 100644 index ca1f1b0d3..000000000 --- a/CassiniDev/Views/FormView.Designer.cs +++ /dev/null @@ -1,686 +0,0 @@ -namespace CassiniDev -{ - partial class FormView - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormView)); - this.RootUrlLinkLabel = new System.Windows.Forms.LinkLabel(); - this.ApplicationPathTextBox = new System.Windows.Forms.TextBox(); - this.VirtualPathTextBox = new System.Windows.Forms.TextBox(); - this.HostNameTextBox = new System.Windows.Forms.TextBox(); - this.LabelPhysicalPath = new System.Windows.Forms.Label(); - this.AddHostEntryCheckBox = new System.Windows.Forms.CheckBox(); - this.LabelVPath = new System.Windows.Forms.Label(); - this.ButtonBrowsePhysicalPath = new System.Windows.Forms.Button(); - this.LabelHostName = new System.Windows.Forms.Label(); - this.GroupBoxPort = new System.Windows.Forms.GroupBox(); - this.PortRangeEndTextBox = new System.Windows.Forms.NumericUpDown(); - this.PortRangeStartTextBox = new System.Windows.Forms.NumericUpDown(); - this.PortTextBox = new System.Windows.Forms.NumericUpDown(); - this.LabelPortRangeSeperator = new System.Windows.Forms.Label(); - this.PortModeFirstAvailableRadioButton = new System.Windows.Forms.RadioButton(); - this.PortModeSpecificRadioButton = new System.Windows.Forms.RadioButton(); - this.GroupBoxIPAddress = new System.Windows.Forms.GroupBox(); - this.IPSpecificTextBox = new System.Windows.Forms.ComboBox(); - this.IPV6CheckBox = new System.Windows.Forms.CheckBox(); - this.RadioButtonIPSpecific = new System.Windows.Forms.RadioButton(); - this.IPModeAnyRadioButton = new System.Windows.Forms.RadioButton(); - this.IPModeLoopBackRadioButton = new System.Windows.Forms.RadioButton(); - this.ButtonStart = new System.Windows.Forms.Button(); - this.errorProvider1 = new System.Windows.Forms.ErrorProvider(this.components); - this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); - this.LabelIdleTimeOut = new System.Windows.Forms.Label(); - this.TrayIcon = new System.Windows.Forms.NotifyIcon(this.components); - this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); - this.showToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.browseToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); - this.ShowLogMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); - this.closeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.statusStrip1 = new System.Windows.Forms.StatusStrip(); - this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel(); - this.ShowLogButton = new System.Windows.Forms.Button(); - this.menuStrip1 = new System.Windows.Forms.MenuStrip(); - this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.hideToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); - this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.nTLMAuthenticationRequiredToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.directoryBrowsingEnabledToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.helpToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.TimeOutNumeric = new System.Windows.Forms.NumericUpDown(); - this.GroupBoxPort.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.PortRangeEndTextBox)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.PortRangeStartTextBox)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.PortTextBox)).BeginInit(); - this.GroupBoxIPAddress.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.errorProvider1)).BeginInit(); - this.contextMenuStrip1.SuspendLayout(); - this.statusStrip1.SuspendLayout(); - this.menuStrip1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.TimeOutNumeric)).BeginInit(); - this.SuspendLayout(); - // - // RootUrlLinkLabel - // - this.RootUrlLinkLabel.AutoSize = true; - this.RootUrlLinkLabel.Location = new System.Drawing.Point(9, 300); - this.RootUrlLinkLabel.Name = "RootUrlLinkLabel"; - this.RootUrlLinkLabel.Size = new System.Drawing.Size(189, 13); - this.RootUrlLinkLabel.TabIndex = 24; - this.RootUrlLinkLabel.TabStop = true; - this.RootUrlLinkLabel.Text = "XXXXXXXXXXXXXXXXXXXXXXXXXX"; - this.RootUrlLinkLabel.Visible = false; - this.RootUrlLinkLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LaunchBrowser); - // - // ApplicationPathTextBox - // - this.ApplicationPathTextBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; - this.ApplicationPathTextBox.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.FileSystemDirectories; - this.ApplicationPathTextBox.Location = new System.Drawing.Point(12, 53); - this.ApplicationPathTextBox.Name = "ApplicationPathTextBox"; - this.ApplicationPathTextBox.Size = new System.Drawing.Size(285, 20); - this.ApplicationPathTextBox.TabIndex = 0; - this.toolTip1.SetToolTip(this.ApplicationPathTextBox, "The physical directory of the web application or site to serve."); - // - // VirtualPathTextBox - // - this.VirtualPathTextBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; - this.VirtualPathTextBox.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.RecentlyUsedList; - this.VirtualPathTextBox.Location = new System.Drawing.Point(12, 92); - this.VirtualPathTextBox.Name = "VirtualPathTextBox"; - this.VirtualPathTextBox.Size = new System.Drawing.Size(317, 20); - this.VirtualPathTextBox.TabIndex = 2; - this.VirtualPathTextBox.Text = "/"; - this.toolTip1.SetToolTip(this.VirtualPathTextBox, "The virtual path upon which to root the application."); - // - // HostNameTextBox - // - this.HostNameTextBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; - this.HostNameTextBox.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.RecentlyUsedList; - this.HostNameTextBox.Location = new System.Drawing.Point(12, 131); - this.HostNameTextBox.Name = "HostNameTextBox"; - this.HostNameTextBox.Size = new System.Drawing.Size(213, 20); - this.HostNameTextBox.TabIndex = 3; - this.toolTip1.SetToolTip(this.HostNameTextBox, resources.GetString("HostNameTextBox.ToolTip")); - this.HostNameTextBox.TextChanged += new System.EventHandler(this.HostNameChanged); - // - // LabelPhysicalPath - // - this.LabelPhysicalPath.AutoSize = true; - this.LabelPhysicalPath.Location = new System.Drawing.Point(12, 36); - this.LabelPhysicalPath.Name = "LabelPhysicalPath"; - this.LabelPhysicalPath.Size = new System.Drawing.Size(71, 13); - this.LabelPhysicalPath.TabIndex = 1; - this.LabelPhysicalPath.Text = "Physical Path"; - this.toolTip1.SetToolTip(this.LabelPhysicalPath, "The physical directory of the web application or site to serve."); - // - // AddHostEntryCheckBox - // - this.AddHostEntryCheckBox.AutoSize = true; - this.AddHostEntryCheckBox.Enabled = false; - this.AddHostEntryCheckBox.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.AddHostEntryCheckBox.Location = new System.Drawing.Point(231, 133); - this.AddHostEntryCheckBox.Name = "AddHostEntryCheckBox"; - this.AddHostEntryCheckBox.Size = new System.Drawing.Size(105, 18); - this.AddHostEntryCheckBox.TabIndex = 4; - this.AddHostEntryCheckBox.Text = "Add hosts entry"; - this.toolTip1.SetToolTip(this.AddHostEntryCheckBox, resources.GetString("AddHostEntryCheckBox.ToolTip")); - this.AddHostEntryCheckBox.UseVisualStyleBackColor = true; - // - // LabelVPath - // - this.LabelVPath.AutoSize = true; - this.LabelVPath.Location = new System.Drawing.Point(12, 75); - this.LabelVPath.Name = "LabelVPath"; - this.LabelVPath.Size = new System.Drawing.Size(61, 13); - this.LabelVPath.TabIndex = 3; - this.LabelVPath.Text = "Virtual Path"; - this.toolTip1.SetToolTip(this.LabelVPath, "The virtual path upon which to root the application."); - // - // ButtonBrowsePhysicalPath - // - this.ButtonBrowsePhysicalPath.Location = new System.Drawing.Point(303, 50); - this.ButtonBrowsePhysicalPath.Name = "ButtonBrowsePhysicalPath"; - this.ButtonBrowsePhysicalPath.Size = new System.Drawing.Size(27, 23); - this.ButtonBrowsePhysicalPath.TabIndex = 1; - this.ButtonBrowsePhysicalPath.Text = "..."; - this.toolTip1.SetToolTip(this.ButtonBrowsePhysicalPath, "Browse"); - this.ButtonBrowsePhysicalPath.UseVisualStyleBackColor = true; - this.ButtonBrowsePhysicalPath.Click += new System.EventHandler(this.BrowsePath); - // - // LabelHostName - // - this.LabelHostName.AutoSize = true; - this.LabelHostName.Location = new System.Drawing.Point(12, 115); - this.LabelHostName.Name = "LabelHostName"; - this.LabelHostName.Size = new System.Drawing.Size(106, 13); - this.LabelHostName.TabIndex = 5; - this.LabelHostName.Text = "Host Name (optional)"; - this.toolTip1.SetToolTip(this.LabelHostName, resources.GetString("LabelHostName.ToolTip")); - // - // GroupBoxPort - // - this.GroupBoxPort.Controls.Add(this.PortRangeEndTextBox); - this.GroupBoxPort.Controls.Add(this.PortRangeStartTextBox); - this.GroupBoxPort.Controls.Add(this.PortTextBox); - this.GroupBoxPort.Controls.Add(this.LabelPortRangeSeperator); - this.GroupBoxPort.Controls.Add(this.PortModeFirstAvailableRadioButton); - this.GroupBoxPort.Controls.Add(this.PortModeSpecificRadioButton); - this.GroupBoxPort.Location = new System.Drawing.Point(12, 213); - this.GroupBoxPort.Name = "GroupBoxPort"; - this.GroupBoxPort.Size = new System.Drawing.Size(324, 47); - this.GroupBoxPort.TabIndex = 9; - this.GroupBoxPort.TabStop = false; - this.GroupBoxPort.Text = "Port"; - // - // PortRangeEndTextBox - // - this.PortRangeEndTextBox.Location = new System.Drawing.Point(261, 12); - this.PortRangeEndTextBox.Maximum = new decimal(new int[] { - 65535, - 0, - 0, - 0}); - this.PortRangeEndTextBox.Minimum = new decimal(new int[] { - 2, - 0, - 0, - 0}); - this.PortRangeEndTextBox.Name = "PortRangeEndTextBox"; - this.PortRangeEndTextBox.Size = new System.Drawing.Size(57, 20); - this.PortRangeEndTextBox.TabIndex = 19; - this.PortRangeEndTextBox.Value = new decimal(new int[] { - 65535, - 0, - 0, - 0}); - // - // PortRangeStartTextBox - // - this.PortRangeStartTextBox.Location = new System.Drawing.Point(182, 12); - this.PortRangeStartTextBox.Maximum = new decimal(new int[] { - 65534, - 0, - 0, - 0}); - this.PortRangeStartTextBox.Minimum = new decimal(new int[] { - 1, - 0, - 0, - 0}); - this.PortRangeStartTextBox.Name = "PortRangeStartTextBox"; - this.PortRangeStartTextBox.Size = new System.Drawing.Size(57, 20); - this.PortRangeStartTextBox.TabIndex = 18; - this.PortRangeStartTextBox.Value = new decimal(new int[] { - 32768, - 0, - 0, - 0}); - // - // PortTextBox - // - this.PortTextBox.Location = new System.Drawing.Point(65, 12); - this.PortTextBox.Maximum = new decimal(new int[] { - 65535, - 0, - 0, - 0}); - this.PortTextBox.Name = "PortTextBox"; - this.PortTextBox.Size = new System.Drawing.Size(57, 20); - this.PortTextBox.TabIndex = 17; - // - // LabelPortRangeSeperator - // - this.LabelPortRangeSeperator.AutoSize = true; - this.LabelPortRangeSeperator.Location = new System.Drawing.Point(239, 16); - this.LabelPortRangeSeperator.Name = "LabelPortRangeSeperator"; - this.LabelPortRangeSeperator.Size = new System.Drawing.Size(22, 13); - this.LabelPortRangeSeperator.TabIndex = 16; - this.LabelPortRangeSeperator.Text = "<->"; - this.toolTip1.SetToolTip(this.LabelPortRangeSeperator, "Host on the first available port found in specified range."); - // - // PortModeFirstAvailableRadioButton - // - this.PortModeFirstAvailableRadioButton.AutoSize = true; - this.PortModeFirstAvailableRadioButton.Checked = true; - this.PortModeFirstAvailableRadioButton.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.PortModeFirstAvailableRadioButton.Location = new System.Drawing.Point(128, 13); - this.PortModeFirstAvailableRadioButton.Name = "PortModeFirstAvailableRadioButton"; - this.PortModeFirstAvailableRadioButton.Size = new System.Drawing.Size(63, 18); - this.PortModeFirstAvailableRadioButton.TabIndex = 6; - this.PortModeFirstAvailableRadioButton.TabStop = true; - this.PortModeFirstAvailableRadioButton.Text = "Range"; - this.toolTip1.SetToolTip(this.PortModeFirstAvailableRadioButton, "Host on the first available port found in specified range."); - this.PortModeFirstAvailableRadioButton.UseVisualStyleBackColor = true; - this.PortModeFirstAvailableRadioButton.CheckedChanged += new System.EventHandler(this.RadioButtonPortFind_CheckedChanged); - // - // PortModeSpecificRadioButton - // - this.PortModeSpecificRadioButton.AutoSize = true; - this.PortModeSpecificRadioButton.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.PortModeSpecificRadioButton.Location = new System.Drawing.Point(6, 13); - this.PortModeSpecificRadioButton.Name = "PortModeSpecificRadioButton"; - this.PortModeSpecificRadioButton.Size = new System.Drawing.Size(69, 18); - this.PortModeSpecificRadioButton.TabIndex = 6; - this.PortModeSpecificRadioButton.TabStop = true; - this.PortModeSpecificRadioButton.Text = "Specific"; - this.toolTip1.SetToolTip(this.PortModeSpecificRadioButton, "Host on specific port. \r\nIf port is already in use a warning will be issued and s" + - "erver will not start."); - this.PortModeSpecificRadioButton.UseVisualStyleBackColor = true; - this.PortModeSpecificRadioButton.CheckedChanged += new System.EventHandler(this.RadioButtonPortSpecific_CheckedChanged); - // - // GroupBoxIPAddress - // - this.GroupBoxIPAddress.Controls.Add(this.IPSpecificTextBox); - this.GroupBoxIPAddress.Controls.Add(this.IPV6CheckBox); - this.GroupBoxIPAddress.Controls.Add(this.RadioButtonIPSpecific); - this.GroupBoxIPAddress.Controls.Add(this.IPModeAnyRadioButton); - this.GroupBoxIPAddress.Controls.Add(this.IPModeLoopBackRadioButton); - this.GroupBoxIPAddress.Location = new System.Drawing.Point(12, 154); - this.GroupBoxIPAddress.Name = "GroupBoxIPAddress"; - this.GroupBoxIPAddress.Size = new System.Drawing.Size(324, 58); - this.GroupBoxIPAddress.TabIndex = 8; - this.GroupBoxIPAddress.TabStop = false; - this.GroupBoxIPAddress.Text = "IP Address"; - // - // IPSpecificTextBox - // - this.IPSpecificTextBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.IPSpecificTextBox.FormattingEnabled = true; - this.IPSpecificTextBox.Location = new System.Drawing.Point(216, 14); - this.IPSpecificTextBox.Name = "IPSpecificTextBox"; - this.IPSpecificTextBox.Size = new System.Drawing.Size(101, 21); - this.IPSpecificTextBox.TabIndex = 9; - // - // IPV6CheckBox - // - this.IPV6CheckBox.AutoSize = true; - this.IPV6CheckBox.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.IPV6CheckBox.Location = new System.Drawing.Point(39, 35); - this.IPV6CheckBox.Name = "IPV6CheckBox"; - this.IPV6CheckBox.Size = new System.Drawing.Size(77, 18); - this.IPV6CheckBox.TabIndex = 8; - this.IPV6CheckBox.Text = "Use IPV6"; - this.toolTip1.SetToolTip(this.IPV6CheckBox, "Use the IPV6 version of selected IP"); - this.IPV6CheckBox.UseVisualStyleBackColor = true; - // - // RadioButtonIPSpecific - // - this.RadioButtonIPSpecific.AutoSize = true; - this.RadioButtonIPSpecific.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.RadioButtonIPSpecific.Location = new System.Drawing.Point(150, 15); - this.RadioButtonIPSpecific.Name = "RadioButtonIPSpecific"; - this.RadioButtonIPSpecific.Size = new System.Drawing.Size(69, 18); - this.RadioButtonIPSpecific.TabIndex = 5; - this.RadioButtonIPSpecific.Text = "Specific"; - this.toolTip1.SetToolTip(this.RadioButtonIPSpecific, "Host on specified IP address.\r\nWCF Services may not be served using this setting." + - " Use Loopback."); - this.RadioButtonIPSpecific.UseVisualStyleBackColor = true; - this.RadioButtonIPSpecific.CheckedChanged += new System.EventHandler(this.RadioButtonIPSpecific_CheckedChanged); - // - // IPModeAnyRadioButton - // - this.IPModeAnyRadioButton.AutoSize = true; - this.IPModeAnyRadioButton.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.IPModeAnyRadioButton.Location = new System.Drawing.Point(88, 15); - this.IPModeAnyRadioButton.Name = "IPModeAnyRadioButton"; - this.IPModeAnyRadioButton.Size = new System.Drawing.Size(49, 18); - this.IPModeAnyRadioButton.TabIndex = 5; - this.IPModeAnyRadioButton.Text = "Any"; - this.toolTip1.SetToolTip(this.IPModeAnyRadioButton, "Host on all IP addresses at the specified port.\r\nWCF Services may not be served u" + - "sing this setting. Use Loopback."); - this.IPModeAnyRadioButton.UseVisualStyleBackColor = true; - this.IPModeAnyRadioButton.CheckedChanged += new System.EventHandler(this.RadioButtonIPAny_CheckedChanged); - // - // IPModeLoopBackRadioButton - // - this.IPModeLoopBackRadioButton.AutoSize = true; - this.IPModeLoopBackRadioButton.Checked = true; - this.IPModeLoopBackRadioButton.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.IPModeLoopBackRadioButton.Location = new System.Drawing.Point(6, 15); - this.IPModeLoopBackRadioButton.Name = "IPModeLoopBackRadioButton"; - this.IPModeLoopBackRadioButton.Size = new System.Drawing.Size(79, 18); - this.IPModeLoopBackRadioButton.TabIndex = 5; - this.IPModeLoopBackRadioButton.TabStop = true; - this.IPModeLoopBackRadioButton.Text = "Loopback"; - this.toolTip1.SetToolTip(this.IPModeLoopBackRadioButton, "Use the default loopback adapter. \r\nIf any sort of WCF service is to be served, t" + - "his is the only viable option."); - this.IPModeLoopBackRadioButton.UseVisualStyleBackColor = true; - this.IPModeLoopBackRadioButton.CheckedChanged += new System.EventHandler(this.RadioButtonIPLoopBack_CheckedChanged); - // - // ButtonStart - // - this.ButtonStart.Location = new System.Drawing.Point(261, 335); - this.ButtonStart.Name = "ButtonStart"; - this.ButtonStart.Size = new System.Drawing.Size(75, 23); - this.ButtonStart.TabIndex = 22; - this.ButtonStart.Text = "Start"; - this.toolTip1.SetToolTip(this.ButtonStart, "Start hosting application using specified criteria"); - this.ButtonStart.UseVisualStyleBackColor = true; - this.ButtonStart.Click += new System.EventHandler(this.StartStop); - // - // errorProvider1 - // - this.errorProvider1.ContainerControl = this; - // - // LabelIdleTimeOut - // - this.LabelIdleTimeOut.AutoSize = true; - this.LabelIdleTimeOut.Location = new System.Drawing.Point(15, 270); - this.LabelIdleTimeOut.Name = "LabelIdleTimeOut"; - this.LabelIdleTimeOut.Size = new System.Drawing.Size(73, 13); - this.LabelIdleTimeOut.TabIndex = 26; - this.LabelIdleTimeOut.Text = "Idle Time Out:"; - this.toolTip1.SetToolTip(this.LabelIdleTimeOut, "The amount of time, in milliseconds, to remain idle, i.e. no requests, before sto" + - "pping the server."); - // - // TrayIcon - // - this.TrayIcon.ContextMenuStrip = this.contextMenuStrip1; - this.TrayIcon.Icon = ((System.Drawing.Icon)(resources.GetObject("TrayIcon.Icon"))); - this.TrayIcon.Text = "notifyIcon1"; - this.TrayIcon.BalloonTipClicked += new System.EventHandler(this.ShowMainForm); - this.TrayIcon.DoubleClick += new System.EventHandler(this.ShowMainForm); - // - // contextMenuStrip1 - // - this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.showToolStripMenuItem, - this.browseToolStripMenuItem, - this.toolStripSeparator2, - this.ShowLogMenuItem, - this.toolStripSeparator1, - this.closeToolStripMenuItem, - this.helpToolStripMenuItem}); - this.contextMenuStrip1.Name = "contextMenuStrip1"; - this.contextMenuStrip1.Size = new System.Drawing.Size(117, 126); - // - // showToolStripMenuItem - // - this.showToolStripMenuItem.Name = "showToolStripMenuItem"; - this.showToolStripMenuItem.Size = new System.Drawing.Size(116, 22); - this.showToolStripMenuItem.Text = "&Show"; - this.showToolStripMenuItem.Click += new System.EventHandler(this.ShowMainForm); - // - // browseToolStripMenuItem - // - this.browseToolStripMenuItem.Name = "browseToolStripMenuItem"; - this.browseToolStripMenuItem.Size = new System.Drawing.Size(116, 22); - this.browseToolStripMenuItem.Text = "&Browse"; - this.browseToolStripMenuItem.Click += new System.EventHandler(this.LaunchBrowser); - // - // toolStripSeparator2 - // - this.toolStripSeparator2.Name = "toolStripSeparator2"; - this.toolStripSeparator2.Size = new System.Drawing.Size(113, 6); - // - // ShowLogMenuItem - // - this.ShowLogMenuItem.Enabled = false; - this.ShowLogMenuItem.Name = "ShowLogMenuItem"; - this.ShowLogMenuItem.Size = new System.Drawing.Size(116, 22); - this.ShowLogMenuItem.Text = "&View Log"; - this.ShowLogMenuItem.Click += new System.EventHandler(this.ShowLog); - // - // toolStripSeparator1 - // - this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(113, 6); - // - // closeToolStripMenuItem - // - this.closeToolStripMenuItem.Name = "closeToolStripMenuItem"; - this.closeToolStripMenuItem.Size = new System.Drawing.Size(116, 22); - this.closeToolStripMenuItem.Text = "&Exit"; - this.closeToolStripMenuItem.Click += new System.EventHandler(this.ExitApp); - // - // helpToolStripMenuItem - // - this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; - this.helpToolStripMenuItem.Size = new System.Drawing.Size(116, 22); - this.helpToolStripMenuItem.Text = "&Help"; - this.helpToolStripMenuItem.Click += new System.EventHandler(this.ShowHelp); - // - // statusStrip1 - // - this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.toolStripStatusLabel1}); - this.statusStrip1.Location = new System.Drawing.Point(0, 370); - this.statusStrip1.Name = "statusStrip1"; - this.statusStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional; - this.statusStrip1.Size = new System.Drawing.Size(343, 22); - this.statusStrip1.SizingGrip = false; - this.statusStrip1.TabIndex = 27; - this.statusStrip1.Text = "statusStrip1"; - // - // toolStripStatusLabel1 - // - this.toolStripStatusLabel1.Name = "toolStripStatusLabel1"; - this.toolStripStatusLabel1.Size = new System.Drawing.Size(118, 17); - this.toolStripStatusLabel1.Text = "ASP.Net Version XXXXX"; - // - // ShowLogButton - // - this.ShowLogButton.Location = new System.Drawing.Point(176, 335); - this.ShowLogButton.Margin = new System.Windows.Forms.Padding(0); - this.ShowLogButton.Name = "ShowLogButton"; - this.ShowLogButton.Size = new System.Drawing.Size(75, 23); - this.ShowLogButton.TabIndex = 28; - this.ShowLogButton.Text = "Show &Log"; - this.ShowLogButton.Click += new System.EventHandler(this.ShowLog); - // - // menuStrip1 - // - this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.fileToolStripMenuItem, - this.optionsToolStripMenuItem, - this.helpToolStripMenuItem1}); - this.menuStrip1.Location = new System.Drawing.Point(0, 0); - this.menuStrip1.Name = "menuStrip1"; - this.menuStrip1.Size = new System.Drawing.Size(343, 24); - this.menuStrip1.TabIndex = 29; - this.menuStrip1.Text = "menuStrip1"; - // - // fileToolStripMenuItem - // - this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.hideToolStripMenuItem, - this.toolStripSeparator4, - this.exitToolStripMenuItem}); - this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; - this.fileToolStripMenuItem.Size = new System.Drawing.Size(35, 20); - this.fileToolStripMenuItem.Text = "&File"; - // - // hideToolStripMenuItem - // - this.hideToolStripMenuItem.Name = "hideToolStripMenuItem"; - this.hideToolStripMenuItem.Size = new System.Drawing.Size(95, 22); - this.hideToolStripMenuItem.Text = "&Hide"; - this.hideToolStripMenuItem.Click += new System.EventHandler(this.HideMainForm); - // - // toolStripSeparator4 - // - this.toolStripSeparator4.Name = "toolStripSeparator4"; - this.toolStripSeparator4.Size = new System.Drawing.Size(92, 6); - // - // exitToolStripMenuItem - // - this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; - this.exitToolStripMenuItem.Size = new System.Drawing.Size(95, 22); - this.exitToolStripMenuItem.Text = "E&xit"; - this.exitToolStripMenuItem.Click += new System.EventHandler(this.ExitApp); - // - // optionsToolStripMenuItem - // - this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.nTLMAuthenticationRequiredToolStripMenuItem, - this.directoryBrowsingEnabledToolStripMenuItem}); - this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; - this.optionsToolStripMenuItem.Size = new System.Drawing.Size(56, 20); - this.optionsToolStripMenuItem.Text = "&Options"; - // - // nTLMAuthenticationRequiredToolStripMenuItem - // - this.nTLMAuthenticationRequiredToolStripMenuItem.CheckOnClick = true; - this.nTLMAuthenticationRequiredToolStripMenuItem.Name = "nTLMAuthenticationRequiredToolStripMenuItem"; - this.nTLMAuthenticationRequiredToolStripMenuItem.Size = new System.Drawing.Size(219, 22); - this.nTLMAuthenticationRequiredToolStripMenuItem.Text = "NTLM Authentication Required"; - this.nTLMAuthenticationRequiredToolStripMenuItem.ToolTipText = "When checked, require windows authentication via NTLM."; - // - // directoryBrowsingEnabledToolStripMenuItem - // - this.directoryBrowsingEnabledToolStripMenuItem.Checked = true; - this.directoryBrowsingEnabledToolStripMenuItem.CheckOnClick = true; - this.directoryBrowsingEnabledToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; - this.directoryBrowsingEnabledToolStripMenuItem.Name = "directoryBrowsingEnabledToolStripMenuItem"; - this.directoryBrowsingEnabledToolStripMenuItem.Size = new System.Drawing.Size(219, 22); - this.directoryBrowsingEnabledToolStripMenuItem.Text = "Directory Browsing Enabled"; - this.directoryBrowsingEnabledToolStripMenuItem.ToolTipText = "When checked, if no default document is found display a directory listing."; - // - // helpToolStripMenuItem1 - // - this.helpToolStripMenuItem1.Name = "helpToolStripMenuItem1"; - this.helpToolStripMenuItem1.Size = new System.Drawing.Size(40, 20); - this.helpToolStripMenuItem1.Text = "&Help"; - this.helpToolStripMenuItem1.Click += new System.EventHandler(this.ShowHelp); - // - // TimeOutNumeric - // - this.TimeOutNumeric.Increment = new decimal(new int[] { - 1000, - 0, - 0, - 0}); - this.TimeOutNumeric.Location = new System.Drawing.Point(95, 266); - this.TimeOutNumeric.Maximum = new decimal(new int[] { - 2000000000, - 0, - 0, - 0}); - this.TimeOutNumeric.Name = "TimeOutNumeric"; - this.TimeOutNumeric.Size = new System.Drawing.Size(66, 20); - this.TimeOutNumeric.TabIndex = 30; - // - // FormView - // - this.AcceptButton = this.ButtonStart; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.SystemColors.Control; - this.ClientSize = new System.Drawing.Size(343, 392); - this.Controls.Add(this.menuStrip1); - this.Controls.Add(this.TimeOutNumeric); - this.Controls.Add(this.statusStrip1); - this.Controls.Add(this.LabelIdleTimeOut); - this.Controls.Add(this.ApplicationPathTextBox); - this.Controls.Add(this.ShowLogButton); - this.Controls.Add(this.VirtualPathTextBox); - this.Controls.Add(this.HostNameTextBox); - this.Controls.Add(this.RootUrlLinkLabel); - this.Controls.Add(this.LabelPhysicalPath); - this.Controls.Add(this.LabelVPath); - this.Controls.Add(this.GroupBoxIPAddress); - this.Controls.Add(this.ButtonStart); - this.Controls.Add(this.AddHostEntryCheckBox); - this.Controls.Add(this.GroupBoxPort); - this.Controls.Add(this.ButtonBrowsePhysicalPath); - this.Controls.Add(this.LabelHostName); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "FormView"; - this.ShowInTaskbar = false; - this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; - this.Text = "Cassini Developer Edition"; - this.WindowState = System.Windows.Forms.FormWindowState.Minimized; - this.GroupBoxPort.ResumeLayout(false); - this.GroupBoxPort.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.PortRangeEndTextBox)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.PortRangeStartTextBox)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.PortTextBox)).EndInit(); - this.GroupBoxIPAddress.ResumeLayout(false); - this.GroupBoxIPAddress.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.errorProvider1)).EndInit(); - this.contextMenuStrip1.ResumeLayout(false); - this.statusStrip1.ResumeLayout(false); - this.statusStrip1.PerformLayout(); - this.menuStrip1.ResumeLayout(false); - this.menuStrip1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.TimeOutNumeric)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.LinkLabel RootUrlLinkLabel; - private System.Windows.Forms.TextBox ApplicationPathTextBox; - private System.Windows.Forms.TextBox VirtualPathTextBox; - private System.Windows.Forms.TextBox HostNameTextBox; - private System.Windows.Forms.Label LabelPhysicalPath; - private System.Windows.Forms.CheckBox AddHostEntryCheckBox; - private System.Windows.Forms.Label LabelVPath; - private System.Windows.Forms.Button ButtonBrowsePhysicalPath; - private System.Windows.Forms.Label LabelHostName; - private System.Windows.Forms.GroupBox GroupBoxPort; - private System.Windows.Forms.Label LabelPortRangeSeperator; - private System.Windows.Forms.RadioButton PortModeFirstAvailableRadioButton; - private System.Windows.Forms.RadioButton PortModeSpecificRadioButton; - private System.Windows.Forms.GroupBox GroupBoxIPAddress; - private System.Windows.Forms.RadioButton RadioButtonIPSpecific; - private System.Windows.Forms.RadioButton IPModeAnyRadioButton; - private System.Windows.Forms.RadioButton IPModeLoopBackRadioButton; - private System.Windows.Forms.Button ButtonStart; - private System.Windows.Forms.CheckBox IPV6CheckBox; - private System.Windows.Forms.ErrorProvider errorProvider1; - private System.Windows.Forms.ToolTip toolTip1; - private System.Windows.Forms.Label LabelIdleTimeOut; - internal System.Windows.Forms.NotifyIcon TrayIcon; - private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; - private System.Windows.Forms.ToolStripMenuItem showToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem browseToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; - private System.Windows.Forms.ToolStripMenuItem ShowLogMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; - private System.Windows.Forms.ToolStripMenuItem closeToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem; - private System.Windows.Forms.StatusStrip statusStrip1; - private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1; - private System.Windows.Forms.Button ShowLogButton; - private System.Windows.Forms.MenuStrip menuStrip1; - private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem hideToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator4; - private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem1; - private System.Windows.Forms.ToolStripMenuItem nTLMAuthenticationRequiredToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem directoryBrowsingEnabledToolStripMenuItem; - private System.Windows.Forms.NumericUpDown TimeOutNumeric; - private System.Windows.Forms.NumericUpDown PortTextBox; - private System.Windows.Forms.NumericUpDown PortRangeStartTextBox; - private System.Windows.Forms.NumericUpDown PortRangeEndTextBox; - private System.Windows.Forms.ComboBox IPSpecificTextBox; - } -} \ No newline at end of file diff --git a/CassiniDev/Views/FormView.cs b/CassiniDev/Views/FormView.cs deleted file mode 100644 index dbe0ea332..000000000 --- a/CassiniDev/Views/FormView.cs +++ /dev/null @@ -1,834 +0,0 @@ -// ********************************************************************************** -// CassiniDev - http://cassinidev.codeplex.com -// -// Copyright (c) Sky Sanders. All rights reserved. -// -// This source code is subject to terms and conditions of the Microsoft Public -// License (Ms-PL). A copy of the license can be found in the license.htm file -// included in this distribution. -// -// You must not remove this notice, or any other, from this software. -// -// ********************************************************************************** - -#region - -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Diagnostics; -using System.Linq; -using System.Net; -using System.Reflection; -using System.Threading; -using System.Windows.Forms; -using CassiniDev.ServerLog; - -#endregion - -namespace CassiniDev -{ - public partial class FormView : Form - { - #region Fields - - private bool _automated; - - private LogView _logForm; - - private RunState _runState; - - private Server _server; - - #endregion - - #region Constructors - - public FormView(Server server) - { - _server = server; - InitializeComponent(); - InitializeUI(); - } - - #endregion - - #region Properties - - internal bool AddHost - { - get { return AddHostEntryCheckBox.Checked; } - set { AddHostEntryCheckBox.Checked = value; } - } - - internal string ApplicationPath - { - get { return ApplicationPathTextBox.Text; } - set { ApplicationPathTextBox.Text = value; } - } - - internal string HostName - { - get { return HostNameTextBox.Text; } - set { HostNameTextBox.Text = value; } - } - - internal string IPAddress - { - get { return IPSpecificTextBox.Text; } - set { IPSpecificTextBox.Text = value; } - } - - internal IPMode IPMode - { - get { return GetIpMode(); } - set { SetIpMode(value); } - } - - - internal bool NoDirList - { - get { return !directoryBrowsingEnabledToolStripMenuItem.Checked; } - set { directoryBrowsingEnabledToolStripMenuItem.Checked = !value; } - } - - internal bool NtmlAuthenticationRequired - { - get { return nTLMAuthenticationRequiredToolStripMenuItem.Checked; } - set { nTLMAuthenticationRequiredToolStripMenuItem.Checked = value; } - } - - internal int Port - { - get { return (int)PortTextBox.Value; } - set { PortTextBox.Value = value; } - } - - internal PortMode PortMode - { - get { return GetPortMode(); } - set { SetPortMode(value); } - } - - internal int PortRangeEnd - { - get { return (int)PortRangeEndTextBox.Value; } - set { PortRangeEndTextBox.Value = value; } - } - - internal int PortRangeStart - { - get { return (int)PortRangeStartTextBox.Value; } - set { PortRangeStartTextBox.Value = value; } - } - - internal string RootUrl - { - get { return RootUrlLinkLabel.Text; } - set - { - RootUrlLinkLabel.Text = value; - RootUrlLinkLabel.Visible = !string.IsNullOrEmpty(value); - } - } - - internal RunState RunState - { - get { return _runState; } - } - - internal int TimeOut - { - get { return (int)TimeOutNumeric.Value; } - set { TimeOutNumeric.Value = value; } - } - - internal bool V6 - { - get { return IPV6CheckBox.Checked; } - set { IPV6CheckBox.Checked = value; } - } - - internal string VirtualPath - { - get { return VirtualPathTextBox.Text; } - set { VirtualPathTextBox.Text = value; } - } - - #endregion - - #region Protected Methods - - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - - if (disposing && _server != null) - { - _server.Dispose(); - _server = null; - } - base.Dispose(disposing); - } - - /// - /// If the form is closing we need to determine whether to exit - /// or to minimize to tray. - /// - /// - protected override void OnClosing(CancelEventArgs e) - { - // if explicit closure or we are doing nothing then exit app. - if (RunState == RunState.Idle) - { - InvokeStop(); - } - else - { - WindowState = FormWindowState.Minimized; - e.Cancel = true; - } - } - - //protected override void OnShown(EventArgs e) - //{ - // if (_automated) - // { - // WindowState = FormWindowState.Minimized; - // Hide(); - // } - //} - - #endregion - - #region Private Methods - - - private void InitializeUI() - { - ButtonStart.Text = SR.GetString(SR.WebdevStart); - toolStripStatusLabel1.Text = SR.GetString(SR.WebdevAspNetVersion, Common.GetAspVersion()); - - - // if sqlite is missing then just silently enable in-memory logging, - // hide the enable logging item and enable view log item - - - - ShowLogButton.Enabled = false; - - - - toolStripStatusLabel1.Text = SR.GetString(SR.WebdevAspNetVersion, Common.GetAspVersion()); - - List localAddresses = new List(CassiniNetworkUtils.GetLocalAddresses()); - localAddresses.Insert(0, System.Net.IPAddress.IPv6Loopback); - localAddresses.Insert(0, System.Net.IPAddress.Loopback); - - IPSpecificTextBox.Items.AddRange(localAddresses.Select(i => i.ToString()).ToArray()); - if (IPSpecificTextBox.Items.Count > 0) - { - IPSpecificTextBox.SelectedIndex = 0; - IPSpecificTextBox.Text = IPSpecificTextBox.Items[0].ToString(); - } - - InvokeSetRunState(RunState.Idle); - if (_server == null) - { - ShowMainForm(); - } - else - { - _automated = true; - _server.TimedOut += OnTimedOut; - IPMode = IPMode.Specific; - PortMode = PortMode.Specific; - - UpdateUIFromServer(); - - - InvokeSetRunState(RunState.Running); - base.Text = SR.GetString(SR.WebdevNameWithPort, _server.Port); - TrayIcon.Visible = true; - DisplayTrayTip(); - } - } - - private void DisplayTrayTip() - { - - if (_server==null) - { - return; - } - TrayIcon.Text = _server.RootUrl; - string trayBaloonText = _server.RootUrl; - TrayIcon.ShowBalloonTip(5000, base.Text, trayBaloonText, ToolTipIcon.Info); - } - - private void UpdateUIFromServer() - { - base.Text = SR.GetString(SR.WebdevNameWithPort, _server.Port); - RootUrl = _server.RootUrl; - ApplicationPath = _server.PhysicalPath; - IPAddress = _server.IPAddress.ToString(); - Port = _server.Port; - HostName = _server.HostName; - NtmlAuthenticationRequired = _server.RequireAuthentication; - NoDirList = _server.DisableDirectoryListing; - TimeOut = _server.TimeoutInterval; - } - - protected override void OnResize(EventArgs e) - { - if (WindowState == FormWindowState.Minimized) - { - Hide(); - DisplayTrayTip(); - ShowInTaskbar = false; - } - base.OnResize(e); - } - - - private void ShowMainForm() - { - Show(); - WindowState = FormWindowState.Normal; - ShowInTaskbar = true; - - - //TrayIcon.Visible = false; - //ShowInTaskbar = true; - - //TopMost = true; - //Focus(); - //BringToFront(); - //TopMost = false; - } - - private void InvokeSetRunState(RunState state) - { - // use invoke, runstate may come from another thread. - if (InvokeRequired) - { - Invoke(new ParameterizedThreadStart(SetRunState), state); - } - else - { - SetRunState(state); - } - } - - /// - /// Sets RunState and enables/disables form fields accordingly - /// - /// - private void SetRunState(object state) - { - _runState = (RunState)state; - - switch (_runState) - { - case RunState.Idle: - if (!_automated) - { - EnableForm(); - } - // if not automated we are on our way out - break; - case RunState.Running: - DisableForm(); - break; - } - } - - - - - private void EnableForm() - { - ShowLogMenuItem.Enabled = ShowLogButton.Enabled = false; - base.Text = SR.GetString(SR.WebdevName); - ButtonStart.Text = "&Start"; - ButtonStart.Enabled = true; - nTLMAuthenticationRequiredToolStripMenuItem.Enabled = true; - directoryBrowsingEnabledToolStripMenuItem.Enabled = true; - ApplicationPathTextBox.Enabled = true; - ButtonBrowsePhysicalPath.Enabled = true; - VirtualPathTextBox.Enabled = true; - HostNameTextBox.Enabled = true; - GroupBoxIPAddress.Enabled = true; - GroupBoxPort.Enabled = true; - LabelHostName.Enabled = true; - LabelPhysicalPath.Enabled = true; - LabelVPath.Enabled = true; - TimeOutNumeric.Enabled = true; - RootUrl = null; - - AddHostEntryCheckBox.Enabled = !String.IsNullOrEmpty(HostName); - - switch (IPMode) - { - case IPMode.Loopback: - RadioButtonIPLoopBack_CheckedChanged(null, EventArgs.Empty); - break; - case IPMode.Any: - RadioButtonIPAny_CheckedChanged(null, EventArgs.Empty); - break; - case IPMode.Specific: - RadioButtonIPSpecific_CheckedChanged(null, EventArgs.Empty); - break; - } - - switch (PortMode) - { - case PortMode.FirstAvailable: - RadioButtonPortFind_CheckedChanged(null, EventArgs.Empty); - break; - case PortMode.Specific: - RadioButtonPortSpecific_CheckedChanged(null, EventArgs.Empty); - break; - } - - HostNameChanged(null, EventArgs.Empty); - } - - private void DisableForm() - { - ShowLogMenuItem.Enabled = ShowLogButton.Enabled = true; - - TimeOutNumeric.Enabled = false; - ButtonStart.Text = "&Stop"; - directoryBrowsingEnabledToolStripMenuItem.Enabled = false; - nTLMAuthenticationRequiredToolStripMenuItem.Enabled = false; - ApplicationPathTextBox.Enabled = false; - ButtonBrowsePhysicalPath.Enabled = false; - VirtualPathTextBox.Enabled = false; - HostNameTextBox.Enabled = false; - GroupBoxIPAddress.Enabled = false; - GroupBoxPort.Enabled = false; - AddHostEntryCheckBox.Enabled = false; - LabelHostName.Enabled = false; - LabelPhysicalPath.Enabled = false; - LabelVPath.Enabled = false; - } - - private void HostNameChanged() - { - if (string.IsNullOrEmpty(HostName)) - { - AddHostEntryCheckBox.Enabled = false; - AddHost = false; - } - else - { - AddHostEntryCheckBox.Enabled = true; - } - } - - - private void StartStop() - { - if (RunState != RunState.Running) - { - DisableForm(); - Start(); - } - else - { - InvokeStop(); - } - } - - private CommandLineArguments GetArgs() - { - CommandLineArguments args = new CommandLineArguments - { - AddHost = AddHost, - ApplicationPath = ApplicationPath, - HostName = HostName, - IPAddress = IPAddress, - IPMode = IPMode, - IPv6 = V6, - Port = Port, - PortMode = PortMode, - PortRangeEnd = PortRangeEnd, - PortRangeStart = PortRangeStart, - VirtualPath = VirtualPath, - TimeOut = TimeOut, - WaitForPort = 0, - Ntlm = NtmlAuthenticationRequired, - Nodirlist = NoDirList - }; - return args; - } - private void Start() - { - // use CommandLineArguments as a pre validation tool - - CommandLineArguments args = GetArgs(); - ClearError(); - - try - { - args.Validate(); - } - - catch (CassiniException ex) - { - SetError(ex.Field, ex.Message); - return; - } - - IPAddress = args.IPAddress; - - Port = args.Port; - - HostName = args.HostName; - - _server = new Server(args.Port, args.VirtualPath, args.ApplicationPath, - System.Net.IPAddress.Parse(args.IPAddress), args.HostName, args.TimeOut, args.Ntlm, - args.Nodirlist); - - if (args.AddHost) - { - HostsFile.AddHostEntry(_server.IPAddress.ToString(), _server.HostName); - } - - try - { - _server.Start(); - _server.TimedOut += OnTimedOut; - UpdateUIFromServer(); - InvokeSetRunState(RunState.Running); - - } - - catch (Exception ex) - { - SetError(ErrorField.None, ex.Message); - _server.Dispose(); - } - } - - /// - /// The server could be stopped either by user action, - /// timeout or exception. If by timeout, the call will be - /// coming from another thread in another appdomain far far - /// away, so we execise caution and wrap the method that - /// actual does the stoppage in this invokable wrapper. - /// - private void InvokeStop() - { - if (InvokeRequired) - { - Invoke(new MethodInvoker(Stop)); - } - else - { - Stop(); - } - } - - private void Stop() - { - // kill the start button so we don't get a start - // signal before completely stopped. - ButtonStart.Enabled = false; - - // revert the host file modification, if necessary - if (AddHost && RunState == RunState.Running) - { - HostsFile.RemoveHostEntry(_server.IPAddress.ToString(), _server.HostName); - } - - if (_server != null) - { - _server.TimedOut -= OnTimedOut; - _server.Dispose(); - } - - RootUrl = string.Empty; - - InvokeSetRunState(RunState.Idle); - - if (_automated) - { - ExitApp(); - } - } - - - - private static void ExitApp() - { - Application.Exit(); - } - - - private static void ShowHelp() - { - MessageBox.Show("help/about TODO"); - } - - private void ShowLog() - { - if (_logForm == null || _logForm.IsDisposed) - { - _logForm = new LogView(_server); - } - _logForm.Show(); - _logForm.BringToFront(); - } - - - private void BrowsePath() - { - FolderBrowserDialog fbd = new FolderBrowserDialog(); - - if (fbd.ShowDialog() == DialogResult.OK) - { - ApplicationPath = fbd.SelectedPath; - } - } - - private void LaunchBrowser() - { - Process.Start(RootUrlLinkLabel.Text); - } - - - private IPMode GetIpMode() - { - IPMode result; - if (IPModeAnyRadioButton.Checked) - { - result = IPMode.Any; - } - else if (IPModeLoopBackRadioButton.Checked) - { - result = IPMode.Loopback; - } - else - { - result = IPMode.Specific; - } - return result; - } - - private PortMode GetPortMode() - { - return PortModeSpecificRadioButton.Checked ? PortMode.Specific : PortMode.FirstAvailable; - } - - - - private void SetIpMode(IPMode value) - { - switch (value) - { - case IPMode.Loopback: - IPModeLoopBackRadioButton.Checked = true; - break; - case IPMode.Any: - IPModeAnyRadioButton.Checked = true; - break; - case IPMode.Specific: - RadioButtonIPSpecific.Checked = true; - break; - } - } - - private void SetPortMode(PortMode value) - { - switch (value) - { - case PortMode.FirstAvailable: - PortModeFirstAvailableRadioButton.Checked = true; - break; - case PortMode.Specific: - PortModeSpecificRadioButton.Checked = true; - break; - } - } - - - - private void SetError(ErrorField field, string value) - { - EnableForm(); - switch (field) - { - case ErrorField.ApplicationPath: - errorProvider1.SetError(ApplicationPathTextBox, value); - break; - case ErrorField.VirtualPath: - errorProvider1.SetError(VirtualPathTextBox, value); - break; - case ErrorField.HostName: - errorProvider1.SetError(HostNameTextBox, value); - break; - case ErrorField.IsAddHost: - errorProvider1.SetError(AddHostEntryCheckBox, value); - break; - case ErrorField.IPAddress: - errorProvider1.SetError(IPSpecificTextBox, value); - break; - case ErrorField.IPAddressAny: - errorProvider1.SetError(IPModeAnyRadioButton, value); - break; - case ErrorField.IPAddressLoopBack: - errorProvider1.SetError(IPModeLoopBackRadioButton, value); - break; - case ErrorField.Port: - errorProvider1.SetError(PortTextBox, value); - break; - case ErrorField.PortRange: - errorProvider1.SetError(PortRangeStartTextBox, value); - errorProvider1.SetError(PortRangeEndTextBox, value); - break; - case ErrorField.PortRangeStart: - errorProvider1.SetError(PortRangeStartTextBox, value); - break; - case ErrorField.PortRangeEnd: - errorProvider1.SetError(PortRangeEndTextBox, value); - break; - case ErrorField.None: - MessageBox.Show(value, "Error"); - break; - } - } - - private void ClearError() - { - errorProvider1.Clear(); - } - - - #endregion - - #region Handlers - - private void BrowsePath(object sender, EventArgs e) - { - BrowsePath(); - } - - private void HideMainForm(object sender, EventArgs e) - { - Close(); - } - - private void LaunchBrowser(object sender, EventArgs e) - { - LaunchBrowser(); - } - - private void LaunchBrowser(object sender, LinkLabelLinkClickedEventArgs e) - { - LaunchBrowser(); - } - - private void ShowHelp(object sender, EventArgs e) - { - ShowHelp(); - } - - private void ShowLog(object sender, EventArgs e) - { - ShowLog(); - } - - private void ShowMainForm(object sender, EventArgs e) - { - ShowMainForm(); - } - - /// - /// Responds to the Start/Stop button - /// - /// - /// - private void StartStop(object sender, EventArgs e) - { - StartStop(); - } - - - private void ExitApp(object sender, EventArgs e) - { - ExitApp(); - } - - private void HostNameChanged(object sender, EventArgs e) - { - HostNameChanged(); - } - - - /// - /// If a timeout value is specifically set and we - /// get a timeout event, just exit the application. - /// This should always be the case, but will be - /// a bit forgiving here and perform a check before - /// dumping. - /// - private void OnTimedOut(object sender, EventArgs e) - { - InvokeStop(); - - if (TimeOut > 0) - { - ExitApp(); - } - else - { - ShowMainForm(); - } - } - - #region Hinky lookin radios that depend on known state. Could be a source of trouble. - - private void RadioButtonIPAny_CheckedChanged(object sender, EventArgs e) - { - IPSpecificTextBox.Enabled = false; - IPV6CheckBox.Enabled = true; - } - - private void RadioButtonIPLoopBack_CheckedChanged(object sender, EventArgs e) - { - IPSpecificTextBox.Enabled = false; - IPV6CheckBox.Enabled = true; - } - - private void RadioButtonIPSpecific_CheckedChanged(object sender, EventArgs e) - { - IPSpecificTextBox.Enabled = true; - IPV6CheckBox.Enabled = false; - IPV6CheckBox.Checked = false; - } - - private void RadioButtonPortFind_CheckedChanged(object sender, EventArgs e) - { - PortTextBox.Enabled = false; - PortRangeEndTextBox.Enabled = true; - PortRangeStartTextBox.Enabled = true; - } - - private void RadioButtonPortSpecific_CheckedChanged(object sender, EventArgs e) - { - PortTextBox.Enabled = true; - PortRangeEndTextBox.Enabled = false; - PortRangeStartTextBox.Enabled = false; - } - #endregion - - #endregion - - - } -} \ No newline at end of file diff --git a/CassiniDev/Views/FormView.resx b/CassiniDev/Views/FormView.resx deleted file mode 100644 index 4e1ac2245..000000000 --- a/CassiniDev/Views/FormView.resx +++ /dev/null @@ -1,290 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 147, 17 - - - The host name to use in place of 'localhost'. -This value must be a valid DNS host name or be present in the local hosts file. -You may check 'Add hosts entry' to add such an entry to the hosts file for the duration of the hosting session. -Adding a hosts entry requires elevated permissions, both upon adding and again upon removal. - - - You may check 'Add hosts entry' to add such an entry to the hosts file for the duration of the hosting session. -Adding a hosts entry requires elevated permissions, both upon adding and again upon removal. - - - The host name to use in place of 'localhost'. -This value must be a valid DNS host name or be present in the local hosts file. -You may check 'Add hosts entry' to add such an entry to the hosts file for the duration of the hosting session. -Adding a hosts entry requires elevated permissions, both upon adding and again upon removal. - - - - 17, 17 - - - 696, 17 - - - 586, 17 - - - - - AAABAAEAMDAAAAAAAACoDgAAFgAAACgAAAAwAAAAYAAAAAEACAAAAAAAgAoAAAAAAAAAAAAAAAAAAAAA - AAAAAAAA////AA+V+QDGiDAAj7euAHsfFQDsxn4ATuv/AKrZ/gC7iH8AAeL+AJpRSQBJqs4Az8jEAHO+ - /gC3w4gA1axVAPnqygCNTRkAIMXvAK+BVQCVvtkAPqH8APTZpwDXsp8A0en9AK5mKQBpx78A06Z7AKqi - kgBw3/4AqNXFAE/D/gC6wa4Ax5BjAIk1KwBiruMALJXkAAa4+ABDw9gAjs3/AKloXgDGm5MAcKu6AB3n - /wDu7+4A6s5iALbS5gDOlkUAfs7oAKSVYACzb0QAo4Z1AJpLMQCeucEA4bdtAIHBxgC4xdAA48i5ANy2 - iQAhqukAVcHLAL2lfwCzemsAvoRNADLM/QCpgTsA6MqYACmY+wDw370At5dwAF2z/gCoXj0Aqq6kAAjN - +QCPqaAAu3gvAMazlAC+4v8Au5pOANDBogCjVSQAkTodAGLZ/wCV3P4Au6WgAJLJogCqxaEA1KZqAHiz - 1wCgb1IAr6+UAGXo/wDFk30AycSHAHfN+wDUqYsAqcrYAES95QCF2f4AhSwfADjK5gCOxOYAyrV+ALGa - fAC7flkAosCzAGbH/wCRucAAFLf0AJNHPQDCztsAvIZtAF682ADawnUAsohkAKJcTwDH3/IA1KBQAMa7 - ogCZsKoAoWo+APfgrQC4u78A8tWaAMmSUQDLpJwAmEUhAI09MACSzN4A0Jk6AK5vWQCw1/IAy5huANW/ - lwDpwHMAzbBlABjL9ADbvKsAhsT0AKV6bgCod10Asod2ALavqQDqx4cA2K96AKRXLwDIjjwAwZGJAODE - ngCbXDkAunpDAOW+ewDAhmAAcNT/ALJuMgCe0/8AhsS5AKOoogAluecAosrBAALY/QB/xf4AYsPNAMOo - iwC3hVUAppmGADDD7QDgvJcADcD3AL6gdgCW2PQAiLfNAGzq/wC6s7QAorW3AKtlSgCaTkAAwoM3AKqD - ZAC4d04A26xaAM+bWwDHqoIAbLa7AMuchQCsZDMA055IALzNhQC0gS8AV8XZAJ5RKQD45b8AZbn+AKVh - KAC2cCsA16+UAK9xZQC03v8AtX1zALaRdwCdTSIAoFlFAKyPcQBMvOAAsXxDANCgcgDXrYMAkTwkAMGA - LgDMkTIA0KqiAKp2TgC0eGEArqCJAMfk/gB3ws8A0eLyAK14PADp0akAqWsuAMKHVwCtZT8AxoxFAKm8 - pwDitWIAot7+AKhkVgDHxcoAzZ93AMCviwDAjXcAn8G6AJRFNgChVDgAnWZGAATL+wA/xOMA16txAIEm - GgDOnmQAtnM8AMq3mgCxwaYAizMcACSS6AB62/0A5sugALJvTgCqXiUA9N2zAJy6ygCvvK4Alb/BAKpt - RAC4uqUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAH2gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAABGoPIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEhISEhLUavxz - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAyVHCwtyl2tzN/9ikyQAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAH+SGkx9zzuoO1jwd2J3FLRIfwAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAADQvxrD0e6oQxdDQ/fbUGL9qkyb3kgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI+pphc7u - 7jtDF/r6wPpDhnHM8kBMmxqS6QAAAAAAAAAAAAAAAAAAAAAAAAAAAAB01WmXsrKTuzdDERHAehcXlTht - IUbRTMMaUX8AAAAAAAAAAAAAAAAAAAAAAAAAAOOS+cNMTNED0oK1wMAREXoX9+gm2E1Mw8PDGlHQ7wAA - AAAAAAAAAAAAAAAAAAAAsX/5GhrDw9ED0jf6F3p6ehER2yGpp3fNwxoaGvm/0O8AAAAAAAAAAAAAAAAA - AADpf1H5+ZvDTNEDtTeQF3p6ehcXRVATqehGwxr5+VFRyfQAAAAAAAAAAAAAAAAAACNSv1GS+RrDTNF2 - N+EGfBd8fHx8fIbt7L5Nm8P5UVHJyX9kAAAAAAAAAAAAAAAA7/R/v8lR+cPD0TDudgYGBgYGBoeHhzuj - 7In/pcMa+VHJf3/QZAAAAAAAAAAAAAAAZNB/v8lRGsPDspHSmJCQBgYGBoeHh5id7Eo4PsMa+VHJf1LQ - NQAAAAAAAAAAAADv0FJ/yVH5GsNMz5N2kAYGBgaHh4eHNzdX7KFlTdoa+flRf1JSymQAAAAAAAAAAABk - 9FJ/yVG6m5fOkwMwmJiYmIeHh4c3NxBeSgpK4EbcGvlRyX9S0AsFAAAAAAAAACNk9FJ/kroaQCLw0dED - dpiYmJiHhzc3tYJyEwqho+alGvlRyX9S9HRkAAAAAAAAAGRkUjWSUTObGhxM0dEDMJiYmJg3N7vS0tI3 - J6EKE+ZGl/lRyX9SUuluAAAAAAAAAO/QNX9/Ufn53UDDTNF2MLU3N7V2MjJCvQO1G6EK7ARGpbpRyX9S - 9PR0BQAAAAAAI2TpUlJ/UVH5hcPDTFh9AwOTA9KT82pniE8QVuwKoSe33GlRyX9/UoDK7wAAAAAA6dD0 - UlJ/UVGZ8ZtMfTvf0QMDAwMD5vUlKw8uvOwKoalbFBozyZJ/UsrKIwAAAAAAC+9SUlJ/UZKF+RrwO8+R - ttGTMAPRPiQWRAI8PUoKCuy4RlEzMzPef8qwgAAAAAAAse9SUn/JUTMz8c7PlRwc7rbR0dHRqllHR8Eg - QaEKCqGfPnm6mTMzSOqwbgAAAAAAbu/00H9/yXC6z92FOxzPzxzfst/wt6zBwcFrU60HLKEmS7O6tLTe - 3t5IbgAAAAAA6WT00FJ/yZkiz5eF5c7OzxwcHBwct2zBwcFrU1xcrVxBDGj+M7TeSEjq6QAAAAAAZLH0 - 0FJ/sN4iz92Z5eUcOxzOzs7Ot68ODg5rmh6trVweX9azM7TnSEjq6QAAAAAA78pSUlJS1ZLlzxzdYM+o - O87Ozs7Ot0kOog5fmh4eHh4eX6/IM5kYSEjq6QAAAAAAZGR09NB/cPhgzxwcqKioqKjOhYWF5VuioqKi - X/b2BGwxX2Zo1N6KSOrq6QAAAAAAZGSAyurKcGnEYBwcz6g7qKgchYUil2iLKKKiY2NjeEZGHTYNyN5w - SOrKIwAAAAAAZO/QPz/V1XDEYM8cHMTOHKioHCKbGkZmKCgoKGNj/XOS/nOKaUhI6up0ZAAAAAAAAO/j - xQkqg13ExGBgHBzOHDvPzt3xm3MVKCgoKFRUgcu/f3+/SEjq6uqxZAAAAAAAAG4/P8Uq57nExMTEYMTO - hYWFIiJAGnP7nJycnFRUq8uWf5KS6kjq6jUjAAAAAAAAACPHxz+UcBgYxMRgqKhghYWFIiKXl3OvnJyc - nJxUVKbrf97qf+rQNTUjAAAAAAAAAAApx8eUxT86isRgYGDEHIUzIiIiIqWenJycnJzi4p5af5I19PRk - NbEjAAAAAAAAAACACQkqxz/nijoYYGAchYWStJkimf5JCAgICAji4q+Nf+p/9PTv6W4AAAAAAAAAAAAA - KQmUlMc/XRiKOhi5XZLJ3pnektUdCAgICAgICGGzNUiw0NDpdAAAAAAAAAAAAAAAIwmUKgnHxxgYxIqK - ikh/f0i6yYNoCMbGxggIxoSzykjVg+Ox7wAAAAAAAAAAAAAAAG4qfgkJx7kYGMRgYBhd53Bpkr/IhMbG - xsbGxsY0jXBdyjUjAAAAAAAAAAAAAAAAAAB005QJCQkYGMRgYLmZ3rBd1dWkL05OTk5OxsaPjtXVdOkA - AAAAAAAAAAAAAAAAAAAAxX4qlJQqGBjEuefV6kg1f0hwOU5OTk5OTk57yIODsQAAAAAAAAAAAAAAAAAA - AAAAAMcqKpSUihgY510/4zU1SPhze9fX19fXTk5vyINuAAAAAAAAAAAAAAAAAAAAAAAAAAApKirTiooY - x8fF48o16rBdDa5v19fX19d1jm4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAbgkqKn7TCcfFxSnpsXR0xdU/ - jlXk2RkZjAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALCSp+KgnHP8UpKXR0dMp04z/njo4NLQAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAvH036UCZTHx8fjdHTj48qAAAAALQAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAALHFCZSUlAkJKbGA7wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////AAD////n//8AAP///8f//wAA///4A/// - AAD//8AB//8AAP//AAA//wAA//wAAB//AAD/8AAAB/8AAP/gAAAD/wAA/8AAAAD/AAD/gAAAAH8AAP8A - AAAAfwAA/gAAAAA/AAD8AAAAAB8AAPwAAAAAHwAA+AAAAAAPAAD4AAAAAAcAAPAAAAAABwAA8AAAAAAH - AADwAAAAAAMAAOAAAAAAAwAA4AAAAAADAADgAAAAAAMAAOAAAAAAAwAA4AAAAAADAADgAAAAAAMAAOAA - AAAAAwAA4AAAAAADAADgAAAAAAMAAOAAAAAAAwAA4AAAAAADAADwAAAAAAMAAPAAAAAABwAA8AAAAAAH - AAD4AAAAAAcAAPgAAAAADwAA/AAAAAAfAAD8AAAAAB8AAP4AAAAAPwAA/wAAAAB/AAD/gAAAAP8AAP/A - AAAB/wAA/+AAAAP/AAD/8AAAB/8AAP/8AAAH/wAA//8AAHf/AAD//+AB//8AAP///////wAA - - - - 346, 17 - - - 441, 17 - - - - AAABAAEAMDAAAAAAAACoDgAAFgAAACgAAAAwAAAAYAAAAAEACAAAAAAAgAoAAAAAAAAAAAAAAAAAAAAA - AAAAAAAA////AA+V+QDGiDAAj7euAHsfFQDsxn4ATuv/AKrZ/gC7iH8AAeL+AJpRSQBJqs4Az8jEAHO+ - /gC3w4gA1axVAPnqygCNTRkAIMXvAK+BVQCVvtkAPqH8APTZpwDXsp8A0en9AK5mKQBpx78A06Z7AKqi - kgBw3/4AqNXFAE/D/gC6wa4Ax5BjAIk1KwBiruMALJXkAAa4+ABDw9gAjs3/AKloXgDGm5MAcKu6AB3n - /wDu7+4A6s5iALbS5gDOlkUAfs7oAKSVYACzb0QAo4Z1AJpLMQCeucEA4bdtAIHBxgC4xdAA48i5ANy2 - iQAhqukAVcHLAL2lfwCzemsAvoRNADLM/QCpgTsA6MqYACmY+wDw370At5dwAF2z/gCoXj0Aqq6kAAjN - +QCPqaAAu3gvAMazlAC+4v8Au5pOANDBogCjVSQAkTodAGLZ/wCV3P4Au6WgAJLJogCqxaEA1KZqAHiz - 1wCgb1IAr6+UAGXo/wDFk30AycSHAHfN+wDUqYsAqcrYAES95QCF2f4AhSwfADjK5gCOxOYAyrV+ALGa - fAC7flkAosCzAGbH/wCRucAAFLf0AJNHPQDCztsAvIZtAF682ADawnUAsohkAKJcTwDH3/IA1KBQAMa7 - ogCZsKoAoWo+APfgrQC4u78A8tWaAMmSUQDLpJwAmEUhAI09MACSzN4A0Jk6AK5vWQCw1/IAy5huANW/ - lwDpwHMAzbBlABjL9ADbvKsAhsT0AKV6bgCod10Asod2ALavqQDqx4cA2K96AKRXLwDIjjwAwZGJAODE - ngCbXDkAunpDAOW+ewDAhmAAcNT/ALJuMgCe0/8AhsS5AKOoogAluecAosrBAALY/QB/xf4AYsPNAMOo - iwC3hVUAppmGADDD7QDgvJcADcD3AL6gdgCW2PQAiLfNAGzq/wC6s7QAorW3AKtlSgCaTkAAwoM3AKqD - ZAC4d04A26xaAM+bWwDHqoIAbLa7AMuchQCsZDMA055IALzNhQC0gS8AV8XZAJ5RKQD45b8AZbn+AKVh - KAC2cCsA16+UAK9xZQC03v8AtX1zALaRdwCdTSIAoFlFAKyPcQBMvOAAsXxDANCgcgDXrYMAkTwkAMGA - LgDMkTIA0KqiAKp2TgC0eGEArqCJAMfk/gB3ws8A0eLyAK14PADp0akAqWsuAMKHVwCtZT8AxoxFAKm8 - pwDitWIAot7+AKhkVgDHxcoAzZ93AMCviwDAjXcAn8G6AJRFNgChVDgAnWZGAATL+wA/xOMA16txAIEm - GgDOnmQAtnM8AMq3mgCxwaYAizMcACSS6AB62/0A5sugALJvTgCqXiUA9N2zAJy6ygCvvK4Alb/BAKpt - RAC4uqUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAH2gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAABGoPIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEhISEhLUavxz - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAyVHCwtyl2tzN/9ikyQAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAH+SGkx9zzuoO1jwd2J3FLRIfwAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAADQvxrD0e6oQxdDQ/fbUGL9qkyb3kgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI+pphc7u - 7jtDF/r6wPpDhnHM8kBMmxqS6QAAAAAAAAAAAAAAAAAAAAAAAAAAAAB01WmXsrKTuzdDERHAehcXlTht - IUbRTMMaUX8AAAAAAAAAAAAAAAAAAAAAAAAAAOOS+cNMTNED0oK1wMAREXoX9+gm2E1Mw8PDGlHQ7wAA - AAAAAAAAAAAAAAAAAAAAsX/5GhrDw9ED0jf6F3p6ehER2yGpp3fNwxoaGvm/0O8AAAAAAAAAAAAAAAAA - AADpf1H5+ZvDTNEDtTeQF3p6ehcXRVATqehGwxr5+VFRyfQAAAAAAAAAAAAAAAAAACNSv1GS+RrDTNF2 - N+EGfBd8fHx8fIbt7L5Nm8P5UVHJyX9kAAAAAAAAAAAAAAAA7/R/v8lR+cPD0TDudgYGBgYGBoeHhzuj - 7In/pcMa+VHJf3/QZAAAAAAAAAAAAAAAZNB/v8lRGsPDspHSmJCQBgYGBoeHh5id7Eo4PsMa+VHJf1LQ - NQAAAAAAAAAAAADv0FJ/yVH5GsNMz5N2kAYGBgaHh4eHNzdX7KFlTdoa+flRf1JSymQAAAAAAAAAAABk - 9FJ/yVG6m5fOkwMwmJiYmIeHh4c3NxBeSgpK4EbcGvlRyX9S0AsFAAAAAAAAACNk9FJ/kroaQCLw0dED - dpiYmJiHhzc3tYJyEwqho+alGvlRyX9S9HRkAAAAAAAAAGRkUjWSUTObGhxM0dEDMJiYmJg3N7vS0tI3 - J6EKE+ZGl/lRyX9SUuluAAAAAAAAAO/QNX9/Ufn53UDDTNF2MLU3N7V2MjJCvQO1G6EK7ARGpbpRyX9S - 9PR0BQAAAAAAI2TpUlJ/UVH5hcPDTFh9AwOTA9KT82pniE8QVuwKoSe33GlRyX9/UoDK7wAAAAAA6dD0 - UlJ/UVGZ8ZtMfTvf0QMDAwMD5vUlKw8uvOwKoalbFBozyZJ/UsrKIwAAAAAAC+9SUlJ/UZKF+RrwO8+R - ttGTMAPRPiQWRAI8PUoKCuy4RlEzMzPef8qwgAAAAAAAse9SUn/JUTMz8c7PlRwc7rbR0dHRqllHR8Eg - QaEKCqGfPnm6mTMzSOqwbgAAAAAAbu/00H9/yXC6z92FOxzPzxzfst/wt6zBwcFrU60HLKEmS7O6tLTe - 3t5IbgAAAAAA6WT00FJ/yZkiz5eF5c7OzxwcHBwct2zBwcFrU1xcrVxBDGj+M7TeSEjq6QAAAAAAZLH0 - 0FJ/sN4iz92Z5eUcOxzOzs7Ot68ODg5rmh6trVweX9azM7TnSEjq6QAAAAAA78pSUlJS1ZLlzxzdYM+o - O87Ozs7Ot0kOog5fmh4eHh4eX6/IM5kYSEjq6QAAAAAAZGR09NB/cPhgzxwcqKioqKjOhYWF5VuioqKi - X/b2BGwxX2Zo1N6KSOrq6QAAAAAAZGSAyurKcGnEYBwcz6g7qKgchYUil2iLKKKiY2NjeEZGHTYNyN5w - SOrKIwAAAAAAZO/QPz/V1XDEYM8cHMTOHKioHCKbGkZmKCgoKGNj/XOS/nOKaUhI6up0ZAAAAAAAAO/j - xQkqg13ExGBgHBzOHDvPzt3xm3MVKCgoKFRUgcu/f3+/SEjq6uqxZAAAAAAAAG4/P8Uq57nExMTEYMTO - hYWFIiJAGnP7nJycnFRUq8uWf5KS6kjq6jUjAAAAAAAAACPHxz+UcBgYxMRgqKhghYWFIiKXl3OvnJyc - nJxUVKbrf97qf+rQNTUjAAAAAAAAAAApx8eUxT86isRgYGDEHIUzIiIiIqWenJycnJzi4p5af5I19PRk - NbEjAAAAAAAAAACACQkqxz/nijoYYGAchYWStJkimf5JCAgICAji4q+Nf+p/9PTv6W4AAAAAAAAAAAAA - KQmUlMc/XRiKOhi5XZLJ3pnektUdCAgICAgICGGzNUiw0NDpdAAAAAAAAAAAAAAAIwmUKgnHxxgYxIqK - ikh/f0i6yYNoCMbGxggIxoSzykjVg+Ox7wAAAAAAAAAAAAAAAG4qfgkJx7kYGMRgYBhd53Bpkr/IhMbG - xsbGxsY0jXBdyjUjAAAAAAAAAAAAAAAAAAB005QJCQkYGMRgYLmZ3rBd1dWkL05OTk5OxsaPjtXVdOkA - AAAAAAAAAAAAAAAAAAAAxX4qlJQqGBjEuefV6kg1f0hwOU5OTk5OTk57yIODsQAAAAAAAAAAAAAAAAAA - AAAAAMcqKpSUihgY510/4zU1SPhze9fX19fXTk5vyINuAAAAAAAAAAAAAAAAAAAAAAAAAAApKirTiooY - x8fF48o16rBdDa5v19fX19d1jm4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAbgkqKn7TCcfFxSnpsXR0xdU/ - jlXk2RkZjAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALCSp+KgnHP8UpKXR0dMp04z/njo4NLQAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAvH036UCZTHx8fjdHTj48qAAAAALQAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAALHFCZSUlAkJKbGA7wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////AAD////n//8AAP///8f//wAA///4A/// - AAD//8AB//8AAP//AAA//wAA//wAAB//AAD/8AAAB/8AAP/gAAAD/wAA/8AAAAD/AAD/gAAAAH8AAP8A - AAAAfwAA/gAAAAA/AAD8AAAAAB8AAPwAAAAAHwAA+AAAAAAPAAD4AAAAAAcAAPAAAAAABwAA8AAAAAAH - AADwAAAAAAMAAOAAAAAAAwAA4AAAAAADAADgAAAAAAMAAOAAAAAAAwAA4AAAAAADAADgAAAAAAMAAOAA - AAAAAwAA4AAAAAADAADgAAAAAAMAAOAAAAAAAwAA4AAAAAADAADwAAAAAAMAAPAAAAAABwAA8AAAAAAH - AAD4AAAAAAcAAPgAAAAADwAA/AAAAAAfAAD8AAAAAB8AAP4AAAAAPwAA/wAAAAB/AAD/gAAAAP8AAP/A - AAAB/wAA/+AAAAP/AAD/8AAAB/8AAP/8AAAH/wAA//8AAHf/AAD//+AB//8AAP///////wAA - - - \ No newline at end of file diff --git a/CassiniDev/Views/LogView.Designer.cs b/CassiniDev/Views/LogView.Designer.cs deleted file mode 100644 index d509bab14..000000000 --- a/CassiniDev/Views/LogView.Designer.cs +++ /dev/null @@ -1,356 +0,0 @@ -namespace CassiniDev.ServerLog -{ - partial class LogView - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LogView)); - this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); - this.menuStrip1 = new System.Windows.Forms.MenuStrip(); - this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.clearToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); - this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.scrollLogToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.splitContainer1 = new System.Windows.Forms.SplitContainer(); - this.listView1 = new System.Windows.Forms.ListView(); - this.TypeHeader = new System.Windows.Forms.ColumnHeader(); - this.CreatedHeader = new System.Windows.Forms.ColumnHeader(); - this.StatusHeader = new System.Windows.Forms.ColumnHeader(); - this.UrlHeader = new System.Windows.Forms.ColumnHeader(); - this.PathTranslatedHeader = new System.Windows.Forms.ColumnHeader(); - this.IdentityHeader = new System.Windows.Forms.ColumnHeader(); - this.splitContainer2 = new System.Windows.Forms.SplitContainer(); - this.splitContainer3 = new System.Windows.Forms.SplitContainer(); - this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.headersRichTextBox = new System.Windows.Forms.RichTextBox(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.exceptionRichTextBox = new System.Windows.Forms.RichTextBox(); - this.groupBox3 = new System.Windows.Forms.GroupBox(); - this.bodyBodyView = new CassiniDev.ServerLog.BodyView(); - this.menuStrip1.SuspendLayout(); - this.splitContainer1.Panel1.SuspendLayout(); - this.splitContainer1.Panel2.SuspendLayout(); - this.splitContainer1.SuspendLayout(); - this.splitContainer2.Panel1.SuspendLayout(); - this.splitContainer2.Panel2.SuspendLayout(); - this.splitContainer2.SuspendLayout(); - this.splitContainer3.Panel1.SuspendLayout(); - this.splitContainer3.Panel2.SuspendLayout(); - this.splitContainer3.SuspendLayout(); - this.groupBox2.SuspendLayout(); - this.groupBox1.SuspendLayout(); - this.groupBox3.SuspendLayout(); - this.SuspendLayout(); - // - // menuStrip1 - // - this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.fileToolStripMenuItem, - this.optionsToolStripMenuItem}); - this.menuStrip1.Location = new System.Drawing.Point(0, 0); - this.menuStrip1.Name = "menuStrip1"; - this.menuStrip1.Size = new System.Drawing.Size(805, 24); - this.menuStrip1.TabIndex = 38; - this.menuStrip1.Text = "menuStrip1"; - // - // fileToolStripMenuItem - // - this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.clearToolStripMenuItem, - this.toolStripSeparator1, - this.exitToolStripMenuItem}); - this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; - this.fileToolStripMenuItem.Size = new System.Drawing.Size(35, 20); - this.fileToolStripMenuItem.Text = "&File"; - // - // clearToolStripMenuItem - // - this.clearToolStripMenuItem.Name = "clearToolStripMenuItem"; - this.clearToolStripMenuItem.Size = new System.Drawing.Size(99, 22); - this.clearToolStripMenuItem.Text = "&Clear"; - this.clearToolStripMenuItem.Click += new System.EventHandler(this.clearToolStripMenuItem_Click); - // - // toolStripSeparator1 - // - this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(96, 6); - // - // exitToolStripMenuItem - // - this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; - this.exitToolStripMenuItem.Size = new System.Drawing.Size(99, 22); - this.exitToolStripMenuItem.Text = "E&xit"; - this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); - // - // optionsToolStripMenuItem - // - this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.scrollLogToolStripMenuItem}); - this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; - this.optionsToolStripMenuItem.Size = new System.Drawing.Size(56, 20); - this.optionsToolStripMenuItem.Text = "&Options"; - // - // scrollLogToolStripMenuItem - // - this.scrollLogToolStripMenuItem.Checked = true; - this.scrollLogToolStripMenuItem.CheckOnClick = true; - this.scrollLogToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; - this.scrollLogToolStripMenuItem.Name = "scrollLogToolStripMenuItem"; - this.scrollLogToolStripMenuItem.Size = new System.Drawing.Size(119, 22); - this.scrollLogToolStripMenuItem.Text = "&Scroll Log"; - // - // splitContainer1 - // - this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer1.Location = new System.Drawing.Point(0, 24); - this.splitContainer1.Name = "splitContainer1"; - this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; - // - // splitContainer1.Panel1 - // - this.splitContainer1.Panel1.Controls.Add(this.listView1); - // - // splitContainer1.Panel2 - // - this.splitContainer1.Panel2.Controls.Add(this.splitContainer2); - this.splitContainer1.Size = new System.Drawing.Size(805, 436); - this.splitContainer1.SplitterDistance = 196; - this.splitContainer1.TabIndex = 39; - // - // listView1 - // - this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.TypeHeader, - this.CreatedHeader, - this.StatusHeader, - this.UrlHeader, - this.PathTranslatedHeader, - this.IdentityHeader}); - this.listView1.Dock = System.Windows.Forms.DockStyle.Fill; - this.listView1.FullRowSelect = true; - this.listView1.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; - this.listView1.HideSelection = false; - this.listView1.Location = new System.Drawing.Point(0, 0); - this.listView1.MultiSelect = false; - this.listView1.Name = "listView1"; - this.listView1.Size = new System.Drawing.Size(805, 196); - this.listView1.TabIndex = 0; - this.listView1.UseCompatibleStateImageBehavior = false; - this.listView1.View = System.Windows.Forms.View.Details; - this.listView1.SelectedIndexChanged += new System.EventHandler(this.listView1_SelectedIndexChanged); - // - // TypeHeader - // - this.TypeHeader.Text = "Type"; - this.TypeHeader.Width = 80; - // - // CreatedHeader - // - this.CreatedHeader.Text = "Created"; - this.CreatedHeader.Width = 180; - // - // StatusHeader - // - this.StatusHeader.Text = "Status"; - // - // UrlHeader - // - this.UrlHeader.Text = "Url"; - this.UrlHeader.Width = 160; - // - // PathTranslatedHeader - // - this.PathTranslatedHeader.Text = "PathTranslated"; - this.PathTranslatedHeader.Width = 200; - // - // IdentityHeader - // - this.IdentityHeader.Text = "Identity"; - this.IdentityHeader.Width = 100; - // - // splitContainer2 - // - this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer2.Location = new System.Drawing.Point(0, 0); - this.splitContainer2.Name = "splitContainer2"; - // - // splitContainer2.Panel1 - // - this.splitContainer2.Panel1.Controls.Add(this.splitContainer3); - // - // splitContainer2.Panel2 - // - this.splitContainer2.Panel2.Controls.Add(this.groupBox3); - this.splitContainer2.Size = new System.Drawing.Size(805, 236); - this.splitContainer2.SplitterDistance = 289; - this.splitContainer2.TabIndex = 0; - // - // splitContainer3 - // - this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer3.Location = new System.Drawing.Point(0, 0); - this.splitContainer3.Name = "splitContainer3"; - this.splitContainer3.Orientation = System.Windows.Forms.Orientation.Horizontal; - // - // splitContainer3.Panel1 - // - this.splitContainer3.Panel1.Controls.Add(this.groupBox2); - // - // splitContainer3.Panel2 - // - this.splitContainer3.Panel2.Controls.Add(this.groupBox1); - this.splitContainer3.Size = new System.Drawing.Size(289, 236); - this.splitContainer3.SplitterDistance = 172; - this.splitContainer3.TabIndex = 0; - // - // groupBox2 - // - this.groupBox2.Controls.Add(this.headersRichTextBox); - this.groupBox2.Dock = System.Windows.Forms.DockStyle.Fill; - this.groupBox2.Location = new System.Drawing.Point(0, 0); - this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(289, 172); - this.groupBox2.TabIndex = 0; - this.groupBox2.TabStop = false; - this.groupBox2.Text = "Headers"; - // - // headersRichTextBox - // - this.headersRichTextBox.Dock = System.Windows.Forms.DockStyle.Fill; - this.headersRichTextBox.Location = new System.Drawing.Point(3, 16); - this.headersRichTextBox.Name = "headersRichTextBox"; - this.headersRichTextBox.ReadOnly = true; - this.headersRichTextBox.Size = new System.Drawing.Size(283, 153); - this.headersRichTextBox.TabIndex = 45; - this.headersRichTextBox.Text = ""; - this.headersRichTextBox.WordWrap = false; - // - // groupBox1 - // - this.groupBox1.Controls.Add(this.exceptionRichTextBox); - this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill; - this.groupBox1.Location = new System.Drawing.Point(0, 0); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(289, 60); - this.groupBox1.TabIndex = 0; - this.groupBox1.TabStop = false; - this.groupBox1.Text = "Exception - TODO"; - // - // exceptionRichTextBox - // - this.exceptionRichTextBox.Dock = System.Windows.Forms.DockStyle.Fill; - this.exceptionRichTextBox.Location = new System.Drawing.Point(3, 16); - this.exceptionRichTextBox.Name = "exceptionRichTextBox"; - this.exceptionRichTextBox.ReadOnly = true; - this.exceptionRichTextBox.Size = new System.Drawing.Size(283, 41); - this.exceptionRichTextBox.TabIndex = 43; - this.exceptionRichTextBox.Text = "This field will contain full exception detail.\nNo more ambiguous HttpExceptions.\n" + - ""; - this.exceptionRichTextBox.WordWrap = false; - // - // groupBox3 - // - this.groupBox3.Controls.Add(this.bodyBodyView); - this.groupBox3.Dock = System.Windows.Forms.DockStyle.Fill; - this.groupBox3.Location = new System.Drawing.Point(0, 0); - this.groupBox3.Name = "groupBox3"; - this.groupBox3.Size = new System.Drawing.Size(512, 236); - this.groupBox3.TabIndex = 0; - this.groupBox3.TabStop = false; - this.groupBox3.Text = "Body"; - // - // bodyBodyView - // - this.bodyBodyView.BackColor = System.Drawing.SystemColors.GradientActiveCaption; - this.bodyBodyView.Dock = System.Windows.Forms.DockStyle.Fill; - this.bodyBodyView.Location = new System.Drawing.Point(3, 16); - this.bodyBodyView.Name = "bodyBodyView"; - this.bodyBodyView.Size = new System.Drawing.Size(506, 217); - this.bodyBodyView.TabIndex = 41; - this.bodyBodyView.Value = null; - // - // LogView - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.SystemColors.Control; - this.ClientSize = new System.Drawing.Size(805, 460); - this.Controls.Add(this.splitContainer1); - this.Controls.Add(this.menuStrip1); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Name = "LogView"; - this.Text = "LogView"; - this.menuStrip1.ResumeLayout(false); - this.menuStrip1.PerformLayout(); - this.splitContainer1.Panel1.ResumeLayout(false); - this.splitContainer1.Panel2.ResumeLayout(false); - this.splitContainer1.ResumeLayout(false); - this.splitContainer2.Panel1.ResumeLayout(false); - this.splitContainer2.Panel2.ResumeLayout(false); - this.splitContainer2.ResumeLayout(false); - this.splitContainer3.Panel1.ResumeLayout(false); - this.splitContainer3.Panel2.ResumeLayout(false); - this.splitContainer3.ResumeLayout(false); - this.groupBox2.ResumeLayout(false); - this.groupBox1.ResumeLayout(false); - this.groupBox3.ResumeLayout(false); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.ToolTip toolTip1; - private System.Windows.Forms.MenuStrip menuStrip1; - private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem clearToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; - private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem scrollLogToolStripMenuItem; - private System.Windows.Forms.SplitContainer splitContainer1; - private System.Windows.Forms.SplitContainer splitContainer2; - private System.Windows.Forms.SplitContainer splitContainer3; - private System.Windows.Forms.GroupBox groupBox2; - private System.Windows.Forms.GroupBox groupBox1; - private System.Windows.Forms.GroupBox groupBox3; - private BodyView bodyBodyView; - private System.Windows.Forms.RichTextBox exceptionRichTextBox; - private System.Windows.Forms.RichTextBox headersRichTextBox; - private System.Windows.Forms.ListView listView1; - private System.Windows.Forms.ColumnHeader TypeHeader; - private System.Windows.Forms.ColumnHeader CreatedHeader; - private System.Windows.Forms.ColumnHeader StatusHeader; - private System.Windows.Forms.ColumnHeader UrlHeader; - private System.Windows.Forms.ColumnHeader PathTranslatedHeader; - private System.Windows.Forms.ColumnHeader IdentityHeader; - } -} \ No newline at end of file diff --git a/CassiniDev/Views/LogView.cs b/CassiniDev/Views/LogView.cs deleted file mode 100644 index 650c844cf..000000000 --- a/CassiniDev/Views/LogView.cs +++ /dev/null @@ -1,137 +0,0 @@ -// ********************************************************************************** -// CassiniDev - http://cassinidev.codeplex.com -// -// Copyright (c) Sky Sanders. All rights reserved. -// -// This source code is subject to terms and conditions of the Microsoft Public -// License (Ms-PL). A copy of the license can be found in the license.htm file -// included in this distribution. -// -// You must not remove this notice, or any other, from this software. -// -// ********************************************************************************** - -#region - -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Windows.Forms; - -#endregion - -namespace CassiniDev.ServerLog -{ - /// - /// If log can persist, then only stack values in the list and tag the items with the RowId for querying the db for heavy values. - /// If not, tag the item with the loginfo instance. Memory usage will be much greater but is better than nothing. - /// - public partial class LogView : Form - { - - - - private Server _server; - - public LogView(Server server) - { - InitializeComponent(); - _server = server; - _server.RequestComplete += RequestComplete; - - - InitializeList(); - - base.Text = SR.GetString(SR.WebdevLogViewerNameWithPort, _server.Port); - } - - /// - /// Not sure if these qualify for disposable - /// - /// - protected override void OnClosing(CancelEventArgs e) - { - _server.RequestComplete -= RequestComplete; - _server = null; - - } - - private void AddLogRows(IEnumerable items) - { - listView1.SuspendLayout(); - - foreach (LogInfo item in items) - { - ListViewItem a = new ListViewItem(new[] - { - item.RowType == 0 ? "" : item.RowType == 1 ? "Request" : "Response", - item.Created.ToString(), - item.StatusCode.ToString(), - item.Url, - item.PathTranslated, - item.Identity - }) - { - Tag = item - }; - listView1.Items.Add(a); - } - - if (listView1.Items.Count > 0 && scrollLogToolStripMenuItem.Checked) - { - int lastRow = listView1.Items.Count - 1; - listView1.EnsureVisible(lastRow); - } - listView1.ResumeLayout(); - } - - private void clearToolStripMenuItem_Click(object sender, EventArgs e) - { - InitializeList(); - } - - private void exitToolStripMenuItem_Click(object sender, EventArgs e) - { - Close(); - } - - private LogInfo GetSelectedLogItem() - { - object tag = listView1.Items[listView1.SelectedIndices[0]].Tag; - - LogInfo returnValue = (LogInfo)tag; - - return returnValue; - } - - private void InitializeList() - { - listView1.SuspendLayout(); - listView1.Items.Clear(); - listView1.ResumeLayout(); - } - - private void listView1_SelectedIndexChanged(object sender, EventArgs e) - { - if (listView1.SelectedIndices.Count > 0) - { - LogInfo log = GetSelectedLogItem(); - exceptionRichTextBox.Text = log.Exception; - headersRichTextBox.Text = log.Headers; - bodyBodyView.Value = log.Body; - } - else - { - exceptionRichTextBox.Text = ""; - headersRichTextBox.Text = ""; - bodyBodyView.Value = null; - } - } - - private void RequestComplete(object sender, RequestEventArgs e) - { - Invoke(new MethodInvoker(() => AddLogRows(new[] { e.RequestLog, e.ResponseLog }))); - } - - } -} \ No newline at end of file diff --git a/CassiniDev/Views/LogView.resx b/CassiniDev/Views/LogView.resx deleted file mode 100644 index 4b40ffd6b..000000000 --- a/CassiniDev/Views/LogView.resx +++ /dev/null @@ -1,194 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 175, 17 - - - 267, 17 - - - - - AAABAAEAMDAAAAAAAACoDgAAFgAAACgAAAAwAAAAYAAAAAEACAAAAAAAgAoAAAAAAAAAAAAAAAAAAAAA - AAAAAAAA////AA+V+QDGiDAAj7euAHsfFQDsxn4ATuv/AKrZ/gC7iH8AAeL+AJpRSQBJqs4Az8jEAHO+ - /gC3w4gA1axVAPnqygCNTRkAIMXvAK+BVQCVvtkAPqH8APTZpwDXsp8A0en9AK5mKQBpx78A06Z7AKqi - kgBw3/4AqNXFAE/D/gC6wa4Ax5BjAIk1KwBiruMALJXkAAa4+ABDw9gAjs3/AKloXgDGm5MAcKu6AB3n - /wDu7+4A6s5iALbS5gDOlkUAfs7oAKSVYACzb0QAo4Z1AJpLMQCeucEA4bdtAIHBxgC4xdAA48i5ANy2 - iQAhqukAVcHLAL2lfwCzemsAvoRNADLM/QCpgTsA6MqYACmY+wDw370At5dwAF2z/gCoXj0Aqq6kAAjN - +QCPqaAAu3gvAMazlAC+4v8Au5pOANDBogCjVSQAkTodAGLZ/wCV3P4Au6WgAJLJogCqxaEA1KZqAHiz - 1wCgb1IAr6+UAGXo/wDFk30AycSHAHfN+wDUqYsAqcrYAES95QCF2f4AhSwfADjK5gCOxOYAyrV+ALGa - fAC7flkAosCzAGbH/wCRucAAFLf0AJNHPQDCztsAvIZtAF682ADawnUAsohkAKJcTwDH3/IA1KBQAMa7 - ogCZsKoAoWo+APfgrQC4u78A8tWaAMmSUQDLpJwAmEUhAI09MACSzN4A0Jk6AK5vWQCw1/IAy5huANW/ - lwDpwHMAzbBlABjL9ADbvKsAhsT0AKV6bgCod10Asod2ALavqQDqx4cA2K96AKRXLwDIjjwAwZGJAODE - ngCbXDkAunpDAOW+ewDAhmAAcNT/ALJuMgCe0/8AhsS5AKOoogAluecAosrBAALY/QB/xf4AYsPNAMOo - iwC3hVUAppmGADDD7QDgvJcADcD3AL6gdgCW2PQAiLfNAGzq/wC6s7QAorW3AKtlSgCaTkAAwoM3AKqD - ZAC4d04A26xaAM+bWwDHqoIAbLa7AMuchQCsZDMA055IALzNhQC0gS8AV8XZAJ5RKQD45b8AZbn+AKVh - KAC2cCsA16+UAK9xZQC03v8AtX1zALaRdwCdTSIAoFlFAKyPcQBMvOAAsXxDANCgcgDXrYMAkTwkAMGA - LgDMkTIA0KqiAKp2TgC0eGEArqCJAMfk/gB3ws8A0eLyAK14PADp0akAqWsuAMKHVwCtZT8AxoxFAKm8 - pwDitWIAot7+AKhkVgDHxcoAzZ93AMCviwDAjXcAn8G6AJRFNgChVDgAnWZGAATL+wA/xOMA16txAIEm - GgDOnmQAtnM8AMq3mgCxwaYAizMcACSS6AB62/0A5sugALJvTgCqXiUA9N2zAJy6ygCvvK4Alb/BAKpt - RAC4uqUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAH2gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAABGoPIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEhISEhLUavxz - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAyVHCwtyl2tzN/9ikyQAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAH+SGkx9zzuoO1jwd2J3FLRIfwAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAADQvxrD0e6oQxdDQ/fbUGL9qkyb3kgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI+pphc7u - 7jtDF/r6wPpDhnHM8kBMmxqS6QAAAAAAAAAAAAAAAAAAAAAAAAAAAAB01WmXsrKTuzdDERHAehcXlTht - IUbRTMMaUX8AAAAAAAAAAAAAAAAAAAAAAAAAAOOS+cNMTNED0oK1wMAREXoX9+gm2E1Mw8PDGlHQ7wAA - AAAAAAAAAAAAAAAAAAAAsX/5GhrDw9ED0jf6F3p6ehER2yGpp3fNwxoaGvm/0O8AAAAAAAAAAAAAAAAA - AADpf1H5+ZvDTNEDtTeQF3p6ehcXRVATqehGwxr5+VFRyfQAAAAAAAAAAAAAAAAAACNSv1GS+RrDTNF2 - N+EGfBd8fHx8fIbt7L5Nm8P5UVHJyX9kAAAAAAAAAAAAAAAA7/R/v8lR+cPD0TDudgYGBgYGBoeHhzuj - 7In/pcMa+VHJf3/QZAAAAAAAAAAAAAAAZNB/v8lRGsPDspHSmJCQBgYGBoeHh5id7Eo4PsMa+VHJf1LQ - NQAAAAAAAAAAAADv0FJ/yVH5GsNMz5N2kAYGBgaHh4eHNzdX7KFlTdoa+flRf1JSymQAAAAAAAAAAABk - 9FJ/yVG6m5fOkwMwmJiYmIeHh4c3NxBeSgpK4EbcGvlRyX9S0AsFAAAAAAAAACNk9FJ/kroaQCLw0dED - dpiYmJiHhzc3tYJyEwqho+alGvlRyX9S9HRkAAAAAAAAAGRkUjWSUTObGhxM0dEDMJiYmJg3N7vS0tI3 - J6EKE+ZGl/lRyX9SUuluAAAAAAAAAO/QNX9/Ufn53UDDTNF2MLU3N7V2MjJCvQO1G6EK7ARGpbpRyX9S - 9PR0BQAAAAAAI2TpUlJ/UVH5hcPDTFh9AwOTA9KT82pniE8QVuwKoSe33GlRyX9/UoDK7wAAAAAA6dD0 - UlJ/UVGZ8ZtMfTvf0QMDAwMD5vUlKw8uvOwKoalbFBozyZJ/UsrKIwAAAAAAC+9SUlJ/UZKF+RrwO8+R - ttGTMAPRPiQWRAI8PUoKCuy4RlEzMzPef8qwgAAAAAAAse9SUn/JUTMz8c7PlRwc7rbR0dHRqllHR8Eg - QaEKCqGfPnm6mTMzSOqwbgAAAAAAbu/00H9/yXC6z92FOxzPzxzfst/wt6zBwcFrU60HLKEmS7O6tLTe - 3t5IbgAAAAAA6WT00FJ/yZkiz5eF5c7OzxwcHBwct2zBwcFrU1xcrVxBDGj+M7TeSEjq6QAAAAAAZLH0 - 0FJ/sN4iz92Z5eUcOxzOzs7Ot68ODg5rmh6trVweX9azM7TnSEjq6QAAAAAA78pSUlJS1ZLlzxzdYM+o - O87Ozs7Ot0kOog5fmh4eHh4eX6/IM5kYSEjq6QAAAAAAZGR09NB/cPhgzxwcqKioqKjOhYWF5VuioqKi - X/b2BGwxX2Zo1N6KSOrq6QAAAAAAZGSAyurKcGnEYBwcz6g7qKgchYUil2iLKKKiY2NjeEZGHTYNyN5w - SOrKIwAAAAAAZO/QPz/V1XDEYM8cHMTOHKioHCKbGkZmKCgoKGNj/XOS/nOKaUhI6up0ZAAAAAAAAO/j - xQkqg13ExGBgHBzOHDvPzt3xm3MVKCgoKFRUgcu/f3+/SEjq6uqxZAAAAAAAAG4/P8Uq57nExMTEYMTO - hYWFIiJAGnP7nJycnFRUq8uWf5KS6kjq6jUjAAAAAAAAACPHxz+UcBgYxMRgqKhghYWFIiKXl3OvnJyc - nJxUVKbrf97qf+rQNTUjAAAAAAAAAAApx8eUxT86isRgYGDEHIUzIiIiIqWenJycnJzi4p5af5I19PRk - NbEjAAAAAAAAAACACQkqxz/nijoYYGAchYWStJkimf5JCAgICAji4q+Nf+p/9PTv6W4AAAAAAAAAAAAA - KQmUlMc/XRiKOhi5XZLJ3pnektUdCAgICAgICGGzNUiw0NDpdAAAAAAAAAAAAAAAIwmUKgnHxxgYxIqK - ikh/f0i6yYNoCMbGxggIxoSzykjVg+Ox7wAAAAAAAAAAAAAAAG4qfgkJx7kYGMRgYBhd53Bpkr/IhMbG - xsbGxsY0jXBdyjUjAAAAAAAAAAAAAAAAAAB005QJCQkYGMRgYLmZ3rBd1dWkL05OTk5OxsaPjtXVdOkA - AAAAAAAAAAAAAAAAAAAAxX4qlJQqGBjEuefV6kg1f0hwOU5OTk5OTk57yIODsQAAAAAAAAAAAAAAAAAA - AAAAAMcqKpSUihgY510/4zU1SPhze9fX19fXTk5vyINuAAAAAAAAAAAAAAAAAAAAAAAAAAApKirTiooY - x8fF48o16rBdDa5v19fX19d1jm4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAbgkqKn7TCcfFxSnpsXR0xdU/ - jlXk2RkZjAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALCSp+KgnHP8UpKXR0dMp04z/njo4NLQAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAvH036UCZTHx8fjdHTj48qAAAAALQAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAALHFCZSUlAkJKbGA7wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////AAD////n//8AAP///8f//wAA///4A/// - AAD//8AB//8AAP//AAA//wAA//wAAB//AAD/8AAAB/8AAP/gAAAD/wAA/8AAAAD/AAD/gAAAAH8AAP8A - AAAAfwAA/gAAAAA/AAD8AAAAAB8AAPwAAAAAHwAA+AAAAAAPAAD4AAAAAAcAAPAAAAAABwAA8AAAAAAH - AADwAAAAAAMAAOAAAAAAAwAA4AAAAAADAADgAAAAAAMAAOAAAAAAAwAA4AAAAAADAADgAAAAAAMAAOAA - AAAAAwAA4AAAAAADAADgAAAAAAMAAOAAAAAAAwAA4AAAAAADAADwAAAAAAMAAPAAAAAABwAA8AAAAAAH - AAD4AAAAAAcAAPgAAAAADwAA/AAAAAAfAAD8AAAAAB8AAP4AAAAAPwAA/wAAAAB/AAD/gAAAAP8AAP/A - AAAB/wAA/+AAAAP/AAD/8AAAB/8AAP/8AAAH/wAA//8AAHf/AAD//+AB//8AAP///////wAA - - - \ No newline at end of file diff --git a/CassiniDev/WebDev.WebServer40.exe.config b/CassiniDev/WebDev.WebServer40.exe.config deleted file mode 100644 index 600cf2303..000000000 --- a/CassiniDev/WebDev.WebServer40.exe.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/CassiniDev/app.config b/CassiniDev/app.config deleted file mode 100644 index f34808b6b..000000000 --- a/CassiniDev/app.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/IISExpress/AppServer/administration.config b/IISExpress/AppServer/administration.config new file mode 100644 index 000000000..4d2fdbaf2 --- /dev/null +++ b/IISExpress/AppServer/administration.config @@ -0,0 +1,178 @@ + + + +
+
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/IISExpress/AppServer/applicationhost.config b/IISExpress/AppServer/applicationhost.config new file mode 100644 index 000000000..7dee0612b --- /dev/null +++ b/IISExpress/AppServer/applicationhost.config @@ -0,0 +1,953 @@ + + + + + + + + +
+
+
+
+
+
+
+
+ + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+ +
+
+ +
+
+ +
+
+
+ + +
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/IISExpress/IisExpressAdminCmd.exe b/IISExpress/IisExpressAdminCmd.exe new file mode 100644 index 000000000..4e14aa1da Binary files /dev/null and b/IISExpress/IisExpressAdminCmd.exe differ diff --git a/CassiniDev/CassiniDev4-console.exe.config b/IISExpress/IisExpressAdminCmd.exe.config similarity index 59% rename from CassiniDev/CassiniDev4-console.exe.config rename to IISExpress/IisExpressAdminCmd.exe.config index 22ab261b3..904dc3376 100644 --- a/CassiniDev/CassiniDev4-console.exe.config +++ b/IISExpress/IisExpressAdminCmd.exe.config @@ -1,9 +1,7 @@ - + - - - + \ No newline at end of file diff --git a/IISExpress/WCFWebMatrixInstall.js b/IISExpress/WCFWebMatrixInstall.js new file mode 100644 index 000000000..5a2a49738 --- /dev/null +++ b/IISExpress/WCFWebMatrixInstall.js @@ -0,0 +1,181 @@ +// Configures Windows Communication Foundation 3.5 for WebMatrix +// +// Usage: +// WCFWebMatrixInstall.js [un]install + +var moduleName = "ServiceModel"; +var handlerNames = ["svc-Integrated","rules-Integrated","xoml-Integrated","svc-ISAPI-2.0","rules-ISAPI-2.0","xoml-ISAPI-2.0"]; + +try { + var mode = ParseArguments(); + if (mode == "install") + { + UninstallWCF(); + InstallWCF(); + WScript.Echo("WCF 3.5 has been configured for WebMatrix."); + } + else if (mode == "uninstall") + { + UninstallWCF(); + WScript.Echo("WCF 3.5 has been uninstalled from WebMatrix."); + } + else + { + PrintUsage(); + } +} +catch(e) { + WScript.Echo("An error occurred:\r\n " + e.description); +} + +function InstallWCF() { + var adminManager = GetAdminManager(); + + AddModule(adminManager); + AddHandlers(adminManager); + + adminManager.CommitChanges(); +} + +function UninstallWCF() { + var adminManager = GetAdminManager(); + var moduleSection = adminManager.GetAdminSection("system.webServer/modules", "MACHINE/WEBROOT/APPHOST"); + + var modulePosition = FindElement(moduleSection.Collection, "add", ["name", moduleName]); + if (modulePosition != -1) + { + moduleSection.Collection.DeleteElement(modulePosition); + } + + var handlerSection = adminManager.GetAdminSection("system.webServer/handlers", "MACHINE/WEBROOT/APPHOST"); + for (i = 0 ; i < handlerNames.length; i++) + { + var svcPosition = FindElement(handlerSection.Collection, "add", ["name", handlerNames[i]]); + if (svcPosition != -1) + { + handlerSection.Collection.DeleteElement(svcPosition); + } + } + + adminManager.CommitChanges(); +} + +function AddModule(adminManager) +{ + var moduleSection = adminManager.GetAdminSection("system.webServer/modules", "MACHINE/WEBROOT/APPHOST"); + + var element = moduleSection.Collection.CreateNewElement("add"); + element.Properties.Item("name").Value = moduleName; + element.Properties.Item("type").Value = "System.ServiceModel.Activation.HttpModule, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"; + element.Properties.Item("preCondition").Value = "managedHandler,runtimeVersionv2.0"; + moduleSection.Collection.AddElement(element, -1); +} + +function AddHandlers(adminManager) +{ + var handlerSection = adminManager.GetAdminSection("system.webServer/handlers", "MACHINE/WEBROOT/APPHOST"); + + AddIntegratedHandler(handlerSection, handlerNames[0], "*.svc"); + AddIntegratedHandler(handlerSection, handlerNames[1], "*.rules"); + AddIntegratedHandler(handlerSection, handlerNames[2], "*.xoml"); + + AddISAPIHandler(handlerSection, handlerNames[3], "*.svc"); + AddISAPIHandler(handlerSection, handlerNames[4], "*.rules"); + AddISAPIHandler(handlerSection, handlerNames[5], "*.xoml"); +} + +function AddIntegratedHandler(section, name, path) +{ + var element = section.Collection.CreateNewElement("add"); + element.Properties.Item("name").Value = name; + element.Properties.Item("path").Value = path; + element.Properties.Item("verb").Value = "*"; + element.Properties.Item("type").Value = "System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"; + element.Properties.Item("preCondition").Value = "integratedMode,runtimeVersionv2.0"; + section.Collection.AddElement(element, 0); +} + +function AddISAPIHandler(section, name, path) +{ + var element = section.Collection.CreateNewElement("add"); + element.Properties.Item("name").Value = name; + element.Properties.Item("path").Value = path; + element.Properties.Item("verb").Value = "*"; + element.Properties.Item("modules").Value = "IsapiModule"; + element.Properties.Item("scriptProcessor").Value = "%SystemRoot%\\Microsoft.NET\\Framework\\v2.0.50727\\aspnet_isapi.dll"; + element.Properties.Item("preCondition").Value = "classicMode,runtimeVersionv2.0,bitness32"; + section.Collection.AddElement(element, 0); +} + +function GetAdminManager() +{ + try + { + var vermg = new ActiveXObject("Microsoft.IIS.VersionManager"); + var exp = vermg.GetVersionObject("8.0", 1); + return adminManager = exp.CreateObjectFromProgId("Microsoft.ApplicationHost.WritableAdminManager"); + } + catch(e) + { + throw new Error("Unable to create WritableAdminManager.\r\n Please ensure that WebMatrix is installed properly.\r\n\r\n " + e.description); + } +} + +function FindElement(collection, elementTagName, valuesToMatch) +{ + for (var i = 0; i < collection.Count; i++) + { + var element = collection.Item(i); + + if (element.Name == elementTagName) + { + var matches = true; + for (var iVal = 0; iVal < valuesToMatch.length; iVal += 2) + { + var property = element.GetPropertyByName(valuesToMatch[iVal]); + var value = property.Value; + if (value != null) + { + value = value.toString(); + } + if (value != valuesToMatch[iVal + 1]) + { + matches = false; + break; + } + } + if (matches) + { + return i; + } + } + } + + return -1; +} + +function ParseArguments() +{ + var mode = ""; + + if (WScript.Arguments.Count() > 0) + { + if (WScript.Arguments.Item(0).toLowerCase() == "install") + { + mode="install"; + } + else if (WScript.Arguments.Item(0).toLowerCase() == "uninstall") + { + mode="uninstall"; + } + } + + return mode; +} + +function PrintUsage() +{ + WScript.Echo("Usage:\r\n WCFWebMatrixInstall.js \r\n\r\nDescription:\r\nAdministration utility that enables configuation of WCF 3.5 for WebMatrix\r\n\r\nSupported Commands:\r\n install, uninstall\r\n\r\nSamples:\r\n WCFWebMatrixInstall.js install\r\n WCFWebMatrixInstall.js uninstall"); +} + + diff --git a/IISExpress/appcmd.exe b/IISExpress/appcmd.exe new file mode 100644 index 000000000..36edd87ea Binary files /dev/null and b/IISExpress/appcmd.exe differ diff --git a/IISExpress/appcmd.xml b/IISExpress/appcmd.xml new file mode 100644 index 000000000..37c888150 --- /dev/null +++ b/IISExpress/appcmd.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/IISExpress/appobj.dll b/IISExpress/appobj.dll new file mode 100644 index 000000000..3a83de4d6 Binary files /dev/null and b/IISExpress/appobj.dll differ diff --git a/IISExpress/authanon.dll b/IISExpress/authanon.dll new file mode 100644 index 000000000..f41db8284 Binary files /dev/null and b/IISExpress/authanon.dll differ diff --git a/IISExpress/authbas.dll b/IISExpress/authbas.dll new file mode 100644 index 000000000..4df969b62 Binary files /dev/null and b/IISExpress/authbas.dll differ diff --git a/IISExpress/authcert.dll b/IISExpress/authcert.dll new file mode 100644 index 000000000..5ae84df4a Binary files /dev/null and b/IISExpress/authcert.dll differ diff --git a/IISExpress/authmap.dll b/IISExpress/authmap.dll new file mode 100644 index 000000000..94d259ad4 Binary files /dev/null and b/IISExpress/authmap.dll differ diff --git a/IISExpress/authsspi.dll b/IISExpress/authsspi.dll new file mode 100644 index 000000000..b0bf4301b Binary files /dev/null and b/IISExpress/authsspi.dll differ diff --git a/IISExpress/browscap.dll b/IISExpress/browscap.dll new file mode 100644 index 000000000..832812e4c Binary files /dev/null and b/IISExpress/browscap.dll differ diff --git a/IISExpress/browscap.ini b/IISExpress/browscap.ini new file mode 100644 index 000000000..c84843200 --- /dev/null +++ b/IISExpress/browscap.ini @@ -0,0 +1,1907 @@ + +;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; Microsoft Browsers ;;; +;;;;;;;;;;;;;;;;;;;;;;;;;; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IE 1.x +[IE 1.5] +browser=IE +version=1.5 +majorver=1 +minorver=5 +frames=FALSE +tables=TRUE +cookies=TRUE +backgroundsounds=FALSE +vbscript=FALSE +javascript=FALSE +javaapplets=FALSE +beta=False +Win16=False + +[Mozilla/1.22 (compatible; MSIE 1.5; Windows NT)] +parent=IE 1.5 +platform=WinNT + +[Mozilla/1.22 (compatible; MSIE 1.5; Windows 95)] +parent=IE 1.5 +platform=Win95 + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IE 2.x +[IE 2.0] +browser=IE +version=2.0 +majorver=2 +minorver=0 +frames=FALSE +tables=TRUE +cookies=TRUE +backgroundsounds=TRUE +vbscript=FALSE +javascript=FALSE +javaapplets=FALSE +beta=False +Win16=False + +[Mozilla/1.22 (compatible; MSIE 2.0; Mac_68000)] +parent=IE 2.0 +platform=Mac68K + +[Mozilla/1.22 (compatible; MSIE 2.0; Mac_PowerPC)] +parent=IE 2.0 +platform=MacPPC + +[Mozilla/1.22 (compatible; MSIE 2.0B; Mac_68000)] +parent=IE 2.0 +platform=Mac68K +version=2.0B + +[Mozilla/1.22 (compatible; MSIE 2.0B; Mac_PowerPC)] +parent=IE 2.0 +platform=MacPPC +version=2.0B + +[Mozilla/2.0 (compatible; MSIE 2.0; Mac_68000)] +parent=IE 2.0 +platform=Mac68K + +[Mozilla/2.0 (compatible; MSIE 2.0; Mac_PowerPC)] +parent=IE 2.0 +platform=MacPPC + +[Mozilla/2.0 (compatible; MSIE 2.0B; Mac_68000)] +parent=IE 2.0 +platform=Mac68K +version=2.0B + +[Mozilla/2.0 (compatible; MSIE 2.0B; Mac_PowerPC)] +parent=IE 2.0 +platform=MacPPC +version=2.0B + +[Mozilla/2.0 (compatible; MSIE 2.1; Windows 3.1)] +parent=IE 2.0 +platform=Win16 +Win16=True +version=2.1 +minorver=#1 +frames=True + +[Mozilla/2.0 (compatible; MSIE 2.1; Mac_68000)] +parent=IE 2.0 +platform=Mac68K +version=2.1 +minorver=#1 +Frames=True + +[Mozilla/2.0 (compatible; MSIE 2.1; Mac_PowerPC)] +parent=IE 2.0 +platform=MacPPC +version=2.1 +minorver=#1 +frames=True + +[Mozilla/2.0 (compatible; MSIE 2.5; Windows 3.1)] +parent=IE 2.0 +platform=Win16 +Win16=True +version=2.5 +minorver=#5 + +[Mozilla/2.0 (compatible; MSIE 2.5b; Windows 3.1)] +parent=IE 2.0 +platform=Win16 +Win16=True +version=2.5b +minorver=#5 +beta=True + +[Mozilla/1.22 (compatible; MSIE 2.0; Windows 95)] +parent=IE 2.0 +platform=Win95 + +[Mozilla/1.22 (compatible; MSIE 2.0c; Windows 95)] +parent=IE 2.0 +platform=Win95 +version=2.0c + + +[Mozilla/1.22 (compatible; MSIE 2.01; Windows NT)] +parent=IE 2.0 +platform=WinNT +version=2.01 +minorver=#01 + +[Mozilla/1.22 (compatible; MSIE 2.0d; Windows NT)] +parent=IE 2.0 +platform=WinNT +version=2.0d + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IE 3.x +[IE 3.0] +browser=IE +Version=3.0 +majorver=3 +minorver=0 +frames=TRUE +tables=TRUE +cookies=TRUE +backgroundsounds=TRUE +vbscript=TRUE +javascript=TRUE +javaapplets=TRUE +ActiveXControls=TRUE +Win16=False +beta=False +AK=False +SK=False +AOL=False +Crawler=False + +[Mozilla/2.0 (compatible; MSIE 3.01; Windows 3.1)] +parent=IE 3.0 +platform=Win16 +Win16=true +ActiveXControls=false + +[Mozilla/2.0 (compatible; MSIE 3.0a; Windows 3.1)] +parent=IE 3.0 +platform=Win16 +Win16=true +javaapplets=false +ActiveXControls=false + +[Mozilla/2.0 (compatible; MSIE 3.0; AK; Windows 95)] +parent=IE 3.0 +platform=Win95 +AK=True + +[Mozilla/2.0 (compatible; MSIE 3.0; AK; Windows NT)] +parent=IE 3.0 +platform=WinNT +AK=True + +[Mozilla/2.0 (compatible; MSIE 3.0; AOL 3.0; Windows 95)] +parent=IE 3.0 +platform=Win95 +AOL=True + +[Mozilla/2.0 (compatible; MSIE 3.0; SK; Windows 95)] +parent=IE 3.0 +platform=Win95 +SK=True + +[Mozilla/2.0 (compatible; MSIE 3.0; SK; Windows NT)] +parent=IE 3.0 +platform=WinNT +SK=True + +[Mozilla/2.0 (compatible; MSIE 3.0; Win 32)] +parent=IE 3.0 +platform=Win32 + +[Mozilla/2.0 (compatible; MSIE 3.0; Windows 95)] +parent=IE 3.0 +platform=Win95 + +[Mozilla/2.0 (compatible; MSIE 3.0; Windows 95) Modified] +parent=IE 3.0 +platform=Win95 + +[Mozilla/2.0 (compatible; MSIE 3.0; Windows 95;*)] +parent=IE 3.0 +platform=Win95 + +[Mozilla/2.0 (compatible; MSIE 3.0; Windows NT)] +parent=IE 3.0 +platform=WinNT + +[Mozilla/2.0 (compatible; MSIE 3.0; Windows NT;*)] +parent=IE 3.0 +platform=WinNT + +[Mozilla/2.0 (compatible; MSIE 3.0A; Windows 95)] +parent=IE 3.0 +platform=Win95 + +[Mozilla/2.0 (compatible; MSIE 3.0B3; Windows 95)] +parent=IE 3.0 +platform=Win95 +beta=True + +[Mozilla/2.0 (compatible; MSIE 3.0B3; Windows NT)] +parent=IE 3.0 +platform=WinNT +beta=True + +[Mozilla/2.0 (compatible; MSIE 3.0B; Win32)] +parent=IE 3.0 +platform=Win32 +beta=True + +[Mozilla/2.0 (compatible; MSIE 3.0B; Windows 95)] +parent=IE 3.0 +platform=Win95 +beta=True + +[Mozilla/2.0 (compatible; MSIE 3.0B; Windows 95;*)] +parent=IE 3.0 +platform=Win95 +beta=True + +[Mozilla/2.0 (compatible; MSIE 3.0B; Windows NT)] +parent=IE 3.0 +platform=WinNT +beta=True + +[Mozilla/2.0 (compatible; MSIE 3.0B; Windows NT;*)] +parent=IE 3.0 +platform=WinNT +beta=True + +[Mozilla/2.0 (compatible; MSIE 3.1; Windows NT)] +parent=IE 3.0 +platform=WinNT + +[Mozilla/2.0 (compatible; MSIE 3.01*; Windows 95)] +parent=IE 3.0 +version=3.01 +minorver=01 +platform=Win95 + +[Mozilla/2.0 (compatible; MSIE 3.01*; Windows NT)] +parent=IE 3.0 +version=3.01 +minorver=01 +platform=WinNT + +[Mozilla/2.0 (compatible; MSIE 3.01*; Mac_PowerPC)] +parent=IE 3.0 +version=3.01 +minorver=01 +vbscript=false +platform=MacPPC + +[Mozilla/2.0 (compatible; MSIE 3.01*; Mac_68000)] +parent=IE 3.0 +version=3.01 +minorver=01 +vbscript=false +platform=Mac68K + +;;ie 3.02 +[Mozilla/2.0 (compatible; MSIE 3.02; Windows 95)] +parent=IE 3.0 +version=3.02 +minorver=02 +platform=Win95 + +;;ie 3.02 +[Mozilla/2.0 (compatible; MSIE 3.02; Win32)] +parent=IE 3.0 +version=3.02 +minorver=02 +platform=Win32 + +[Mozilla/2.0 (compatible; MSIE 3.02; Windows NT)] +parent=IE 3.0 +version=3.02 +minorver=02 +platform=WinNT + +[Mozilla/2.0 (compatible; MSIE 3.02; AK; Windows 95)] +parent=IE 3.0 +version=3.02 +minorver=02 +AK=True +platform=Win95 + +[Mozilla/2.0 (compatible; MSIE 3.02; AK; Windows NT)] +parent=IE 3.0 +version=3.02 +minorver=02 +AK=True +platform=WinNT + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IE 3.x Authenticode update +[Mozilla/2.0 (compatible; MSIE 3.02; Update a; Win32)] +parent=IE 3.0 +version=3.02 +minorver=02 +platform=Win32 +AuthenticodeUpdate=a + +[Mozilla/2.0 (compatible; MSIE 3.02; Update a; Windows 95)] +minorver=02 +version=3.02 +parent=IE 3.0 +platform=Win95 +AuthenticodeUpdate=a + +[Mozilla/2.0 (compatible; MSIE 3.02; Update a; Windows NT)] +minorver=02 +version=3.02 +parent=IE 3.0 +platform=WinNT +AuthenticodeUpdate=a + +[Mozilla/2.0 (compatible; MSIE 3.02; Update a; AK; Win32)] +parent=IE 3.0 +version=3.02 +minorver=02 +platform=Win32 +AK=true +AuthenticodeUpdate=a + +[Mozilla/2.0 (compatible; MSIE 3.02; Update a; AK; Windows 95)] +minorver=02 +version=3.02 +parent=IE 3.0 +platform=Win95 +AK=true +AuthenticodeUpdate=a + +[Mozilla/2.0 (compatible; MSIE 3.02; Update a; AK; Windows NT)] +parent=IE 3.0 +version=3.02 +minorver=02 +platform=WinNT +AK=true +AuthenticodeUpdate=a + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IE 3.x WILDCARD (IF ALL ABOVE FAIL) +[Mozilla/2.0 (compatible; MSIE 3*)] +parent=IE 3.0 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IE 4.x +[IE 4.0] +browser=IE +Version=4.0 +majorver=4 +minorver=0 +frames=TRUE +tables=TRUE +cookies=TRUE +backgroundsounds=TRUE +vbscript=TRUE +javascript=TRUE +javaapplets=TRUE +ActiveXControls=TRUE +Win16=False +beta=False +AK=False +SK=False +AOL=False +crawler=False +cdf=True + +;;ie 4 beta 1 +[Mozilla/4.0 (compatible; MSIE 4.0b1; Windows 95)] +parent=IE 4.0 +platform=Win95 +beta=True +cdf=False + +[Mozilla/4.0 (compatible; MSIE 4.0b1; Windows NT)] +parent=IE 4.0 +platform=WinNT +beta=True +cdf=False + +[Mozilla/4.0 (compatible; MSIE 4.0b1 Crawler; Windows 95)] +parent=IE 4.0 +platform=Win95 +beta=True +crawler=True +cdf=False + +[Mozilla/4.0 (compatible; MSIE 4.0b1 Crawler; Windows NT)] +parent=IE 4.0 +platform=WinNT +beta=True +crawler=True +cdf=False + +;;ie 4 beta 2. This is not a commitment to a beta 2, but is being provided as a placeholder if needed. +[Mozilla/4.0 (compatible; MSIE 4.0b2; Windows 95)] +parent=IE 4.0 +platform=Win95 +beta=True + +[Mozilla/4.0 (compatible; MSIE 4.0b2; Windows NT)] +parent=IE 4.0 +platform=WinNT +beta=True + +[Mozilla/4.0 (compatible; MSIE 4.0b2 Crawler; Windows 95)] +parent=IE 4.0 +platform=Win95 +beta=True +crawler=True + +[Mozilla/4.0 (compatible; MSIE 4.0b2 Crawler; Windows NT)] +parent=IE 4.0 +platform=WinNT +beta=True +crawler=True + +;;ie 4 final release +[Mozilla/4.0 (compatible; MSIE 4.0; Windows 95)] +parent=IE 4.0 +platform=Win95 +beta=False + +[Mozilla/4.0 (compatible; MSIE 4.0; Windows NT)] +parent=IE 4.0 +platform=WinNT +beta=False + +[Mozilla/4.0 (compatible; MSIE 4.0 Crawler; Windows 95)] +parent=IE 4.0 +platform=Win95 +beta=False +crawler=True + +[Mozilla/4.0 (compatible; MSIE 4.0 Crawler; Windows NT)] +parent=IE 4.0 +platform=WinNT +beta=False +crawler=True + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IE 4.x WILDCARD (IF ALL ABOVE FAIL) +[Mozilla/4.0 (compatible; MSIE 4.*)] +parent=IE 4.0 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IE 5.0 +[IE 5.0] +browser=IE +Version=5.0 +majorver=5 +minorver=0 +frames=True +tables=True +cookies=True +backgroundsounds=True +vbscript=True +javaapplets=True +javascript=True +ActiveXControls=True +Win16=False +beta=True +AK=False +SK=False +AOL=False +Update=False + +[Mozilla/4.0 (compatible; MSIE 5.*; Windows 95*)] +parent=IE 5.0 +platform=Win95 +beta=True + +[Mozilla/4.0 (compatible; MSIE 5.*; Windows 98*)] +parent=IE 5.0 +platform=Win98 +beta=True + +[Mozilla/4.0 (compatible; MSIE 5.*; Windows NT*)] +parent=IE 5.0 +platform=WinNT +beta=True + +[Mozilla/4.0 (compatible; MSIE 5.*; Windows 2000*)] +parent=IE 5.0 +platform=Win2000 +beta=True + +[Mozilla/4.0 (compatible; MSIE 5.*)] +parent=IE 5.0 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IE 5.5 +[IE 5.5] +browser=IE +Version=5.5 +majorver=5 +minorver=5 +frames=True +tables=True +cookies=True +backgroundsounds=True +vbscript=True +javaapplets=True +javascript=True +ActiveXControls=True +Win16=False +beta=False +AK=False +SK=False +AOL=False +Update=False + +[Mozilla/4.0 (compatible; MSIE 5.*; Windows 95*)] +parent=IE 5.5 +platform=Win95 + +[Mozilla/4.0 (compatible; MSIE 5.*; Windows 98*)] +parent=IE 5.5 +platform=Win98 + +[Mozilla/4.0 (compatible; MSIE 5.*; Windows NT*)] +parent=IE 5.5 +platform=WinNT + +[Mozilla/4.0 (compatible; MSIE 5.*; Windows 2000*)] +parent=IE 5.5 +platform=Win2000 + +[Mozilla/4.0 (compatible; MSIE 5.*)] +parent=IE 5.5 + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IE 6.0 +[IE 6.0] +browser=IE +Version=6.0 +majorver=#6 +minorver=#0 +frames=True +tables=True +cookies=True +backgroundsounds=True +vbscript=True +javaapplets=True +javascript=True +ActiveXControls=True +Win16=False +beta=False +AK=False +SK=False +AOL=False +Update=False + +[Mozilla/4.0 (compatible; MSIE 6.*; Windows 95*)] +parent=IE 6.0 +platform=Win95 + +[Mozilla/4.0 (compatible; MSIE 6.*; Windows 98*)] +parent=IE 6.0 +platform=Win98 + +[Mozilla/4.0 (compatible; MSIE 6.*; Windows NT*)] +parent=IE 6.0 +platform=WinNT + +[Mozilla/4.0 (compatible; MSIE 6.*)] +parent=IE 6.0 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IE 7.0 +[IE 7.0] +browser=IE +Version=7.0 +majorver=#7 +minorver=#0 +frames=True +tables=True +cookies=True +backgroundsounds=True +vbscript=True +javaapplets=True +javascript=True +ActiveXControls=True +Win16=False +AK=False +SK=False +AOL=False +Update=False + +[Mozilla/4.0 (compatible; MSIE 7.*; Windows 98*)] +parent=IE 7.0 +platform=Win98 + +[Mozilla/4.0 (compatible; MSIE 7.*; Windows NT*)] +parent=IE 7.0 +platform=WinNT + +[Mozilla/4.0 (compatible; MSIE 7.*)] +parent=IE 7.0 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IE 8.0 +[IE 8.0] +browser=IE +Version=8.0 +majorver=#8 +minorver=#0 +frames=True +tables=True +cookies=True +backgroundsounds=True +vbscript=True +javaapplets=True +javascript=True +ActiveXControls=True +Win16=False +AK=False +SK=False +AOL=False +Update=False + +[Mozilla/4.0 (compatible; MSIE 8.*; Windows 98*)] +parent=IE 8.0 +platform=Win98 + +[Mozilla/4.0 (compatible; MSIE 8.*; Windows NT*)] +parent=IE 8.0 +platform=WinNT + +[Mozilla/4.0 (compatible; MSIE 8.*)] +parent=IE 8.0 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Pocket IE +[Microsoft Pocket Internet Explorer/0.6] +browser=PIE +Version=1.0 +majorver=1 +minorver=0 +frames=FALSE +tables=TRUE +cookies=FALSE +backgroundsounds=TRUE +vbscript=FALSE +javascript=FALSE +javaapplets=FALSE +ActiveXControls=FALSE +Win16=False +beta=False +AK=False +SK=False +AOL=False +platform=WinCE + +[Mozilla/1.1 (compatible; MSPIE 1.1; Windows CE)] +browser=PIE +Version=1.1 +majorver=1 +minorver=1 +frames=FALSE +tables=TRUE +cookies=TRUE +backgroundsounds=TRUE +vbscript=FALSE +javascript=FALSE +javaapplets=FALSE +ActiveXControls=FALSE +Win16=False +beta=False +AK=False +SK=False +AOL=False +platform=WinCE + + +; Pocket PC (aka Rapier) +[Mozilla/2.0 (compatible; MSIE 3.02; Windows CE; 240x320)] +browser=Pocket IE +version=4.0 +majorver=#4 +minorver=#0 +platform=Windows CE +width=240 +height=320 +cookies=TRUE +frames=TRUE +backgroundsounds=TRUE +javaapplets=FALSE +javascript=TRUE +vbscript=FALSE +tables=TRUE +activexcontrols=TRUE + +; Pocket PC (aka Merlin) +[Mozilla/2.0 (compatible; MSIE 3.02; Windows CE; PPC; JavaScript; 240x320)] +browser=Pocket IE +version=4.1 +majorver=#4 +minorver=#1 +platform=Windows CE +width=240 +height=320 +cookies=TRUE +frames=TRUE +backgroundsounds=TRUE +javaapplets=FALSE +javascript=TRUE +vbscript=FALSE +tables=TRUE +activexcontrols=TRUE + +; Smartphone (aka Stinger) +[Mozilla/2.0 (compatible; MSIE 3.02; Windows CE; Smartphone; JavaScript; *)] +browser=Pocket IE +version=4.1 +majorver=#4 +minorver=#1 +platform=Windows CE +cookies=TRUE +frames=FALSE +backgroundsounds=TRUE +javaapplets=FALSE +javascript=TRUE +vbscript=FALSE +tables=TRUE +activexcontrols=TRUE + + +;;;;;;;;;;;;;;;;;;;;;;;;; +;;; Netscape Browsers ;;; +;;;;;;;;;;;;;;;;;;;;;;;;; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Navigator 4.x +[Netscape 4.00] +browser=Netscape +version=4.00 +majorver=4 +minorver=00 +frames=TRUE +tables=TRUE +cookies=TRUE +backgroundsounds=FALSE +vbscript=FALSE +javascript=TRUE +javaapplets=TRUE +ActiveXControls=FALSE +beta=True + +[Mozilla/4.0b1 (Win95; I)] +parent=Netscape 4.00 +platform=Win95 + +[Mozilla/4.0b1 (WinNT; I)] +parent=Netscape 4.00 +platform=WinNT + +[Mozilla/4.0b2 (Win95; I)] +parent=Netscape 4.00 +platform=Win95 + +[Mozilla/4.0b2 (WinNT; I)] +parent=Netscape 4.00 +platform=WinNT + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Navigator 4.x WILDCARD (IF ALL ABOVE FAIL) +[Mozilla/4.0*] +parent=Netscape 4.00 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Navigator 3.x +[Netscape 3.01] +browser=Netscape +version=3.01 +majorver=3 +minorver=01 +frames=TRUE +tables=TRUE +cookies=TRUE +backgroundsounds=FALSE +vbscript=FALSE +javascript=TRUE +javaapplets=TRUE +ActiveXControls=FALSE +beta=False + +[Mozilla/3.01Gold (Macintosh; I; 68K)] +parent=Netscape 3.01 +platform=Mac68K + +[Mozilla/3.01Gold (Macintosh; U; 68K)] +parent=Netscape 3.01 +platform=Mac68K + +[Mozilla/3.01Gold (Macintosh; I; PPC)] +parent=Netscape 3.01 +platform=MacPPC + +[Mozilla/3.01Gold (Macintosh; U; PPC)] +parent=Netscape 3.01 +platform=MacPPC + +[Mozilla/3.01Gold*(Win95; I)] +parent=Netscape 3.01 +platform=Win95 + +[Mozilla/3.01Gold*(Win95; U)] +parent=Netscape 3.01 +platform=Win95 + +[Mozilla/3.01Gold*(WinNT; I)] +parent=Netscape 3.01 +platform=WinNT + +[Mozilla/3.01Gold*(WinNT; U)] +parent=Netscape 3.01 +platform=WinNT + +[Mozilla/3.01Gold*(Win16; I)] +parent=Netscape 3.01 +platform=Win16 + +[Mozilla/3.01Gold*(Win16; U)] +parent=Netscape 3.01 +platform=Win16 + +[Mozilla/3.01*(Win95; I)] +parent=Netscape 3.01 +platform=Win95 + +[Mozilla/3.01*(Win95; U)] +parent=Netscape 3.01 +platform=Win95 + +[Mozilla/3.01*(WinNT; I)] +parent=Netscape 3.01 +platform=WinNT + +[Mozilla/3.01*(WinNT; U)] +parent=Netscape 3.01 +platform=WinNT + +[Mozilla/3.01*(Win16; I)] +parent=Netscape 3.01 +platform=Win16 + +[Mozilla/3.01*(Win16; U)] +parent=Netscape 3.01 +platform=Win16 + +[Mozilla/3.01 (Macintosh; I; 68K)] +parent=Netscape 3.01 +platform=Mac68K + +[Mozilla/3.01 (Macintosh; U; 68K)] +parent=Netscape 3.01 +platform=Mac68K + +[Mozilla/3.01 (Macintosh; I; PPC)] +parent=Netscape 3.01 +platform=MacPPC + +[Mozilla/3.01 (Macintosh; U; PPC)] +parent=Netscape 3.01 +platform=MacPPC + +[Mozilla/3.01b1 (Win95; I)] +parent=Netscape 3.01 +platform=Win95 +beta=True + +[Mozilla/3.01b1 (WinNT; I)] +parent=Netscape 3.01 +platform=WinNT +beta=True + +[Mozilla/3.01b1 (Win16; I)] +parent=Netscape 3.01 +platform=Win16 +Win16=True +beta=True + +[Mozilla/3.01b1 (Macintosh; I; 68K)] +parent=Netscape 3.01 +platform=Mac68K +beta=True + +[Mozilla/3.01b1 (Macintosh; I; PPC)] +parent=Netscape 3.01 +platform=MacPPC +beta=True + +[Netscape 3.0] +browser=Netscape +version=3.0 +majorver=3 +minorver=0 +frames=TRUE +tables=TRUE +cookies=TRUE +backgroundsounds=FALSE +vbscript=FALSE +javascript=TRUE +javaapplets=TRUE +ActiveXControls=FALSE +beta=False + +[Mozilla/3.0Gold (Macintosh; I; 68K)] +parent=Netscape 3.0 +platform=Mac68K + + +[Mozilla/3.0Gold (Macintosh; I; PPC)] +parent=Netscape 3.0 +platform=MacPPC + +[Mozilla/3.0Gold (Macintosh; U; 68K)] +parent=Netscape 3.0 +platform=Mac68K + +[Mozilla/3.0Gold (Macintosh; U; PPC)] +parent=Netscape 3.0 +platform=MacPPC + +[Mozilla/3.0Gold*(Win16; I)] +parent=Netscape 3.0 +platform=Win16 +Win16=True + +[Mozilla/3.0Gold*(Win16; U)] +parent=Netscape 3.0 +platform=Win16 +Win16=True + +[Mozilla/3.0Gold*(Win95; I)] +parent=Netscape 3.0 +platform=Win95 + +[Mozilla/3.0Gold*(Win95; I; 16bit)] +parent=Netscape 3.0 +platform=Win95 +Win16=True + +[Mozilla/3.0Gold*(Win95; U)] +parent=Netscape 3.0 +platform=Win95 + +[Mozilla/3.0Gold*(Win95; U; 16bit)] +parent=Netscape 3.0 +platform=Win95 +Win16=True + +[Mozilla/3.0Gold*(WinNT; I)] +parent=Netscape 3.0 +platform=WinNT + +[Mozilla/3.0Gold*(WinNT; U)] +parent=Netscape 3.0 +platform=WinNT + +[Mozilla/3.0 (Macintosh; I; 68K)] +parent=Netscape 3.0 +platform=Mac68K + +[Mozilla/3.0 (Macintosh; I; PPC)] +parent=Netscape 3.0 +platform=MacPPC + +[Mozilla/3.0 (Macintosh; U; 68K)] +parent=Netscape 3.0 +platform=Mac68K + +[Mozilla/3.0 (Macintosh; U; PPC)] +parent=Netscape 3.0 +platform=MacPPC + +[Mozilla/3.0*(Win16; I)] +parent=Netscape 3.0 +platform=Win16 +Win16=True + +[Mozilla/3.0*(Win16; U)] +parent=Netscape 3.0 +platform=Win16 +Win16=True + +[Mozilla/3.0*(Win95; I)] +parent=Netscape 3.0 +platform=Win95 + +[Mozilla/3.0*(Win95; I; 16bit)] +parent=Netscape 3.0 +platform=Win95 +Win16=True + +[Mozilla/3.0*(Win95; U)] +parent=Netscape 3.0 +platform=Win95 + +[Mozilla/3.0*(Win95; U; 16bit)] +parent=Netscape 3.0 +platform=Win95 +Win16=True + +[Mozilla/3.0*(WinNT; I)] +parent=Netscape 3.0 +platform=WinNT + +[Mozilla/3.0*(WinNT; U)] +parent=Netscape 3.0 +platform=WinNT + +[Mozilla/3.0b3 (Win16; I)] +parent=Netscape 3.0 +platform=Win16 +beta=True + +[Mozilla/3.0b3 (Win95; I)] +parent=Netscape 3.0 +platform=Win95 +beta=True + +[Mozilla/3.0b3 (WinNT; I)] +parent=Netscape 3.0 +platform=WinNT +beta=True + +[Mozilla/3.0b3Gold (Win95; I)] +parent=Netscape 3.0 +platform=Win95 +beta=True + +[Mozilla/3.0b4 (Macintosh; I; PPC)] +parent=Netscape 3.0 +platform=MacPPC +beta=True + +[Mozilla/3.0b4 (Win16; I)] +parent=Netscape 3.0 +platform=Win16 +Win16=True +beta=True + +[Mozilla/3.0b4 (Win95; I)] +parent=Netscape 3.0 +platform=Win95 +beta=True + +[Mozilla/3.0b4 (Win95; I; 16bit)] +parent=Netscape 3.0 +platform=Win95 +Win16=True +beta=True + +[Mozilla/3.0b4 (WinNT; I)] +parent=Netscape 3.0 +platform=WinNT +beta=True + +[Mozilla/3.0b4Gold (Macintosh; I; 68K)] +parent=Netscape 3.0 +platform=Mac68K +beta=True + +[Mozilla/3.0b4Gold (Macintosh; I; PPC)] +parent=Netscape 3.0 +platform=MacPPC +beta=True + +[Mozilla/3.0b4Gold (Win16; I)] +parent=Netscape 3.0 +platform=Win16 +Win16=True +beta=True + +[Mozilla/3.0b4Gold (Win95; I)] +parent=Netscape 3.0 +platform=Win95 +beta=True + +[Mozilla/3.0b4Gold (Win95; I; 16bit)] +parent=Netscape 3.0 +platform=Win95 +Win16=True +beta=True + +[Mozilla/3.0b4Gold (WinNT; I)] +parent=Netscape 3.0 +platform=WinNT +beta=True + +[Mozilla/3.0b5 (Macintosh; I; 68K)] +parent=Netscape 3.0 +platform=Mac68K +beta=True + +[Mozilla/3.0b5 (Macintosh; I; PPC)] +parent=Netscape 3.0 +platform=MacPPC +beta=True + +[Mozilla/3.0b5 (Win16; I)] +parent=Netscape 3.0 +platform=Win16 +beta=True +Win16=True + +[Mozilla/3.0b5 (Win16; U)] +parent=Netscape 3.0 +platform=Win16 +Win16=True +beta=True + +[Mozilla/3.0b5 (Win95; I)] +parent=Netscape 3.0 +platform=Win95 +beta=True + +[Mozilla/3.0b5 (Win95; U)] +parent=Netscape 3.0 +platform=Win95 +beta=True + +[Mozilla/3.0b5 (WinNT; I)] +parent=Netscape 3.0 +platform=WinNT +beta=True + +[Mozilla/3.0b5 (WinNT; U)] +parent=Netscape 3.0 +platform=WinNT +beta=True + +[Mozilla/3.0b5Gold (Macintosh; I; 68K)] +parent=Netscape 3.0 +platform=Mac68K +beta=True + +[Mozilla/3.0b5Gold (Macintosh; I; PPC)] +parent=Netscape 3.0 +platform=MacPPC +beta=True + +[Mozilla/3.0b5Gold (Win16; I)] +parent=Netscape 3.0 +platform=Win16 +Win16=True +beta=True + +[Mozilla/3.0b5Gold (Win95; I)] +parent=Netscape 3.0 +platform=Win95 +beta=True + +[Mozilla/3.0b5Gold (Win95; I; 16bit)] +parent=Netscape 3.0 +platform=Win95 +Win16=True +beta=True + + +[Mozilla/3.0b5Gold (WinNT; I)] +parent=Netscape 3.0 +platform=WinNT +beta=True + +[Mozilla/3.0b5a (Win16; I)] +parent=Netscape 3.0 +platform=Win16 +Win16=True + +[Mozilla/3.0b5a (Win95; I)] +parent=Netscape 3.0 +platform=Win95 +beta=True + +[Mozilla/3.0b5a (Win95; I; 16bit)] +parent=Netscape 3.0 +platform=Win95 +Win16=True +beta=True + +[Mozilla/3.0b5a (WinNT; I)] +parent=Netscape 3.0 +platform=WinNT +beta=True + +[Mozilla/3.0b5aGold (Win16; I)] +parent=Netscape 3.0 +platform=Win16 +Win16=True +beta=True + +[Mozilla/3.0b5aGold (Win95; I)] +parent=Netscape 3.0 +platform=Win95 +beta=True + +[Mozilla/3.0b5aGold (Win95; I; 16bit)] +parent=Netscape 3.0 +platform=Win95 +Win16=True +beta=True + +[Mozilla/3.0b5aGold (WinNT; I)] +parent=Netscape 3.0 +platform=WinNT +beta=True + +[Mozilla/3.0b6 (Macintosh; I; PPC)] +parent=Netscape 3.0 +platform=MacPPC +beta=True + +[Mozilla/3.0b6 (Win16; I)] +parent=Netscape 3.0 +platform=Win16 +Win16=True +beta=True + +[Mozilla/3.0b6 (Win95; I)] +parent=Netscape 3.0 +platform=Win95 +beta=True + +[Mozilla/3.0b6 (Win95; I; 16bit)] +parent=Netscape 3.0 +platform=Win95 +Win16=True +beta=True + +[Mozilla/3.0b6 (Win95; U)] +parent=Netscape 3.0 +platform=Win95 +beta=True + +[Mozilla/3.0b6 (WinNT; I)] +parent=Netscape 3.0 +platform=WinNT +beta=True + +[Mozilla/3.0b6Gold (Win16; I)] +parent=Netscape 3.0 +platform=Win16 +Win16=True +beta=True + +[Mozilla/3.0b6Gold (Win95; I)] +parent=Netscape 3.0 +platform=Win95 +beta=True + +[Mozilla/3.0b6Gold (Win95; I; 16bit)] +parent=Netscape 3.0 +platform=Win95 +Win16=True +beta=True + +[Mozilla/3.0b6Gold (WinNT; I)] +parent=Netscape 3.0 +platform=WinNT +beta=True + +[Mozilla/3.0b6a (Macintosh; I; 68K)] +parent=Netscape 3.0 +platform=Mac68K +beta=True + +[Mozilla/3.0b6a (Macintosh; I; PPC)] +parent=Netscape 3.0 +platform=MacPPC +beta=True + +[Mozilla/3.0b6aGold (Macintosh; I; 68K)] +parent=Netscape 3.0 +platform=Mac68K +beta=True + +[Mozilla/3.0b6aGold (Macintosh; I; PPC)] +parent=Netscape 3.0 +platform=MacPPC +beta=True + +[Mozilla/3.0b7 (Macintosh; I; 68K)] +parent=Netscape 3.0 +platform=Mac68K +beta=True + +[Mozilla/3.0b7 (Macintosh; I; PPC)] +parent=Netscape 3.0 +platform=MacPPC +beta=True + +[Mozilla/3.0b7 (Win16; I)] +parent=Netscape 3.0 +platform=Win16 +Win16=True +beta=True + +[Mozilla/3.0b7 (Win95; I)] +parent=Netscape 3.0 +platform=Win95 +beta=True + +[Mozilla/3.0b7 (Win95; I; 16bit)] +parent=Netscape 3.0 +platform=Win95 +Win16=True +beta=True + +[Mozilla/3.0b7 (WinNT; I)] +parent=Netscape 3.0 +platform=WinNT +beta=True + +[Mozilla/3.0b7Gold (Macintosh; I; 68K)] +parent=Netscape 3.0 +platform=Mac68K +beta=True + +[Mozilla/3.0b7Gold (Macintosh; I; PPC)] +parent=Netscape 3.0 +platform=MacPPC +beta=True + +[Mozilla/3.0b7Gold (Win16; I)] +parent=Netscape 3.0 +platform=Win16 +Win16=True +beta=True + +[Mozilla/3.0b7Gold (Win95; I)] +parent=Netscape 3.0 +platform=Win95 +beta=True + +[Mozilla/3.0b7Gold (Win95; I; 16bit)] +parent=Netscape 3.0 +platform=Win95 +Win16=True +beta=True + +[Mozilla/3.0b7Gold (Win95; U)] +parent=Netscape 3.0 +platform=Win95 +beta=True + +[Mozilla/3.0b7Gold (WinNT; I)] +parent=Netscape 3.0 +platform=WinNT +beta=True + +[Mozilla/3.0b7a (Win95; I)] +parent=Netscape 3.0 +platform=Win95 +beta=True + +[Mozilla/3.0b7a (WinNT; I)] +parent=Netscape 3.0 +platform=WinNT +beta=True + +[Mozilla/3.0b8Gold (Macintosh; I; 68K)] +parent=Netscape 3.0 +platform=Mac68K +beta=True + +[Mozilla/3.0b8Gold (Macintosh; I; PPC)] +parent=Netscape 3.0 +platform=MacPPC +beta=True + +[Mozilla/3.0b8Gold (Win16; I)] +parent=Netscape 3.0 +platform=Win16 +Win16=True +beta=True + +[Mozilla/3.0b8Gold (Win16; U)] +parent=Netscape 3.0 +platform=Win16 +Win16=True +beta=True + +[Mozilla/3.0b8Gold (Win95; I)] +parent=Netscape 3.0 +platform=Win95 +beta=True + +[Mozilla/3.0b8Gold (Win95; I; 16bit)] +parent=Netscape 3.0 +platform=Win95 +Win16=True +beta=True + + +[Mozilla/3.0b8Gold (Win95; U)] +parent=Netscape 3.0 +platform=Win95 +beta=True + +[Mozilla/3.0b8Gold (WinNT; I)] +parent=Netscape 3.0 +platform=WinNT +beta=True + +[Netscape 2.0] +browser=Netscape +version=2.0 +majorver=2 +minorver=0 +frames=TRUE +tables=TRUE +cookies=TRUE +backgroundsounds=FALSE +vbscript=FALSE +javascript=TRUE +javaapplets=TRUE +beta=False +Win16=False + +[Mozilla/2.0 (Macintosh; I; 68K)] +parent=Netscape 2.0 +platform=Mac68K + +[Mozilla/2.0 (Macintosh; I; PPC)] +parent=Netscape 2.0 +platform=MacPPC + +[Mozilla/2.0 (Macintosh; U; 68K)] +parent=Netscape 2.0 +platform=Mac68K + +[Mozilla/2.0 (Macintosh; U; PPC)] +parent=Netscape 2.0 +platform=MacPPC + +[Mozilla/2.0 (16bit; I)] +parent=Netscape 2.0 +platform=16bit +Win16=True + +[Mozilla/2.0 (16bit; U)] +parent=Netscape 2.0 +platform=16bit +Win16=True + +[Mozilla/2.0 (Win95; I)] +parent=Netscape 2.0 +platform=Win95 + +[Mozilla/2.0 (Win95; I; 16bit)] +parent=Netscape 2.0 +platform=Win95 +Win16=True + +[Mozilla/2.0 (Win95; U)] +parent=Netscape 2.0 +platform=Win95 + +[Mozilla/2.0 (Win95; U; 16bit)] +parent=Netscape 2.0 +platform=Win95 +Win16=True + +[Mozilla/2.0 (WinNT; I)] +parent=Netscape 2.0 +platform=WinNT + +[Mozilla/2.0 (WinNT; U)] +parent=Netscape 2.0 +platform=WinNT + +[Mozilla/2.0 (Windows; I; 32bit)] +parent=Netscape 2.0 +platform=Windows + + +[Mozilla/2.01 (Macintosh; I; 68K)] +parent=Netscape 2.0 +platform=Mac68K + +[Mozilla/2.01 (Macintosh; I; PPC)] +parent=Netscape 2.0 +platform=MacPPC + +[Mozilla/2.01 (Macintosh; U; 68K)] +parent=Netscape 2.0 +platform=Mac68K + +[Mozilla/2.01 (Macintosh; U; PPC)] +parent=Netscape 2.0 +platform=MacPPC + +[Mozilla/2.01 (16bit; I)] +parent=Netscape 2.0 +platform=16bit +Win16=True + +[Mozilla/2.01 (16bit; U)] +parent=Netscape 2.0 +platform=Win16 +Win16=TRue + +[Mozilla/2.01 (Win95; I)] +parent=Netscape 2.0 +platform=Win95 + +[Mozilla/2.01 (Win95; I; 16bit)] +parent=Netscape 2.0 +platform=Win95 +Win16=True + +[Mozilla/2.01 (Win95; U)] +parent=Netscape 2.0 +platform=Win95 + +[Mozilla/2.01 (Win95; U; 16bit)] +parent=Netscape 2.0 +platform=Win95 +Win16=True + +[Mozilla/2.01 (WinNT; I)] +parent=Netscape 2.0 +platform=WinNT + +[Mozilla/2.01 (WinNT; U)] +parent=Netscape 2.0 +platform=WinNT + +[Mozilla/2.01Gold (Win95; I)] +parent=Netscape 2.0 +platform=Win95 + +[Mozilla/2.01Gold (Win95; U)] +parent=Netscape 2.0 +platform=Win95 + +[Mozilla/2.01Gold (WinNT; I)] +parent=Netscape 2.0 +platform=WinNT + +[Mozilla/2.01Gold (WinNT; U)] +parent=Netscape 2.0 +platform=WinNT + +[Mozilla/2.01GoldA1 (Macintosh; I; 68K)] +parent=Netscape 2.0 +platform=Mac68K + +[Mozilla/2.01I (16bit; I)] +parent=Netscape 2.0 +platform=Win16 +Win16=True + +[Mozilla/2.01I (Win95; I)] +parent=Netscape 2.0 +platform=Win95 + +[Mozilla/2.01I (WinNT; I)] +parent=Netscape 2.0 +platform=WinNT + + +[Mozilla/2.02 (Macintosh; I; 68K)] +parent=Netscape 2.0 +platform=Mac68K + +[Mozilla/2.02 (Macintosh; I; PPC)] +parent=Netscape 2.0 +platform=MacPPC + +[Mozilla/2.02 (Macintosh; U; 68K)] +parent=Netscape 2.0 +platform=Mac68K + +[Mozilla/2.02 (Macintosh; U; PPC)] +parent=Netscape 2.0 +platform=MacPPC + +[Mozilla/2.02 (16bit; I)] +parent=Netscape 2.0 +platform=Win16 +Win16=True + +[Mozilla/2.02 (16bit; U)] +parent=Netscape 2.0 +platform=Win16 +Win16=True + +[Mozilla/2.02 (Win95; I)] +parent=Netscape 2.0 +platform=Win95 + +[Mozilla/2.02 (Win95; I; 16bit)] +parent=Netscape 2.0 +platform=Win95 +Win16=True + +[Mozilla/2.02 (Win95; U)] +parent=Netscape 2.0 +platform=Win95 + +[Mozilla/2.02 (Win95; U; 16bit)] +parent=Netscape 2.0 +platform=Win95 +Win16=True + +[Mozilla/2.02 (WinNT; I)] +parent=Netscape 2.0 +platform=WinNT + +[Mozilla/2.02 (WinNT; U)] +parent=Netscape 2.0 +platform=WinNT + +[Mozilla/2.02Gold (Win95; I)] +parent=Netscape 2.0 +platform=Win95 + +[Mozilla/2.02Gold (Win95; U)] +parent=Netscape 2.0 +platform=Win95 + +[Mozilla/2.02Gold (WinNT; I)] +parent=Netscape 2.0 +platform=WinNT + +[Mozilla/2.02Gold (WinNT; U)] +parent=Netscape 2.0 +platform=WinNT + + + +;;;;;;;;;;;;;;;;;;;;;; +;;; Oracle Browser ;;; +;;;;;;;;;;;;;;;;;;;;;; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Oracle 1.x +[Oracle 1.5] +browser=Power Browser +version=1.5 +majorver=1.5 +minover=0 +frames=TRUE +tables=TRUE +cookies=TRUE +backgroundsounds=FALSE +vbscript=TRUE +javascript=TRUE +javaapplets=TRUE + +[Mozilla/2.01 (Compatible) Oracle(tm) PowerBrowser(tm)/1.0a] +parent=Oracle 1.5 +platform=Win95 + +;;;;;;;;; +; Opera ; +;;;;;;;;; + +[Opera Common] +browser=Opera +version=3 +majorver=3 +minorver=60 +platform=Win32 +frames=True +tables=True +cookies=True +backgroundsounds=True +vbscript=False +javascript=True +javaapplets=True +activexcontrols=False +AK=False +SK=False +AOL=False +beta=False +Win16=False +Crawler=False +CDF=False + +[Opera 2.0] +parent=Opera Common +browser=Opera +version=2 +majorver=2 +minorver=0 +javaapplets=False + +[Mozilla/2.1 (compatible; Opera/2.12; Windows 3.1)] +parent=Opera 2.0 +version=2.12 +minorver=12 +platform=Win16 +Win16=True; + +[Mozilla/2.1 (compatible; Opera/2.12; Windows*)] +parent=Opera 2.0 +version=2.12 +minorver=12 + +; fallback +[Mozilla/2.* (compatible; Opera/2.*)] +parent=Opera 2.0 +platform=unknown + + +[Opera 3.0] +parent=Opera Common +version=3 +majorver=3 +minorver=0 +javaapplets=False + +[Opera 3.21] +parent=Opera 3.0 +version=3.21 +majorver=3 +minorver=21 + +[Mozilla/3.0 (compatible; Opera/3.0; Windows 3.1)*] +parent=Opera 3.0 +platform=Win31 + +[Mozilla/3.0 (compatible; Opera/3.0; Windows*)*] +parent=Opera 3.0 + +[Mozilla/3.0 (compatible; Opera/3.0; Windows 3.1) 3.21*] +parent=Opera 3.21 +platform=Win16 +win16=true + +[Mozilla/3.0 (compatible; Opera/3.0; Windows*) 3.21*] +parent=Opera 3.21 + +[Opera 3.50] +parent=Opera Common +version=3.50 +majorver=3 +minorver=50 + +[Opera 3.51] +parent=Opera Common +version=3.51 +majorver=3 +minorver=51 + +; Matches both Mozilla 3 and 4 (and others :-) + +[Mozilla/?.0 (compatible; Opera/3.0; Windows 3.1) 3.50*] +parent=Opera 3.50 +platform=Win16 +Win16=True +javaapplets=False + +[Mozilla/?.0 (compatible; Opera/3.0; Windows*) 3.50*] +parent=Opera 3.50 + +[Mozilla/?.0 (compatible; Opera/3.0;*) 3.50*] +parent=Opera 3.50 +platform=unknown + +[Mozilla/?.0 (compatible; Opera/3.0; Windows 3.1) 3.51*] +parent=Opera 3.51 +platform=Win16 +Win16=True +javaapplets=False + +[Mozilla/?.0 (compatible; Opera/3.0; Windows*) 3.51*] +parent=Opera 3.51 + +[Mozilla/?.0 (compatible; Opera/3.0;*) 3.51*] +parent=Opera 3.51 +platform=unknown + +[Opera 3.60] +parent=Opera Common +version=3.60 +majorver=3 +minorver=60 + +[Opera unknown system] +parent=Opera 3.60 +platform=unknown + +[Mozilla/?.0 (Windows 3.1;US) Opera 3.60b* ] +parent=Opera 3.60 +platform=Win16 +win16=true +javaapplets=False +beta=true + +[Mozilla/?.0 (Windows*;US) Opera 3.60b* ] +parent=Opera 3.60 +beta=true + +[Mozilla/?.0 (*;US) Opera 3.60b* ] +parent=Opera 3.60 +platform=unknown +beta=true + +[Mozilla/?.0 (Windows 3.1;US) Opera 3.60*] +parent=Opera 3.60 +platform=Win16 +win16=true +javaapplets=False + +[Mozilla/?.0 (Windows*;US) Opera 3.60*] +parent=Opera 3.60 + +[Mozilla/?.0 (*;US) Opera 3.60*] +parent=Opera 3.60 +platform=unknown + +[Mozilla/?.0 (Windows 3.1;US) Opera 3.*] +parent=Opera 3.60 +platform=Win16 +win16=true +javaapplets=False + +[Mozilla/?.0 (Windows*;US) Opera 3.*] +parent=Opera 3.60 + +[Mozilla/?.0 (*;US) Opera 3.*] +parent=Opera 3.60 +platform=unknown + +[Opera 4.0] +parent=Opera Common +version=4 +majorver=4 +minorver=0 + +[Mozilla/?.0 (Windows 3.1;US) Opera 4*] +parent=Opera 4.0 +platform=Win16 +win16=true +javaapplets=False + +[Mozilla/?.0 (Windows*;US) Opera 4*] +parent=Opera 4.0 + +[Mozilla/?.0 (*;US) Opera 4*] +parent=Opera 4.0 +platform=unknown + +; Fallbacks + +[Mozilla/?.0 (compatible; Opera/3.0;*)] +parent=Opera unknown system + +[Mozilla/?.0 (*;US) Opera*] +parent=Opera unknown system + +[*Opera*] +parent=Opera unknown system + +;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; Default Browser ;;; +;;;;;;;;;;;;;;;;;;;;;;;;;; +[*] +browser=Default +Version=0.0 +majorver=#0 +minorver=#0 +frames=False +tables=True +cookies=False +backgroundsounds=False +vbscript=False +javascript=False +javaapplets=False +activexcontrols=False +AK=False +SK=False +AOL=False +beta=False +Win16=False +Crawler=False +CDF=False +AuthenticodeUpdate= + diff --git a/IISExpress/cachtokn.dll b/IISExpress/cachtokn.dll new file mode 100644 index 000000000..10c50071c Binary files /dev/null and b/IISExpress/cachtokn.dll differ diff --git a/IISExpress/cachuri.dll b/IISExpress/cachuri.dll new file mode 100644 index 000000000..8ed2e8461 Binary files /dev/null and b/IISExpress/cachuri.dll differ diff --git a/IISExpress/cgi.dll b/IISExpress/cgi.dll new file mode 100644 index 000000000..0da8bdc8f Binary files /dev/null and b/IISExpress/cgi.dll differ diff --git a/IISExpress/compdyn.dll b/IISExpress/compdyn.dll new file mode 100644 index 000000000..4ce172958 Binary files /dev/null and b/IISExpress/compdyn.dll differ diff --git a/IISExpress/compstat.dll b/IISExpress/compstat.dll new file mode 100644 index 000000000..760217ef6 Binary files /dev/null and b/IISExpress/compstat.dll differ diff --git a/IISExpress/config/schema/ASPNET_schema.xml b/IISExpress/config/schema/ASPNET_schema.xml new file mode 100644 index 000000000..258adea26 --- /dev/null +++ b/IISExpress/config/schema/ASPNET_schema.xml @@ -0,0 +1,582 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IISExpress/config/schema/FX_schema.xml b/IISExpress/config/schema/FX_schema.xml new file mode 100644 index 000000000..a966090aa --- /dev/null +++ b/IISExpress/config/schema/FX_schema.xml @@ -0,0 +1,439 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/IISExpress/config/schema/IIS_schema.xml b/IISExpress/config/schema/IIS_schema.xml new file mode 100644 index 000000000..10c4a1011 --- /dev/null +++ b/IISExpress/config/schema/IIS_schema.xml @@ -0,0 +1,1394 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/IISExpress/config/schema/WebDAV_schema.xml b/IISExpress/config/schema/WebDAV_schema.xml new file mode 100644 index 000000000..92cddade4 --- /dev/null +++ b/IISExpress/config/schema/WebDAV_schema.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/IISExpress/config/schema/dbmanager_schema.xml b/IISExpress/config/schema/dbmanager_schema.xml new file mode 100644 index 000000000..0ce2363ae --- /dev/null +++ b/IISExpress/config/schema/dbmanager_schema.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/IISExpress/config/schema/rewrite_schema.xml b/IISExpress/config/schema/rewrite_schema.xml new file mode 100644 index 000000000..c917ec0f0 --- /dev/null +++ b/IISExpress/config/schema/rewrite_schema.xml @@ -0,0 +1,264 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IISExpress/config/schema/rscaext.xml b/IISExpress/config/schema/rscaext.xml new file mode 100644 index 000000000..3d5d9a242 --- /dev/null +++ b/IISExpress/config/schema/rscaext.xml @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/IISExpress/config/schema/xhtml1-transitional.xsd b/IISExpress/config/schema/xhtml1-transitional.xsd new file mode 100644 index 000000000..8ce44fb9a --- /dev/null +++ b/IISExpress/config/schema/xhtml1-transitional.xsd @@ -0,0 +1,2755 @@ + + + + + + XHTML 1.0 (Second Edition) Transitional in XML Schema + + This is the same as HTML 4 Transitional except for + changes due to the differences between XML and SGML. + + Namespace = http://www.w3.org/1999/xhtml + + For further information, see: http://www.w3.org/TR/xhtml1 + + Copyright (c) 1998-2002 W3C (MIT, INRIA, Keio), + All Rights Reserved. + + The DTD version is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" + + $Id: xhtml1-transitional.xsd,v 1.5 2002/08/28 09:53:29 mimasa Exp $ + + + + + + + + ================ Character mnemonic entities ========================= + + XHTML entity sets are identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN" + SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent" + + PUBLIC "-//W3C//ENTITIES Special for XHTML//EN" + SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent" + + PUBLIC "-//W3C//ENTITIES Symbols for XHTML//EN" + SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent" + + + + + + ================== Imported Names ==================================== + + + + + + + media type, as per [RFC2045] + + + + + + + + + comma-separated list of media types, as per [RFC2045] + + + + + + + + + a character encoding, as per [RFC2045] + + + + + + + + + a space separated list of character encodings, as per [RFC2045] + + + + + + + + + a language code, as per [RFC3066] + + + + + + + + + a single character, as per section 2.2 of [XML] + + + + + + + + + + + one or more digits + + + + + + + + + + + tabindex attribute specifies the position of the current element + in the tabbing order for the current document. This value must be + a number between 0 and 32767. User agents should ignore leading zeros. + + + + + + + + + + + + space-separated list of link types + + + + + + + + + single or comma-separated list of media descriptors + + + + + + + + + + + a Uniform Resource Identifier, see [RFC2396] + + + + + + + + + a space separated list of Uniform Resource Identifiers + + + + + + + + + date and time information. ISO date format + + + + + + + + + script expression + + + + + + + + + style sheet data + + + + + + + + + used for titles etc. + + + + + + + + + render in this frame + + + + + + + + + + + nn for pixels or nn% for percentage length + + + + + + + + + + + pixel, percentage, or relative + + + + + + + + + + + integer representing length in pixels + + + + + + + + these are used for image maps + + + + + + + + + + + + + + + + comma separated list of lengths + + + + + + + + + + + used for object, applet, img, input and iframe + + + + + + + + + + + + + + + a color using sRGB: #RRGGBB as Hex values + + There are also 16 widely known color names with their sRGB values: + + Black = #000000 Green = #008000 + Silver = #C0C0C0 Lime = #00FF00 + Gray = #808080 Olive = #808000 + White = #FFFFFF Yellow = #FFFF00 + Maroon = #800000 Navy = #000080 + Red = #FF0000 Blue = #0000FF + Purple = #800080 Teal = #008080 + Fuchsia= #FF00FF Aqua = #00FFFF + + + + + + + + + + =================== Generic Attributes =============================== + + + + + + + core attributes common to most elements + id document-wide unique id + class space separated list of classes + style associated style info + title advisory title/amplification + + + + + + + + + + + + internationalization attributes + lang language code (backwards compatible) + xml:lang language code (as per XML 1.0 spec) + dir direction for weak/neutral text + + + + + + + + + + + + + + + + + + attributes for common UI events + onclick a pointer button was clicked + ondblclick a pointer button was double clicked + onmousedown a pointer button was pressed down + onmouseup a pointer button was released + onmousemove a pointer was moved onto the element + onmouseout a pointer was moved away from the element + onkeypress a key was pressed and released + onkeydown a key was pressed down + onkeyup a key was released + + + + + + + + + + + + + + + + + + attributes for elements that can get the focus + accesskey accessibility key character + tabindex position in tabbing order + onfocus the element got the focus + onblur the element lost the focus + + + + + + + + + + + + + + + + + + text alignment for p, div, h1-h6. The default is + align="left" for ltr headings, "right" for rtl + + + + + + + + + + + + + + + + + =================== Text Elements ==================================== + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + these can only occur at block level + + + + + + + + + + + + + these can only occur at block level + + + + + + + + + + + + + + + + + + + + + + "Inline" covers inline or "text-level" element + + + + + + + + + + + ================== Block level elements ============================== + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + "Flow" mixes block and inline and is used for list items etc. + + + + + + + + + + + + + ================== Content models for exclusions ===================== + + + + + + + a elements use "Inline" excluding a + + + + + + + + + + + + + + + pre uses "Inline" excluding img, object, applet, big, small, + font, or basefont + + + + + + + + + + + + + + + + form uses "Flow" excluding form + + + + + + + + + + + + + button uses "Flow" but excludes a, form, form controls, iframe + + + + + + + + + + + + + + + + + + + + + + + + + ================ Document Structure ================================== + + + + + + + + + + + + + + + + + ================ Document Head ======================================= + + + + + + + + + + + + + + + + + + + + content model is "head.misc" combined with a single + title and an optional base element in any order + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The title element is not considered part of the flow of text. + It should be displayed, for example as the page header or + window title. Exactly one title is required per document. + + + + + + + + + + + + document base URI + + + + + + + + + + + + + generic metainformation + + + + + + + + + + + + + + + + Relationship values can be used in principle: + + a) for document specific toolbars/menus when used + with the link element in document head e.g. + start, contents, previous, next, index, end, help + b) to link to a separate style sheet (rel="stylesheet") + c) to make a link to a script (rel="script") + d) by stylesheets to control how collections of + html nodes are rendered into printed documents + e) to make a link to a printable version of this document + e.g. a PostScript or PDF version (rel="alternate" media="print") + + + + + + + + + + + + + + + + + + + style info, which may include CDATA sections + + + + + + + + + + + + + + + + script statements, which may include CDATA sections + + + + + + + + + + + + + + + + + + + + + + + alternate content container for non script-based rendering + + + + + + + + + + + + + + ======================= Frames ======================================= + + + + + + + inline subwindow + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + alternate content container for non frame-based rendering + + + + + + + + + + + + + + =================== Document Body ==================================== + + + + + + + + + + + + + + + + + + + + + + + + + generic language/style container + + + + + + + + + + + + + + + =================== Paragraphs ======================================= + + + + + + + + + + + + + + + + + =================== Headings ========================================= + + There are six levels of headings from h1 (the most important) + to h6 (the least important). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + =================== Lists ============================================ + + + + + + + Unordered list bullet styles + + + + + + + + + + + + + Unordered list + + + + + + + + + + + + + + + + + + + + + + Ordered list numbering style + + 1 arabic numbers 1, 2, 3, ... + a lower alpha a, b, c, ... + A upper alpha A, B, C, ... + i lower roman i, ii, iii, ... + I upper roman I, II, III, ... + + The style is applied to the sequence number which by default + is reset to 1 for the first list item in an ordered list. + + + + + + + + + Ordered (numbered) list + + + + + + + + + + + + + + + + + + + + + + + single column list (DEPRECATED) + + + + + + + + + + + + + + + + + + + + + multiple column list (DEPRECATED) + + + + + + + + + + + + + + + + + + + + + LIStyle is constrained to: "(ULStyle|OLStyle)" + + + + + + + + + list item + + + + + + + + + + + + + + + + definition lists - dt for term, dd for its definition + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + =================== Address ========================================== + + + + + + + information on author + + + + + + + + + + + + + + + =================== Horizontal Rule ================================== + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + =================== Preformatted Text ================================ + + + + + + + content is "Inline" excluding + "img|object|applet|big|small|sub|sup|font|basefont" + + + + + + + + + + + + + + + + =================== Block-like Quotes ================================ + + + + + + + + + + + + + + + + + =================== Text alignment =================================== + + + + + + + center content + + + + + + + + + + + + + + =================== Inserted/Deleted Text ============================ + + ins/del are allowed in block and inline content, but its + inappropriate to include block content within an ins element + occurring in inline content. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ================== The Anchor Element ================================ + + + + + + + content is "Inline" except that anchors shouldn't be nested + + + + + + + + + + + + + + + + + + + + + + + + + ===================== Inline Elements ================================ + + + + + + + generic language/style container + + + + + + + + + + + + + + + I18N BiDi over-ride + + + + + + + + + + + + + + + + + + + + + + + + + + forced line break + + + + + + + + + + + + + + + + + + + + + emphasis + + + + + + + + + + + + + + + strong emphasis + + + + + + + + + + + + + + + definitional + + + + + + + + + + + + + + + program code + + + + + + + + + + + + + + + sample + + + + + + + + + + + + + + + something user would type + + + + + + + + + + + + + + + variable + + + + + + + + + + + + + + + citation + + + + + + + + + + + + + + + abbreviation + + + + + + + + + + + + + + + acronym + + + + + + + + + + + + + + + inlined quote + + + + + + + + + + + + + + + + subscript + + + + + + + + + + + + + + + superscript + + + + + + + + + + + + + + + fixed pitch font + + + + + + + + + + + + + + + italic font + + + + + + + + + + + + + + + bold font + + + + + + + + + + + + + + + bigger font + + + + + + + + + + + + + + + smaller font + + + + + + + + + + + + + + + underline + + + + + + + + + + + + + + + strike-through + + + + + + + + + + + + + + + strike-through + + + + + + + + + + + + + + + base font size + + + + + + + + + + + + + + local change to font + + + + + + + + + + + + + + + + + + ==================== Object ====================================== + + object is used to embed objects as part of HTML pages. + param elements should precede other content. Parameters + can also be expressed as attribute/value pairs on the + object element itself when brevity is desired. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + param is used to supply a named property value. + In XML it would seem natural to follow RDF and support an + abbreviated syntax where the param elements are replaced + by attribute value pairs on the object start tag. + + + + + + + + + + + + + + + + + + + + + + =================== Java applet ================================== + + One of code or object attributes must be present. + Place param elements before other content. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + =================== Images =========================================== + + To avoid accessibility problems for people who aren't + able to see the image, you should provide a text + description using the alt and longdesc attributes. + In addition, avoid the use of server-side image maps. + + + + + + + + + + + + + + + + usemap points to a map element which may be in this document + or an external document, although the latter is not widely supported + + + + + + + + + + + + + + + + + + + + ================== Client-side image maps ============================ + + These can be placed in the same document or grouped in a + separate document although this isn't yet widely supported + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ================ Forms =============================================== + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Each label must not contain more than ONE field + Label elements shouldn't be nested. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + form control + + + + + + + + + + the name attribute is required for all but submit & reset + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + option selector + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + option group + + + + + + + + + + + + + + + + + + + + + + selectable choice + + + + + + + + + + + + + + + + + + + + + + + + + + + multi-line text field + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The fieldset element is used to group form fields. + Only one legend element should occur in the content + and if present should only be preceded by whitespace. + + NOTE: this content model is different from the XHTML 1.0 DTD, + closer to the intended content model in HTML4 DTD + + + + + + + + + + + + + + + + + + + + + + + + + + + + + fieldset label + + + + + + + + + + + + + + + + + Content is "Flow" excluding a, form and form controls + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + single-line text input control (DEPRECATED) + + + + + + + + + + + + ======================= Tables ======================================= + + Derived from IETF HTML table standard, see [RFC1942] + + + + + + + The border attribute sets the thickness of the frame around the + table. The default units are screen pixels. + + The frame attribute specifies which parts of the frame around + the table should be rendered. The values are not the same as + CALS to avoid a name clash with the valign attribute. + + + + + + + + + + + + + + + + + + + The rules attribute defines which rules to draw between cells: + + If rules is absent then assume: + "none" if border is absent or border="0" otherwise "all" + + + + + + + + + + + + + + + horizontal placement of table relative to document + + + + + + + + + + + + + horizontal alignment attributes for cell contents + + char alignment char, e.g. char=':' + charoff offset for alignment char + + + + + + + + + + + + + + + + + + + + + vertical alignment attributes for cell contents + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Use thead to duplicate headers when breaking table + across page boundaries, or for static headers when + tbody sections are rendered in scrolling panel. + + Use tfoot to duplicate footers when breaking table + across page boundaries, or for static footers when + tbody sections are rendered in scrolling panel. + + Use multiple tbody sections when rules are needed + between groups of table rows. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + colgroup groups a set of col elements. It allows you to group + several semantically related columns together. + + + + + + + + + + + + + + + + + + col elements define the alignment properties for cells in + one or more columns. + + The width attribute specifies the width of the columns, e.g. + + width=64 width in screen pixels + width=0.5* relative width of 0.5 + + The span attribute causes the attributes of one + col element to apply to more than one column. + + + + + + + + + + + + + + + + + + + + + + + + + + + + Scope is simpler than headers attribute for common tables + + + + + + + + + + + + + th is for headers, td for data and for cells acting as both + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/IISExpress/custerr.dll b/IISExpress/custerr.dll new file mode 100644 index 000000000..0e638083b Binary files /dev/null and b/IISExpress/custerr.dll differ diff --git a/IISExpress/custerr/en-us/401-1.htm b/IISExpress/custerr/en-us/401-1.htm new file mode 100644 index 000000000..0b9543f75 --- /dev/null +++ b/IISExpress/custerr/en-us/401-1.htm @@ -0,0 +1,28 @@ + + + +401.1 - Unauthorized: Access is denied due to invalid credentials. + + + + +
+
+

401.1 - Unauthorized: Access is denied due to invalid credentials.

+

You do not have permission to view this directory or page using the credentials that you supplied.

+
+
+ + diff --git a/IISExpress/custerr/en-us/401-2.htm b/IISExpress/custerr/en-us/401-2.htm new file mode 100644 index 000000000..655478eb5 --- /dev/null +++ b/IISExpress/custerr/en-us/401-2.htm @@ -0,0 +1,28 @@ + + + +401.2 - Unauthorized: Access is denied due to server configuration. + + + + +
+
+

401.2 - Unauthorized: Access is denied due to server configuration.

+

You do not have permission to view this directory or page using the credentials that you supplied because your Web browser is sending a WWW-Authenticate header field that the Web server is not configured to accept.

+
+
+ + diff --git a/IISExpress/custerr/en-us/401-3.htm b/IISExpress/custerr/en-us/401-3.htm new file mode 100644 index 000000000..684813cb8 --- /dev/null +++ b/IISExpress/custerr/en-us/401-3.htm @@ -0,0 +1,28 @@ + + + +401.3 - Unauthorized: Access is denied due to an ACL set on the requested resource. + + + + +
+
+

401.3 - Unauthorized: Access is denied due to an ACL set on the requested resource.

+

You do not have permission to view this directory or page due to the access control list (ACL) that is configured for this resource on the Web server.

+
+
+ + diff --git a/IISExpress/custerr/en-us/401-4.htm b/IISExpress/custerr/en-us/401-4.htm new file mode 100644 index 000000000..b56d7e162 --- /dev/null +++ b/IISExpress/custerr/en-us/401-4.htm @@ -0,0 +1,28 @@ + + + +401.4 - Unauthorized: Authorization failed by filter installed on the Web server. + + + + +
+
+

401.4 - Unauthorized: Authorization failed by filter installed on the Web server.

+

You might not have permission to view this directory or page using the credentials that you supplied. The Web server has a filter installed to verify users connecting to the server and it failed to authenticate your credentials.

+
+
+ + diff --git a/IISExpress/custerr/en-us/401-5.htm b/IISExpress/custerr/en-us/401-5.htm new file mode 100644 index 000000000..afe88c5bb --- /dev/null +++ b/IISExpress/custerr/en-us/401-5.htm @@ -0,0 +1,28 @@ + + + +401.5 - Unauthorized: Authorization failed by an ISAPI/CGI application. + + + + +
+
+

401.5 - Unauthorized: Authorization failed by an ISAPI/CGI application.

+

The URL you attempted to reach has an ISAPI or CGI application installed that verifies user credentials before proceeding. This application cannot verify your credentials.

+
+
+ + diff --git a/IISExpress/custerr/en-us/401.htm b/IISExpress/custerr/en-us/401.htm new file mode 100644 index 000000000..e87f59dd4 --- /dev/null +++ b/IISExpress/custerr/en-us/401.htm @@ -0,0 +1,28 @@ + + + +401 - Unauthorized: Access is denied due to invalid credentials. + + + + +
+
+

401 - Unauthorized: Access is denied due to invalid credentials.

+

You do not have permission to view this directory or page using the credentials that you supplied.

+
+
+ + diff --git a/IISExpress/custerr/en-us/403-1.htm b/IISExpress/custerr/en-us/403-1.htm new file mode 100644 index 000000000..88b9dd7b0 --- /dev/null +++ b/IISExpress/custerr/en-us/403-1.htm @@ -0,0 +1,28 @@ + + + +403.1 - Forbidden: Execute access is denied. + + + + +
+
+

403.1 - Forbidden: Execute access is denied.

+

You have attempted to execute a CGI, ISAPI, or other executable program from a directory that does not allow programs to be executed.

+
+
+ + diff --git a/IISExpress/custerr/en-us/403-10.htm b/IISExpress/custerr/en-us/403-10.htm new file mode 100644 index 000000000..95e220ae8 --- /dev/null +++ b/IISExpress/custerr/en-us/403-10.htm @@ -0,0 +1,28 @@ + + + +403.10 - Forbidden: Web server is configured to deny Execute access. + + + + +
+
+

403.10 - Forbidden: Web server is configured to deny Execute access.

+

You have attempted to execute a CGI, ISAPI, or other executable program from a directory that does not allow programs to be executed.

+
+
+ + diff --git a/IISExpress/custerr/en-us/403-11.htm b/IISExpress/custerr/en-us/403-11.htm new file mode 100644 index 000000000..af7c8b4f5 --- /dev/null +++ b/IISExpress/custerr/en-us/403-11.htm @@ -0,0 +1,28 @@ + + + +403.11 - Forbidden: Password has been changed. + + + + +
+
+

403.11 - Forbidden: Password has been changed.

+

You do not have permission to view this directory or page using the credentials that you supplied.

+
+
+ + diff --git a/IISExpress/custerr/en-us/403-12.htm b/IISExpress/custerr/en-us/403-12.htm new file mode 100644 index 000000000..77bf19332 --- /dev/null +++ b/IISExpress/custerr/en-us/403-12.htm @@ -0,0 +1,28 @@ + + + +403.12 - Forbidden: Client certificate is denied access by the server certificate mapper. + + + + +
+
+

403.12 - Forbidden: Client certificate is denied access by the server certificate mapper.

+

The account to which your client certificate is mapped on the Web server has been denied access to this Web site. A Secure Sockets Layer (SSL) client certificate is used for identifying you as a valid user of the resource.

+
+
+ + diff --git a/IISExpress/custerr/en-us/403-13.htm b/IISExpress/custerr/en-us/403-13.htm new file mode 100644 index 000000000..c55b4486b --- /dev/null +++ b/IISExpress/custerr/en-us/403-13.htm @@ -0,0 +1,28 @@ + + + +403.13 - Forbidden: Client certificate has been revoked on the Web server. + + + + +
+
+

403.13 - Forbidden: Client certificate has been revoked on the Web server.

+

Your client certificate was revoked, or the revocation server could not be contacted. A Secure Sockets Layer (SSL) client certificate is used for identifying you as a valid user of the resource.

+
+
+ + diff --git a/IISExpress/custerr/en-us/403-14.htm b/IISExpress/custerr/en-us/403-14.htm new file mode 100644 index 000000000..24d755d71 --- /dev/null +++ b/IISExpress/custerr/en-us/403-14.htm @@ -0,0 +1,28 @@ + + + +403.14 - Forbidden: Directory listing denied. + + + + +
+
+

403.14 - Forbidden: Directory listing denied.

+

The Web server is configured not to display a list of the contents of this directory.

+
+
+ + diff --git a/IISExpress/custerr/en-us/403-15.htm b/IISExpress/custerr/en-us/403-15.htm new file mode 100644 index 000000000..545223aa4 --- /dev/null +++ b/IISExpress/custerr/en-us/403-15.htm @@ -0,0 +1,28 @@ + + + +403.15 - Forbidden: Client access licenses have exceeded limits on the Web server. + + + + +
+
+

403.15 - Forbidden: Client access licenses have exceeded limits on the Web server.

+

There are too many people accessing the Web site at this time. The Web server has exceeded its Client Access License limit.

+
+
+ + diff --git a/IISExpress/custerr/en-us/403-16.htm b/IISExpress/custerr/en-us/403-16.htm new file mode 100644 index 000000000..f9ba59e1e --- /dev/null +++ b/IISExpress/custerr/en-us/403-16.htm @@ -0,0 +1,28 @@ + + + +403.16 - Forbidden: Client certificate is ill-formed or is not trusted by the Web server. + + + + +
+
+

403.16 - Forbidden: Client certificate is ill-formed or is not trusted by the Web server.

+

Your client certificate is untrusted or invalid. A Secure Sockets Layer (SSL) client certificate is used for identifying you as a valid user of the resource.

+
+
+ + diff --git a/IISExpress/custerr/en-us/403-17.htm b/IISExpress/custerr/en-us/403-17.htm new file mode 100644 index 000000000..bf06f19f2 --- /dev/null +++ b/IISExpress/custerr/en-us/403-17.htm @@ -0,0 +1,28 @@ + + + +403.17 - Forbidden: Client certificate has expired or is not yet valid. + + + + +
+
+

403.17 - Forbidden: Client certificate has expired or is not yet valid.

+

Your client certificate has expired or is not yet valid. A Secure Sockets Layer (SSL) client certificate is used for identifying you as a valid user of the resource.

+
+
+ + diff --git a/IISExpress/custerr/en-us/403-18.htm b/IISExpress/custerr/en-us/403-18.htm new file mode 100644 index 000000000..5a6c66983 --- /dev/null +++ b/IISExpress/custerr/en-us/403-18.htm @@ -0,0 +1,28 @@ + + + +403.18 - Forbidden: Cannot execute requested URL in the current application pool. + + + + +
+
+

403.18 - Forbidden: Cannot execute requested URL in the current application pool.

+

The specified request cannot be executed in the application pool that is configured for this resource on the Web server.

+
+
+ + diff --git a/IISExpress/custerr/en-us/403-19.htm b/IISExpress/custerr/en-us/403-19.htm new file mode 100644 index 000000000..2bd30b282 --- /dev/null +++ b/IISExpress/custerr/en-us/403-19.htm @@ -0,0 +1,28 @@ + + + +403.19 - Forbidden: Cannot execute CGIs for the client in this application pool. + + + + +
+
+

403.19 - Forbidden: Cannot execute CGIs for the client in this application pool.

+

The configured user for this application pool does not have sufficient privileges to execute CGI applications.

+
+
+ + diff --git a/IISExpress/custerr/en-us/403-2.htm b/IISExpress/custerr/en-us/403-2.htm new file mode 100644 index 000000000..312940c29 --- /dev/null +++ b/IISExpress/custerr/en-us/403-2.htm @@ -0,0 +1,28 @@ + + + +403.2 - Forbidden: Read access is denied. + + + + +
+
+

403.2 - Forbidden: Read access is denied.

+

There is a problem with the page you are looking for and it cannot be displayed. This error can occur if you are trying to display an HTML page that resides in a directory that is configured to allow Execute or Script permissions only.

+
+
+ + diff --git a/IISExpress/custerr/en-us/403-3.htm b/IISExpress/custerr/en-us/403-3.htm new file mode 100644 index 000000000..0a5c354f6 --- /dev/null +++ b/IISExpress/custerr/en-us/403-3.htm @@ -0,0 +1,28 @@ + + + +403.3 - Forbidden: Write access is denied. + + + + +
+
+

403.3 - Forbidden: Write access is denied.

+

There is a problem saving the page to the Web site. This error can occur if you attempt to upload a file or modify a file in a directory that does not allow Write access.

+
+
+ + diff --git a/IISExpress/custerr/en-us/403-4.htm b/IISExpress/custerr/en-us/403-4.htm new file mode 100644 index 000000000..997b823b8 --- /dev/null +++ b/IISExpress/custerr/en-us/403-4.htm @@ -0,0 +1,28 @@ + + + +403.4 - Forbidden: SSL is required to view this resource. + + + + +
+
+

403.4 - Forbidden: SSL is required to view this resource.

+

The page you are trying to access is secured with Secure Sockets Layer (SSL).

+
+
+ + diff --git a/IISExpress/custerr/en-us/403-5.htm b/IISExpress/custerr/en-us/403-5.htm new file mode 100644 index 000000000..121ea5189 --- /dev/null +++ b/IISExpress/custerr/en-us/403-5.htm @@ -0,0 +1,28 @@ + + + +403.5 - Forbidden: SSL 128 is required to view this resource. + + + + +
+
+

403.5 - Forbidden: SSL 128 is required to view this resource.

+

The resource you are trying to access is secured with a 128-bit version of Secure Sockets Layer (SSL). In order to view this resource, you need a browser that supports this version of SSL.

+
+
+ + diff --git a/IISExpress/custerr/en-us/403-6.htm b/IISExpress/custerr/en-us/403-6.htm new file mode 100644 index 000000000..fd3cd5dc7 --- /dev/null +++ b/IISExpress/custerr/en-us/403-6.htm @@ -0,0 +1,28 @@ + + + +403.6 - Forbidden: IP address of the client has been rejected. + + + + +
+
+

403.6 - Forbidden: IP address of the client has been rejected.

+

The Web server you are attempting to reach has a list of IP addresses that are not allowed to access the Web site, and the IP address of your browsing computer is on this list.

+
+
+ + diff --git a/IISExpress/custerr/en-us/403-7.htm b/IISExpress/custerr/en-us/403-7.htm new file mode 100644 index 000000000..518c3b745 --- /dev/null +++ b/IISExpress/custerr/en-us/403-7.htm @@ -0,0 +1,28 @@ + + + +403.7 - Forbidden: SSL client certificate is required. + + + + +
+
+

403.7 - Forbidden: SSL client certificate is required.

+

The page you are attempting to access requires your browser to have a Secure Sockets Layer (SSL) client certificate that the Web server will recognize. The client certificate is used for identifying you as a valid user of the resource.

+
+
+ + diff --git a/IISExpress/custerr/en-us/403-8.htm b/IISExpress/custerr/en-us/403-8.htm new file mode 100644 index 000000000..92c8120df --- /dev/null +++ b/IISExpress/custerr/en-us/403-8.htm @@ -0,0 +1,28 @@ + + + +403.8 - Forbidden: DNS name of the client is rejected. + + + + +
+
+

403.8 - Forbidden: DNS name of the client is rejected.

+

The Web server you are attempting to reach has a list of DNS names that are not allowed to access this Web site, and the DNS name of your browsing computer is on this list.

+
+
+ + diff --git a/IISExpress/custerr/en-us/403-9.htm b/IISExpress/custerr/en-us/403-9.htm new file mode 100644 index 000000000..d37731c76 --- /dev/null +++ b/IISExpress/custerr/en-us/403-9.htm @@ -0,0 +1,28 @@ + + + +403.9 - Forbidden: Too many clients are trying to connect to the Web server. + + + + +
+
+

403.9 - Forbidden: Too many clients are trying to connect to the Web server.

+

The Web server is too busy to process your request at this time.

+
+
+ + diff --git a/IISExpress/custerr/en-us/403.htm b/IISExpress/custerr/en-us/403.htm new file mode 100644 index 000000000..ed6ca1016 --- /dev/null +++ b/IISExpress/custerr/en-us/403.htm @@ -0,0 +1,28 @@ + + + +403 - Forbidden: Access is denied. + + + + +
+
+

403 - Forbidden: Access is denied.

+

You do not have permission to view this directory or page using the credentials that you supplied.

+
+
+ + diff --git a/IISExpress/custerr/en-us/404-1.htm b/IISExpress/custerr/en-us/404-1.htm new file mode 100644 index 000000000..a2230e33b --- /dev/null +++ b/IISExpress/custerr/en-us/404-1.htm @@ -0,0 +1,28 @@ + + + +404.1 - File or directory not found: Web site not accessible on the requested port. + + + + +
+
+

404.1 - File or directory not found: Web site not accessible on the requested port.

+

The Web site you are trying to access has an IP address that is configured not to accept requests that specify a port number.

+
+
+ + diff --git a/IISExpress/custerr/en-us/404-10.htm b/IISExpress/custerr/en-us/404-10.htm new file mode 100644 index 000000000..f8d33bbc7 --- /dev/null +++ b/IISExpress/custerr/en-us/404-10.htm @@ -0,0 +1,28 @@ + + + +404.10 - Request header too long. + + + + +
+
+

404.10 - Request header too long.

+

One of the request headers is longer than the specified limit configured in the server.

+
+
+ + diff --git a/IISExpress/custerr/en-us/404-11.htm b/IISExpress/custerr/en-us/404-11.htm new file mode 100644 index 000000000..1b69b4ca4 --- /dev/null +++ b/IISExpress/custerr/en-us/404-11.htm @@ -0,0 +1,28 @@ + + + +404.11 - URL is double-escaped. + + + + +
+
+

404.11 - URL is double-escaped.

+

This URL is denied because it is susceptible to double-escaping attacks.

+
+
+ + diff --git a/IISExpress/custerr/en-us/404-12.htm b/IISExpress/custerr/en-us/404-12.htm new file mode 100644 index 000000000..c9f01f766 --- /dev/null +++ b/IISExpress/custerr/en-us/404-12.htm @@ -0,0 +1,28 @@ + + + +404.12 - URL has high bit characters. + + + + +
+
+

404.12 - URL has high bit characters.

+

This URL is denied because it has high-bit characters.

+
+
+ + diff --git a/IISExpress/custerr/en-us/404-13.htm b/IISExpress/custerr/en-us/404-13.htm new file mode 100644 index 000000000..60c9ca625 --- /dev/null +++ b/IISExpress/custerr/en-us/404-13.htm @@ -0,0 +1,28 @@ + + + +404.13 - Content-Length too large. + + + + +
+
+

404.13 - Content-Length too large.

+

This URL is denied because the Content-Length set is longer than specified by configuration.

+
+
+ + diff --git a/IISExpress/custerr/en-us/404-14.htm b/IISExpress/custerr/en-us/404-14.htm new file mode 100644 index 000000000..303bf4160 --- /dev/null +++ b/IISExpress/custerr/en-us/404-14.htm @@ -0,0 +1,28 @@ + + + +404.14 - URL too long. + + + + +
+
+

404.14 - URL too long.

+

This URL is denied because its length is longer than specified by configuration.

+
+
+ + diff --git a/IISExpress/custerr/en-us/404-15.htm b/IISExpress/custerr/en-us/404-15.htm new file mode 100644 index 000000000..6e7bc3a30 --- /dev/null +++ b/IISExpress/custerr/en-us/404-15.htm @@ -0,0 +1,28 @@ + + + +404.15 - Query-String too long. + + + + +
+
+

404.15 - Query-String too long.

+

This URL is denied because its Query-String is longer than specified by configuration.

+
+
+ + diff --git a/IISExpress/custerr/en-us/404-2.htm b/IISExpress/custerr/en-us/404-2.htm new file mode 100644 index 000000000..c268b50d4 --- /dev/null +++ b/IISExpress/custerr/en-us/404-2.htm @@ -0,0 +1,28 @@ + + + +404.2 - File or directory not found: Lockdown policy prevents this request. + + + + +
+
+

404.2 - File or directory not found: Lockdown policy prevents this request.

+

The page you are requesting cannot be served due to the Web service extensions that are configured on the Web server.

+
+
+ + diff --git a/IISExpress/custerr/en-us/404-3.htm b/IISExpress/custerr/en-us/404-3.htm new file mode 100644 index 000000000..b15df9a75 --- /dev/null +++ b/IISExpress/custerr/en-us/404-3.htm @@ -0,0 +1,28 @@ + + + +404.3 - File or directory not found: MIME map policy prevents this request. + + + + +
+
+

404.3 - File or directory not found: MIME map policy prevents this request.

+

The page you are requesting cannot be served due to the Multipurpose Internet Mail Extensions (MIME) map policy that is configured on the Web server. The page you requested has a file name extension that is not recognised, and is therefore not allowed.

+
+
+ + diff --git a/IISExpress/custerr/en-us/404-4.htm b/IISExpress/custerr/en-us/404-4.htm new file mode 100644 index 000000000..903e48a94 --- /dev/null +++ b/IISExpress/custerr/en-us/404-4.htm @@ -0,0 +1,28 @@ + + + +404.4 - File or directory not found: No module handler is registered to handle the request. + + + + +
+
+

404.4 - File or directory not found: No module handler is registered to handle the request.

+

The resource you are looking for does not have a module or handler associated with it. It cannot be handled and served.

+
+
+ + diff --git a/IISExpress/custerr/en-us/404-5.htm b/IISExpress/custerr/en-us/404-5.htm new file mode 100644 index 000000000..5d24abe0f --- /dev/null +++ b/IISExpress/custerr/en-us/404-5.htm @@ -0,0 +1,28 @@ + + + +404.5 - URL sequence denied. + + + + +
+
+

404.5 - URL sequence denied.

+

The specified URL sequence is not accepted by the server.

+
+
+ + diff --git a/IISExpress/custerr/en-us/404-6.htm b/IISExpress/custerr/en-us/404-6.htm new file mode 100644 index 000000000..c445a6758 --- /dev/null +++ b/IISExpress/custerr/en-us/404-6.htm @@ -0,0 +1,28 @@ + + + +404.6 - HTTP verb denied. + + + + +
+
+

404.6 - HTTP verb denied.

+

The specified HTTP verb is not accepted by the server.

+
+
+ + diff --git a/IISExpress/custerr/en-us/404-7.htm b/IISExpress/custerr/en-us/404-7.htm new file mode 100644 index 000000000..48090e9a4 --- /dev/null +++ b/IISExpress/custerr/en-us/404-7.htm @@ -0,0 +1,28 @@ + + + +404.7 - File extension denied. + + + + +
+
+

404.7 - File extension denied.

+

The specified file extension of the resource is not accepted by the server.

+
+
+ + diff --git a/IISExpress/custerr/en-us/404-8.htm b/IISExpress/custerr/en-us/404-8.htm new file mode 100644 index 000000000..5f2768981 --- /dev/null +++ b/IISExpress/custerr/en-us/404-8.htm @@ -0,0 +1,28 @@ + + + +404.8 - URL namespace hidden. + + + + +
+
+

404.8 - URL namespace hidden.

+

The namespace of the specified URL is hidden by configuration.

+
+
+ + diff --git a/IISExpress/custerr/en-us/404-9.htm b/IISExpress/custerr/en-us/404-9.htm new file mode 100644 index 000000000..b35c826db --- /dev/null +++ b/IISExpress/custerr/en-us/404-9.htm @@ -0,0 +1,28 @@ + + + +404.9 - File attribute hidden. + + + + +
+
+

404.9 - File attribute hidden.

+

The requested file has a hidden attribute which prevents it from being served.

+
+
+ + diff --git a/IISExpress/custerr/en-us/404.htm b/IISExpress/custerr/en-us/404.htm new file mode 100644 index 000000000..1fb6ad477 --- /dev/null +++ b/IISExpress/custerr/en-us/404.htm @@ -0,0 +1,28 @@ + + + +404 - File or directory not found. + + + + +
+
+

404 - File or directory not found.

+

The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.

+
+
+ + diff --git a/IISExpress/custerr/en-us/405.htm b/IISExpress/custerr/en-us/405.htm new file mode 100644 index 000000000..e63d73545 --- /dev/null +++ b/IISExpress/custerr/en-us/405.htm @@ -0,0 +1,28 @@ + + + +405 - HTTP verb used to access this page is not allowed. + + + + +
+
+

405 - HTTP verb used to access this page is not allowed.

+

The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access.

+
+
+ + diff --git a/IISExpress/custerr/en-us/406.htm b/IISExpress/custerr/en-us/406.htm new file mode 100644 index 000000000..241b60dea --- /dev/null +++ b/IISExpress/custerr/en-us/406.htm @@ -0,0 +1,28 @@ + + + +406 - Client browser does not accept the MIME type of the requested page. + + + + +
+
+

406 - Client browser does not accept the MIME type of the requested page.

+

The page you are looking for cannot be opened by your browser because it has a file name extension that your browser does not accept.

+
+
+ + diff --git a/IISExpress/custerr/en-us/412.htm b/IISExpress/custerr/en-us/412.htm new file mode 100644 index 000000000..b464210a8 --- /dev/null +++ b/IISExpress/custerr/en-us/412.htm @@ -0,0 +1,28 @@ + + + +412 - Precondition set by the client failed when evaluated on the Web server. + + + + +
+
+

412 - Precondition set by the client failed when evaluated on the Web server.

+

The request was not completed due to preconditions that are set in the request header. Preconditions prevent the requested method from being applied to a resource other than the one intended. An example of a precondition is testing for expired content in the page cache of the client.

+
+
+ + diff --git a/IISExpress/custerr/en-us/500-13.htm b/IISExpress/custerr/en-us/500-13.htm new file mode 100644 index 000000000..ae5567cd9 --- /dev/null +++ b/IISExpress/custerr/en-us/500-13.htm @@ -0,0 +1,28 @@ + + + +500.13 - Server error: Web server is too busy. + + + + +
+
+

500.13 - Server error: Web server is too busy.

+

The request cannot be processed at this time. The amount of traffic exceeds the Web site's configured capacity.

+
+
+ + diff --git a/IISExpress/custerr/en-us/500-14.htm b/IISExpress/custerr/en-us/500-14.htm new file mode 100644 index 000000000..b33d29415 --- /dev/null +++ b/IISExpress/custerr/en-us/500-14.htm @@ -0,0 +1,28 @@ + + + +500.14 - Server error: Invalid application configuration on the server. + + + + +
+
+

500.14 - Server error: Invalid application configuration on the server.

+

The request cannot be processed due to application configuration errors on the Web server.

+
+
+ + diff --git a/IISExpress/custerr/en-us/500-15.htm b/IISExpress/custerr/en-us/500-15.htm new file mode 100644 index 000000000..cbe9c4c30 --- /dev/null +++ b/IISExpress/custerr/en-us/500-15.htm @@ -0,0 +1,28 @@ + + + +500.15 - Server error: Direct requests for GLOBAL.ASA are not allowed. + + + + +
+
+

500.15 - Server error: Direct requests for GLOBAL.ASA are not allowed.

+

GLOBAL.ASA is a special file that cannot be accessed directly by your browser.

+
+
+ + diff --git a/IISExpress/custerr/en-us/500-16.htm b/IISExpress/custerr/en-us/500-16.htm new file mode 100644 index 000000000..fb3030b9c --- /dev/null +++ b/IISExpress/custerr/en-us/500-16.htm @@ -0,0 +1,28 @@ + + + +500.16 - Server error: UNC authorization credentials incorrect. + + + + +
+
+

500.16 - Server error: UNC authorization credentials incorrect.

+

The page you are requesting cannot be accessed due to UNC authorization settings that are configured incorrectly on the Web server.

+
+
+ + diff --git a/IISExpress/custerr/en-us/500-17.htm b/IISExpress/custerr/en-us/500-17.htm new file mode 100644 index 000000000..5f40148fa --- /dev/null +++ b/IISExpress/custerr/en-us/500-17.htm @@ -0,0 +1,28 @@ + + + +500.17 - Server error: URL authorization store cannot be found. + + + + +
+
+

500.17 - Server error: URL authorization store cannot be found.

+

The URL Authorization store for the page you requested cannot be found on the Web server, therefore your credentials cannot be verified.

+
+
+ + diff --git a/IISExpress/custerr/en-us/500-18.htm b/IISExpress/custerr/en-us/500-18.htm new file mode 100644 index 000000000..c2941a620 --- /dev/null +++ b/IISExpress/custerr/en-us/500-18.htm @@ -0,0 +1,28 @@ + + + +500.18 - Server error: URL authorization store cannot be opened. + + + + +
+
+

500.18 - Server error: URL authorization store cannot be opened.

+

The URL Authorization store for the page you requested cannot be opened on the Web server, therefore your credentials cannot be verified.

+
+
+ + diff --git a/IISExpress/custerr/en-us/500-19.htm b/IISExpress/custerr/en-us/500-19.htm new file mode 100644 index 000000000..9b44494ec --- /dev/null +++ b/IISExpress/custerr/en-us/500-19.htm @@ -0,0 +1,28 @@ + + + +500.19 - Server error: Data for this file is configured improperly. + + + + +
+
+

500.19 - Server error: Data for this file is configured improperly.

+

The requested page cannot be accessed because of a configuration error.

+
+
+ + diff --git a/IISExpress/custerr/en-us/500.htm b/IISExpress/custerr/en-us/500.htm new file mode 100644 index 000000000..072a2601b --- /dev/null +++ b/IISExpress/custerr/en-us/500.htm @@ -0,0 +1,28 @@ + + + +500 - Internal server error. + + + + +
+
+

500 - Internal server error.

+

There is a problem with the resource you are looking for, and it cannot be displayed.

+
+
+ + diff --git a/IISExpress/custerr/en-us/501.htm b/IISExpress/custerr/en-us/501.htm new file mode 100644 index 000000000..873cb9f21 --- /dev/null +++ b/IISExpress/custerr/en-us/501.htm @@ -0,0 +1,28 @@ + + + +501 - Header values specify a method that is not implemented. + + + + +
+
+

501 - Header values specify a method that is not implemented.

+

The page you are looking for cannot be displayed because a header value in the request does not match certain configuration settings on the Web server. For example, a request header might specify a POST to a static file that cannot be posted to, or specify a Transfer-Encoding value that cannot make use of compression.

+
+
+ + diff --git a/IISExpress/defdoc.dll b/IISExpress/defdoc.dll new file mode 100644 index 000000000..352e95f11 Binary files /dev/null and b/IISExpress/defdoc.dll differ diff --git a/IISExpress/detoured.dll b/IISExpress/detoured.dll new file mode 100644 index 000000000..bfb5db85b Binary files /dev/null and b/IISExpress/detoured.dll differ diff --git a/IISExpress/dirlist.dll b/IISExpress/dirlist.dll new file mode 100644 index 000000000..fd91ac7ad Binary files /dev/null and b/IISExpress/dirlist.dll differ diff --git a/IISExpress/filter.dll b/IISExpress/filter.dll new file mode 100644 index 000000000..cfb330892 Binary files /dev/null and b/IISExpress/filter.dll differ diff --git a/IISExpress/gzip.dll b/IISExpress/gzip.dll new file mode 100644 index 000000000..4d8bb69ec Binary files /dev/null and b/IISExpress/gzip.dll differ diff --git a/IISExpress/helperprocess.dll b/IISExpress/helperprocess.dll new file mode 100644 index 000000000..9a347f9fe Binary files /dev/null and b/IISExpress/helperprocess.dll differ diff --git a/IISExpress/helperprocess.dll.clrhost.config b/IISExpress/helperprocess.dll.clrhost.config new file mode 100644 index 000000000..f8aa76ef9 --- /dev/null +++ b/IISExpress/helperprocess.dll.clrhost.config @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + diff --git a/IISExpress/helperprocess.dll.clrhost.config.template b/IISExpress/helperprocess.dll.clrhost.config.template new file mode 100644 index 000000000..264776aec --- /dev/null +++ b/IISExpress/helperprocess.dll.clrhost.config.template @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IISExpress/hwebcore.dll b/IISExpress/hwebcore.dll new file mode 100644 index 000000000..04e0d6bc8 Binary files /dev/null and b/IISExpress/hwebcore.dll differ diff --git a/IISExpress/iisRtl.dll b/IISExpress/iisRtl.dll new file mode 100644 index 000000000..f57c2d538 Binary files /dev/null and b/IISExpress/iisRtl.dll differ diff --git a/IISExpress/iis_ssi.dll b/IISExpress/iis_ssi.dll new file mode 100644 index 000000000..8d12f289f Binary files /dev/null and b/IISExpress/iis_ssi.dll differ diff --git a/IISExpress/iiscore.dll b/IISExpress/iiscore.dll new file mode 100644 index 000000000..b69c38a4a Binary files /dev/null and b/IISExpress/iiscore.dll differ diff --git a/IISExpress/iisexpress.exe b/IISExpress/iisexpress.exe new file mode 100644 index 000000000..aa0515147 Binary files /dev/null and b/IISExpress/iisexpress.exe differ diff --git a/IISExpress/iisexpress.exe.manifest b/IISExpress/iisexpress.exe.manifest new file mode 100644 index 000000000..5b6c5c763 --- /dev/null +++ b/IISExpress/iisexpress.exe.manifest @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/IISExpress/iisexpresshelper.dll b/IISExpress/iisexpresshelper.dll new file mode 100644 index 000000000..a2981f0bc Binary files /dev/null and b/IISExpress/iisexpresshelper.dll differ diff --git a/IISExpress/iisexpresstray.exe.config b/IISExpress/iisexpresstray.exe.config new file mode 100644 index 000000000..3f608d679 --- /dev/null +++ b/IISExpress/iisexpresstray.exe.config @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + diff --git a/IISExpress/iisexpresstray.exe.manifest b/IISExpress/iisexpresstray.exe.manifest new file mode 100644 index 000000000..6891487c2 --- /dev/null +++ b/IISExpress/iisexpresstray.exe.manifest @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/IISExpress/iisfcgi.dll b/IISExpress/iisfcgi.dll new file mode 100644 index 000000000..02167433b Binary files /dev/null and b/IISExpress/iisfcgi.dll differ diff --git a/IISExpress/iisfreb.dll b/IISExpress/iisfreb.dll new file mode 100644 index 000000000..eb0a7495d Binary files /dev/null and b/IISExpress/iisfreb.dll differ diff --git a/IISExpress/iisreqs.dll b/IISExpress/iisreqs.dll new file mode 100644 index 000000000..f8f76dd4a Binary files /dev/null and b/IISExpress/iisreqs.dll differ diff --git a/IISExpress/iisres.dll b/IISExpress/iisres.dll new file mode 100644 index 000000000..802b68790 Binary files /dev/null and b/IISExpress/iisres.dll differ diff --git a/IISExpress/iisutil2.dll b/IISExpress/iisutil2.dll new file mode 100644 index 000000000..36ad364a9 Binary files /dev/null and b/IISExpress/iisutil2.dll differ diff --git a/IISExpress/iisvermg.dll b/IISExpress/iisvermg.dll new file mode 100644 index 000000000..53839b092 Binary files /dev/null and b/IISExpress/iisvermg.dll differ diff --git a/IISExpress/iprestr.dll b/IISExpress/iprestr.dll new file mode 100644 index 000000000..770e2b536 Binary files /dev/null and b/IISExpress/iprestr.dll differ diff --git a/IISExpress/isapi.dll b/IISExpress/isapi.dll new file mode 100644 index 000000000..22d09a7d9 Binary files /dev/null and b/IISExpress/isapi.dll differ diff --git a/IISExpress/license.rtf b/IISExpress/license.rtf new file mode 100644 index 000000000..c24ecd8a7 --- /dev/null +++ b/IISExpress/license.rtf @@ -0,0 +1,52 @@ +{\rtf1\ansi\ansicpg1252\deff0\deflang1033\deflangfe1033{\fonttbl{\f0\fswiss\fprq2\fcharset0 Tahoma;}{\f1\froman\fprq2\fcharset0 Times New Roman;}{\f2\froman\fprq2\fcharset2 Symbol;}} +{\colortbl ;\red0\green0\blue255;} +{\stylesheet{ Normal;}{\s1 heading 1;}{\s2 heading 2;}} +{\*\generator Msftedit 5.41.21.2509;}\viewkind4\uc1\pard\nowidctlpar\sb120\sa120\b\f0\fs20 MICROSOFT PRE-RELEASE SOFTWARE LICENSE TERMS\par +\pard\brdrb\brdrs\brdrw10\brsp20 \nowidctlpar\sb120\sa120 MICROSOFT WEBMATRIX \endash BETA 2\f1\par +\pard\nowidctlpar\sb120\sa120\b0\f0 These license terms are an agreement between Microsoft Corporation (or based on where you live, one of its affiliates) and you. Please read them. They apply to the pre-release software named above, which includes the media on which you received it, if any. The terms also apply to any Microsoft\par +\pard\nowidctlpar\fi-360\li360\sb120\sa120\tx360\f2\'b7\tab\f0 updates,\par +\pard\nowidctlpar\fi-360\li360\sb120\sa120\f2\'b7\tab\f0 supplements,\par +\f2\'b7\tab\f0 Internet-based services, and \par +\f2\'b7\tab\f0 support services\par +\pard\nowidctlpar\sb120\sa120 for this software, unless other terms accompany those items. If so, those terms apply.\par +\b By using the software, you accept these terms. If you do not accept them, do not use the software.\par +\pard\brdrt\brdrs\brdrw10\brsp20 \nowidctlpar\sb120\sa120 If you comply with these license terms, you have the rights below.\par +\pard\nowidctlpar\s1\fi-357\li357\sb120\sa120\tx9720 1.\tab INSTALLATION AND USE RIGHTS. \par +\pard\nowidctlpar\fi-357\li720\sb120\sa120\tx720\b0\f2\'b7\tab\f0 You may install and use any number of copies of the software on your premises to design, develop and test your programs for use with the software. \par +\pard\fi-360\li720\sb120\sa120\tx720\f2\fs19\'b7\tab\ul\f0 Templates\ulnone\f1 .\~\f0 The software contains templates in the Template file as described in the software documentation. You may copy and modify these templates.\f1\par +\pard\fi-360\li720\sb120\sa120\f2\'b7\tab\f0 You may not test the software in a live operating environment unless Microsoft permits you to do so under another agreement.\f1\par +\pard\nowidctlpar\s1\fi-357\li357\sb120\sa120\tx9720\b\f0\fs20 2.\tab TERM.\b0 The term of this agreement is until December 31, 201\f1 0\f0 , or commercial release of the software, whichever is first.\b\f1\par +\pard\nowidctlpar\s1\fi-357\li357\sb120\sa120\f0 3.\tab PRE-RELEASE SOFTWARE. \b0 This software is a pre-release version. It may not work the way a final version of the software will. We may change it for the final, commercial version. We also may not release a commercial version.\fs19 \b\f1\fs20\par +\f0 4.\tab FEEDBACK. \b0 If you give feedback about the software to Microsoft, you give to Microsoft, without charge, the right to use, share and commercialize your feedback in any way and for any purpose. You also give to third parties, without charge, any patent rights needed for their products, technologies and services to use or interface with any specific parts of a Microsoft software or service that includes the feedback. You will not give feedback that is subject to a license that requires Microsoft to license its software or documentation to third parties because we include your feedback in them. These rights survive this agreement.\b\f1\par +\caps\f0 5.\tab Scope of License\caps0\f1 .\b0\f0 The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. Unless applicable law gives you more rights despite this limitation, you may use the software only as expressly permitted in this agreement. In doing so, you must comply with any technical limitations in the software that only allow you to use it in certain ways. You may not\b\f1\par +\pard\nowidctlpar\fi-363\li720\sb120\sa120\tx720\b0\f2\'b7\tab\f0 disclose the results of any benchmark tests of the software to any third party without Microsoft\rquote s prior written approval\fs19 ;\f1\fs20\par +\pard\nowidctlpar\fi-363\li720\sb120\sa120\f2\'b7\tab\f0 work around any technical limitations in the software\fs19 ;\f1\fs20\par +\f2\'b7\tab\f0 reverse engineer, decompile or disassemble the software, except and only to the extent that applicable law expressly permits, despite this limitation\fs19 ;\f1\fs20\par +\f2\'b7\tab\f0 publish the software for others to copy\fs19 ;\f1\fs20\par +\f2\'b7\tab\f0 rent, lease or lend the software\fs19 ;\f1\fs20\par +\f2\'b7\tab\f0 transfer the software or this agreement to any third party\fs19 ; or\f1\fs20\par +\f2\'b7\tab\f0 use the software for commercial software hosting services\f1\fs19 .\fs20\par +\pard\nowidctlpar\s1\fi-357\li357\sb120\sa120\tx9720\b\caps\f0 6.\tab Export Restrictions\caps0\f1 .\b0\f0 The software is subject to United States export laws and regulations. You must comply with all domestic and international export laws and regulations that apply to the software. These laws include restrictions on destinations, end users and end use. For additional information, see \cf1\ul{\field{\*\fldinst{HYPERLINK "www.microsoft.com/exporting"}}{\fldrslt{\ul\cf1 www.microsoft.com/exporting}}}\cf0\ulnone\f1\fs20 .\cf1\ul\b\par +\pard\nowidctlpar\s1\fi-357\li357\sb120\sa120\cf0\ulnone\caps\f0 7.\tab SUPPORT SERVICES.\caps0 \b0 Because this software is \ldblquote as is,\rdblquote we may not provide support services for it.\b\f1\par +\caps\f0 8.\tab Entire Agreement.\b0\caps0 This agreement, and the terms for supplements, updates, Internet-based services and support services that you use, are the entire agreement for the software and support services.\par +\pard\nowidctlpar\s1\fi-360\li360\sb120\sa120\tx9720\b\caps 9.\tab Applicable Law\caps0\f1 .\par +\pard\nowidctlpar\s2\fi-363\li720\sb120\sa120\tx720\f0 a.\tab United States.\b0 If you acquired the software in the United States, Washington state law governs the interpretation of this agreement and applies to claims for breach of it, regardless of conflict of laws principles. The laws of the state where you live govern all other claims, including claims under state consumer protection laws, unfair competition laws, and in tort.\b\f1\par +\pard\nowidctlpar\s2\fi-363\li720\sb120\sa120\f0 b.\tab Outside the United States.\b0 If you acquired the software in any other country, the laws of that country apply.\b\f1\par +\pard\nowidctlpar\s1\fi-357\li357\sb120\sa120\tx9720\caps\f0 10.\tab Legal Effect.\b0\caps0 This agreement describes certain legal rights. You may have other rights under the laws of your country. You may also have rights with respect to the party from whom you acquired the software. This agreement does not change your rights under the laws of your country if the laws of your country do not permit it to do so.\b\caps\f1\par +\pard\nowidctlpar\s1\fi-357\li357\sb120\sa120\f0 11.\tab Disclaimer of Warranty.\caps0 The software is licensed \ldblquote as-is.\rdblquote You bear the risk of using it. Microsoft gives no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this agreement cannot change. To the extent permitted under your local laws, Microsoft excludes the implied warranties of merchantability, fitness for a particular purpose and non-infringement.\caps\f1\par +\pard\nowidctlpar\s1\fi-360\li360\sb120\sa120\tx9720\f0 12.\tab Limitation on and Exclusion of Remedies and Damages. \caps0 You can recover from Microsoft and its suppliers only direct damages up to U.S. $5.00. You cannot recover any other damages, including consequential, lost profits, special, indirect or incidental damages.\caps\f1\par +\pard\nowidctlpar\li357\sb120\sa120\b0\caps0\f0 This limitation applies to\par +\pard\nowidctlpar\fi-363\li720\sb120\sa120\tx720\f2\'b7\tab\f0 anything related to the software, services, content (including code) on third party Internet sites, or third party programs; and\par +\pard\nowidctlpar\fi-363\li720\sb120\sa120\f2\'b7\tab\f0 claims for breach of contract, breach of warranty, guarantee or condition, strict liability, negligence, or other tort to the extent permitted by applicable law.\par +\pard\nowidctlpar\li360\sb120\sa120 It also applies even if Microsoft knew or should have known about the possibility of the damages. The above limitation or exclusion may not apply to you because your country may not allow the exclusion or limitation of incidental, consequential or other damages.\par +\pard\nowidctlpar\sb120\sa120\b Please note: As this software is distributed in Quebec, Canada, some of the clauses in this agreement are provided below in French.\par +Remarque : Ce logiciel \'e9tant distribu\'e9 au Qu\'e9bec, Canada, certaines des clauses dans ce contrat sont fournies ci-dessous en fran\'e7ais.\par +EXON\'c9RATION DE GARANTIE.\b0 Le logiciel vis\'e9 par une licence est offert \'ab tel quel \'bb. Toute utilisation de ce logiciel est \'e0 votre seule risque et p\'e9ril. Microsoft n\rquote accorde aucune autre garantie expresse. Vous pouvez b\'e9n\'e9ficier de droits additionnels en vertu du droit local sur la protection des consommateurs, que ce contrat ne peut modifier. La ou elles sont permises par le droit locale, les garanties implicites de qualit\'e9 marchande, d\rquote ad\'e9quation \'e0 un usage particulier et d\rquote absence de contrefa\'e7on sont exclues.\par +\b LIMITATION DES DOMMAGES-INT\'c9R\'caTS ET EXCLUSION DE RESPONSABILIT\'c9 POUR LES DOMMAGES.\b0 Vous pouvez obtenir de Microsoft et de ses fournisseurs une indemnisation en cas de dommages directs uniquement \'e0 hauteur de 5,00 $ US. Vous ne pouvez pr\'e9tendre \'e0 aucune indemnisation pour les autres dommages, y compris les dommages sp\'e9ciaux, indirects ou accessoires et pertes de b\'e9n\'e9fices.\par +Cette limitation concerne :\par +\pard\nowidctlpar\fi-360\li360\sb120\sa120\tx360\f2\'b7\tab\f0 tout ce qui est reli\'e9 au logiciel, aux services ou au contenu (y compris le code) figurant sur des sites Internet tiers ou dans des programmes tiers ; et\par +\pard\nowidctlpar\fi-360\li360\sb120\sa120\f2\'b7\tab\f0 les r\'e9clamations au titre de violation de contrat ou de garantie, ou au titre de responsabilit\'e9 stricte, de n\'e9gligence ou d\rquote une autre faute dans la limite autoris\'e9e par la loi en vigueur.\par +\pard\nowidctlpar\sb120\sa120 Elle s\rquote applique \'e9galement, m\'eame si Microsoft connaissait ou devrait conna\'eetre l\rquote\'e9ventualit\'e9 d\rquote un tel dommage. Si votre pays n\rquote autorise pas l\rquote exclusion ou la limitation de responsabilit\'e9 pour les dommages indirects, accessoires ou de quelque nature que ce soit, il se peut que la limitation ou l\rquote exclusion ci-dessus ne s\rquote appliquera pas \'e0 votre \'e9gard.\par +\pard\sb120\sa120\b EFFET JURIDIQUE.\b0 Le pr\'e9sent contrat d\'e9crit certains droits juridiques. Vous pourriez avoir d\rquote autres droits pr\'e9vus par les lois de votre pays. \lang1036 Le pr\'e9sent contrat ne modifie pas les droits que vous conf\'e8rent les lois de votre pays si celles-ci ne le permettent pas.\lang1033\f1\fs19\par +} + \ No newline at end of file diff --git a/IISExpress/logcust.dll b/IISExpress/logcust.dll new file mode 100644 index 000000000..e1ad32af3 Binary files /dev/null and b/IISExpress/logcust.dll differ diff --git a/IISExpress/loghttp.dll b/IISExpress/loghttp.dll new file mode 100644 index 000000000..680835347 Binary files /dev/null and b/IISExpress/loghttp.dll differ diff --git a/IISExpress/modrqflt.dll b/IISExpress/modrqflt.dll new file mode 100644 index 000000000..47e3debfa Binary files /dev/null and b/IISExpress/modrqflt.dll differ diff --git a/IISExpress/nativrd2.dll b/IISExpress/nativrd2.dll new file mode 100644 index 000000000..386ee8c97 Binary files /dev/null and b/IISExpress/nativrd2.dll differ diff --git a/IISExpress/protsup.dll b/IISExpress/protsup.dll new file mode 100644 index 000000000..581bedc36 Binary files /dev/null and b/IISExpress/protsup.dll differ diff --git a/IISExpress/redirect.dll b/IISExpress/redirect.dll new file mode 100644 index 000000000..58d4dcec2 Binary files /dev/null and b/IISExpress/redirect.dll differ diff --git a/IISExpress/rewrite.dll b/IISExpress/rewrite.dll new file mode 100644 index 000000000..af2581b36 Binary files /dev/null and b/IISExpress/rewrite.dll differ diff --git a/IISExpress/rsca2.dll b/IISExpress/rsca2.dll new file mode 100644 index 000000000..876fb8f08 Binary files /dev/null and b/IISExpress/rsca2.dll differ diff --git a/IISExpress/rscaext.dll b/IISExpress/rscaext.dll new file mode 100644 index 000000000..ba3bfd2f1 Binary files /dev/null and b/IISExpress/rscaext.dll differ diff --git a/IISExpress/rtinfo.dll b/IISExpress/rtinfo.dll new file mode 100644 index 000000000..f831a7b9f Binary files /dev/null and b/IISExpress/rtinfo.dll differ diff --git a/IISExpress/static.dll b/IISExpress/static.dll new file mode 100644 index 000000000..3611881af Binary files /dev/null and b/IISExpress/static.dll differ diff --git a/IISExpress/urlauthz.dll b/IISExpress/urlauthz.dll new file mode 100644 index 000000000..0a649eb50 Binary files /dev/null and b/IISExpress/urlauthz.dll differ diff --git a/IISExpress/validcfg.dll b/IISExpress/validcfg.dll new file mode 100644 index 000000000..19c54cefd Binary files /dev/null and b/IISExpress/validcfg.dll differ diff --git a/IISExpress/w3dt.dll b/IISExpress/w3dt.dll new file mode 100644 index 000000000..1faa48177 Binary files /dev/null and b/IISExpress/w3dt.dll differ diff --git a/IISExpress/w3tp.dll b/IISExpress/w3tp.dll new file mode 100644 index 000000000..438a18b88 Binary files /dev/null and b/IISExpress/w3tp.dll differ diff --git a/IISExpress/w3wphost.dll b/IISExpress/w3wphost.dll new file mode 100644 index 000000000..e2cdfad00 Binary files /dev/null and b/IISExpress/w3wphost.dll differ diff --git a/IISExpress/wbhst_pm.dll b/IISExpress/wbhst_pm.dll new file mode 100644 index 000000000..f196656f7 Binary files /dev/null and b/IISExpress/wbhst_pm.dll differ diff --git a/IISExpress/webdav.dll b/IISExpress/webdav.dll new file mode 100644 index 000000000..0dd745df4 Binary files /dev/null and b/IISExpress/webdav.dll differ diff --git a/IISExpress/webdav_simple_lock.dll b/IISExpress/webdav_simple_lock.dll new file mode 100644 index 000000000..cbff8eb4b Binary files /dev/null and b/IISExpress/webdav_simple_lock.dll differ diff --git a/IISExpress/webdav_simple_prop.dll b/IISExpress/webdav_simple_prop.dll new file mode 100644 index 000000000..5a1c735f7 Binary files /dev/null and b/IISExpress/webdav_simple_prop.dll differ diff --git a/IISExpress/webmatrixsup.dll b/IISExpress/webmatrixsup.dll new file mode 100644 index 000000000..416d2cfb7 Binary files /dev/null and b/IISExpress/webmatrixsup.dll differ diff --git a/NzbDrone.Core/NzbDrone.Core.csproj b/NzbDrone.Core/NzbDrone.Core.csproj index 3c4332dc5..f4505ffa4 100644 --- a/NzbDrone.Core/NzbDrone.Core.csproj +++ b/NzbDrone.Core/NzbDrone.Core.csproj @@ -217,7 +217,6 @@ - diff --git a/NzbDrone.Web/NzbDrone.Web.Publish.xml b/NzbDrone.Web/NzbDrone.Web.Publish.xml new file mode 100644 index 000000000..8e47c9855 --- /dev/null +++ b/NzbDrone.Web/NzbDrone.Web.Publish.xml @@ -0,0 +1,165 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/NzbDrone.Web/NzbDrone.Web.csproj b/NzbDrone.Web/NzbDrone.Web.csproj index 6eb2a83b1..3cb0eae85 100644 --- a/NzbDrone.Web/NzbDrone.Web.csproj +++ b/NzbDrone.Web/NzbDrone.Web.csproj @@ -20,11 +20,12 @@ true full false - bin\ + Bin\ DEBUG;TRACE prompt 4 x86 + false pdbonly diff --git a/NzbDrone.sln b/NzbDrone.sln index 05f06c819..def44a117 100644 --- a/NzbDrone.sln +++ b/NzbDrone.sln @@ -13,8 +13,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NzbDrone", "NzbDrone\NzbDro EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{57A04B72-8088-4F75-A582-1158CF8291F7}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CassiniDev.Lib4", "CassiniDev\CassiniDev.Lib4.csproj", "{070AE36D-4CE1-4708-BD0F-2896A6F117FC}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -91,18 +89,6 @@ Global {D12F7F2F-8A3C-415F-88FA-6DD061A84869}.Release|x64.ActiveCfg = Release|x86 {D12F7F2F-8A3C-415F-88FA-6DD061A84869}.Release|x86.ActiveCfg = Release|x86 {D12F7F2F-8A3C-415F-88FA-6DD061A84869}.Release|x86.Build.0 = Release|x86 - {070AE36D-4CE1-4708-BD0F-2896A6F117FC}.Debug|Any CPU.ActiveCfg = Debug|x86 - {070AE36D-4CE1-4708-BD0F-2896A6F117FC}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {070AE36D-4CE1-4708-BD0F-2896A6F117FC}.Debug|Mixed Platforms.Build.0 = Debug|x86 - {070AE36D-4CE1-4708-BD0F-2896A6F117FC}.Debug|x64.ActiveCfg = Debug|x86 - {070AE36D-4CE1-4708-BD0F-2896A6F117FC}.Debug|x86.ActiveCfg = Debug|x86 - {070AE36D-4CE1-4708-BD0F-2896A6F117FC}.Debug|x86.Build.0 = Debug|x86 - {070AE36D-4CE1-4708-BD0F-2896A6F117FC}.Release|Any CPU.ActiveCfg = Release|x86 - {070AE36D-4CE1-4708-BD0F-2896A6F117FC}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {070AE36D-4CE1-4708-BD0F-2896A6F117FC}.Release|Mixed Platforms.Build.0 = Release|x86 - {070AE36D-4CE1-4708-BD0F-2896A6F117FC}.Release|x64.ActiveCfg = Release|x86 - {070AE36D-4CE1-4708-BD0F-2896A6F117FC}.Release|x86.ActiveCfg = Release|x86 - {070AE36D-4CE1-4708-BD0F-2896A6F117FC}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/NzbDrone/NzbDrone.csproj b/NzbDrone/NzbDrone.csproj index c9e4f5635..c52ec3931 100644 --- a/NzbDrone/NzbDrone.csproj +++ b/NzbDrone/NzbDrone.csproj @@ -49,20 +49,6 @@ - - - {070AE36D-4CE1-4708-BD0F-2896A6F117FC} - CassiniDev.Lib4 - - - {43BD3BBD-1531-4D8F-9C08-E1CD544AB2CD} - NzbDrone.Web - - - {FF5EE3B6-913B-47CE-9CEB-11C51B4E1205} - NzbDrone.Core - - diff --git a/NzbDrone/Program.cs b/NzbDrone/Program.cs index 427fe4a90..7bd612209 100644 --- a/NzbDrone/Program.cs +++ b/NzbDrone/Program.cs @@ -1,25 +1,177 @@ -using NLog; -using NzbDrone.Core; +using System; +using System.Diagnostics; +using System.IO; +using System.Reflection; +using NLog; +using NLog.Config; +using NLog.Targets; namespace NzbDrone { - class Program + static class Program { - private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); - static void Main(string[] args) + private static readonly Logger Logger = LogManager.GetLogger("Application"); + private static readonly Logger IISLogger = LogManager.GetLogger("IISExpress"); + + + private static Process IISProcess; + + static void Main() { - CentralDispatch.ConfigureNlog(); - CentralDispatch.BindKernel(); + try + { + AppDomain.CurrentDomain.UnhandledException += ((s, e) => AppDomainException(e)); + var projectRoot = GetProjectRoot(); + ConfigureNlog(); + Logger.Info("Starting NZBDrone. Start-up Path:'{0}'", projectRoot); - Logger.Info("Starting NZBDrone WebUI"); - var server = new CassiniDev.Server(@"D:\My Dropbox\Git\NzbDrone\NzbDrone.Web"); - server.Start(); + var iisPath = Path.Combine(projectRoot, @"IISExpress\iisexpress.exe"); + Logger.Info("IISExpress Path:'{0}'", iisPath); - System.Diagnostics.Process.Start(server.RootUrl); - Logger.Info("Server available at: " + server.RootUrl); - System.Console.ReadLine(); + KillOrphane(iisPath); + Logger.Info("Preparing IISExpress Server..."); + IISProcess = new Process(); + + IISProcess.StartInfo.FileName = iisPath; + IISProcess.StartInfo.Arguments = "/config:IISExpress\\Appserver\\applicationhost.config"; + IISProcess.StartInfo.WorkingDirectory = projectRoot; + + IISProcess.StartInfo.UseShellExecute = false; + IISProcess.StartInfo.RedirectStandardOutput = true; + IISProcess.StartInfo.RedirectStandardError = true; + IISProcess.StartInfo.CreateNoWindow = true; + + IISProcess.OutputDataReceived += ((s, e) => IISLogger.Trace(e.Data)); + IISProcess.ErrorDataReceived += ((s, e) => IISLogger.Fatal(e.Data)); + + //Set Variables for the config file. + Environment.SetEnvironmentVariable("NZBDRONE_PATH", projectRoot); + + Logger.Info("Starting process"); + IISProcess.Start(); + + //Event handlers, try to terminate iis express before exiting application. + AppDomain.CurrentDomain.ProcessExit += ProgramExited; + AppDomain.CurrentDomain.DomainUnload += ProgramExited; + Process.GetCurrentProcess().Exited += ProgramExited; + + IISProcess.BeginErrorReadLine(); + IISProcess.BeginOutputReadLine(); + + IISProcess.WaitForExit(); + Logger.Info("Main IISExpress instance was terminated. ExitCode:{0}", IISProcess.ExitCode); + } + catch (Exception e) + { + AppDomainException(e); + } + + Console.Write("Press Enter To Exit..."); + Console.ReadLine(); + + } + + private static string GetProjectRoot() + { + var appDir = new FileInfo(Assembly.GetExecutingAssembly().Location).Directory; + + while (appDir.GetDirectories("iisexpress").Length == 0) + { + if (appDir.Parent == null) throw new ApplicationException("Can't fine IISExpress folder."); + appDir = appDir.Parent; + } + + return appDir.FullName; + + } + + private static void AppDomainException(object excepion) + { + Console.WriteLine("EPIC FAIL: {0}", excepion); + Logger.Fatal("EPIC FAIL: {0}", excepion); + KillProcess(IISProcess); + } + + static void ProgramExited(object sender, EventArgs e) + { + KillProcess(IISProcess); + } + + private static void KillOrphane(string path) + { + Logger.Trace("================================================"); + Logger.Info("Finding orphaned IIS Processes."); + foreach (var process in Process.GetProcessesByName("IISExpress")) + { + Logger.Trace("-------------------------"); + string processPath = process.MainModule.FileName; + Logger.Info("[{0}]IIS Process found. Path:{1}", process.Id, processPath); + if (CleanPath(processPath) == CleanPath(path)) + { + Logger.Info("[{0}]Process is considered orphaned.", process.Id); + KillProcess(process); + } + else + { + Logger.Info("[{0}]Process has a different start-up path. skipping.", process.Id); + } + Logger.Trace("-------------------------"); + } + Logger.Trace("================================================"); + } + + private static void KillProcess(Process process) + { + if (process != null) + { + Logger.Info("[{0}]Killing process", process.Id); + process.Kill(); + Logger.Info("[{0}]Waiting for exit", process.Id); + process.WaitForExit(); + Logger.Info("[{0}]Process terminated successfully", process.Id); + } + } + + private static string CleanPath(string path) + { + return path.ToLower().Replace("\\", "").Replace("//", "//"); + } + + private static void ConfigureNlog() + { + var config = new LoggingConfiguration(); + + var debuggerTarget = new DebuggerTarget + { + Layout = "${logger}: ${message}" + }; + + + var consoleTarget = new ColoredConsoleTarget + { + Layout = "${logger}: ${message}" + }; + + + config.AddTarget("debugger", debuggerTarget); + config.AddTarget("console", consoleTarget); + //config.AddTarget("file", fileTarget); + + // Step 3. Set target properties + // Step 4. Define rules + //LoggingRule fileRule = new LoggingRule("*", LogLevel.Trace, fileTarget); + var debugRule = new LoggingRule("*", LogLevel.Trace, debuggerTarget); + var consoleRule = new LoggingRule("*", LogLevel.Trace, consoleTarget); + + //config.LoggingRules.Add(fileRule); + config.LoggingRules.Add(debugRule); + config.LoggingRules.Add(consoleRule); + + // Step 5. Activate the configuration + LogManager.Configuration = config; } } } + diff --git a/Package/NzbDrone.Web.SetParameters.xml b/Package/NzbDrone.Web.SetParameters.xml new file mode 100644 index 000000000..4032f9d47 --- /dev/null +++ b/Package/NzbDrone.Web.SetParameters.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Package/NzbDrone.Web.SourceManifest.xml b/Package/NzbDrone.Web.SourceManifest.xml new file mode 100644 index 000000000..183cb9d98 --- /dev/null +++ b/Package/NzbDrone.Web.SourceManifest.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Package/NzbDrone.Web.deploy-readme.txt b/Package/NzbDrone.Web.deploy-readme.txt new file mode 100644 index 000000000..5f3424f51 --- /dev/null +++ b/Package/NzbDrone.Web.deploy-readme.txt @@ -0,0 +1,57 @@ + +=========================== +Prerequisites : +-------------------------- +To deploy this Web package, Web Deploy (msdeploy.exe) must be installed on the computer that runs the .cmd file. For information about how to install Web Deploy, see the following URL: +http://go.microsoft.com/?linkid=9278654 +This batch file requires that the package file "NzbDrone.Web.zip" and optionally provided the parameters file "NzbDrone.Web.SetParameters.xml" in the same folder or destination folder by environment variable. + +=========================== +Usage: +-------------------------- +NzbDrone.Web.deploy.cmd [/T|/Y] [/M:ComputerName] [/U:UserName] [/P:Password] [/G:UseTempAgent] [Additional msdeploy.exe flags ...] + + +=========================== +Required Flags: +-------------------------- +/T: + Calls msdeploy.exe with the "-whatif" flag, which simulates deployment. This does not deploy the package. Instead, it creates a report of what will happen when you actually deploy the package. +/Y: + Calls msdeploy.exe without the "-whatif" flag, which deploys the package to the current machine or a destination server. Use /Y after you have verified the output that was generated by using the /T flag. + +Note: Do not use /T and /Y in the same command. + +=========================== +Optional Flags: +-------------------------- + By Default, this script deploy on the current machine where this script is called with current user credential without agent service. Only pass the following value for advance scenario. + +/M: + If this flag is not specified, the package is installed on the computer where the command is run. The Service URL can be in the following format: + https://:8172/MSDeploy.axd + This format requires that IIS 7 be installed on the destination server and that IIS 7 Web Management Service(WMSvc) and Web Deployment Handler be set up. + The service URL can also be in the following format: + http:///MSDeployAgentService + This format requires administrative rights on the destination server, and it requires that Web Deploy Remote Service (MsDepSvc) be installed on the destination server. IIS 7 does not have to be installed on the destination server. + +/U: +/P: +/G: + Specifies that the package is deployed by creating a temporary listener on the destination server. This requires no special installation on the destination server, but it requires you to be an administrator on that server. The default value of this flag is False. + +[Additional msdeploy.exe flags] + The msdeploy.exe command supports additional flags. You can include any of these additional flags in the "$(ProjectName).Deploy.cmd" file, and the flags are passed through to msdeploy.exe during execution. + Alternatively, you can specify additional flags by setting the "_MsDeployAdditionalFlags" environment variable. These settings are used by this batch file. + Note: Any flag value that includes an equal sign (=) must be enclosed in double quotation marks, as shown in the following example, which will skip deploying the databases that are included in the package: + "-skip:objectName=dbFullSql" + +=========================== +Environment-Specific Settings: +-------------------------- + + To customize application-specific settings for each deployment environment (for example, the IIS application name, the physical path, and any connection strings), edit the settings in the following file: + "NzbDrone.Web.SetParameters.xml" +=========================== +For more information on this deploy script visit: http://go.microsoft.com/fwlink/?LinkID=183544 + diff --git a/Package/NzbDrone.Web.deploy.cmd b/Package/NzbDrone.Web.deploy.cmd new file mode 100644 index 000000000..0b186e687 --- /dev/null +++ b/Package/NzbDrone.Web.deploy.cmd @@ -0,0 +1,189 @@ +@rem --------------------------------------------------------------------------------- +@rem Copyright 2008 Microsoft Corporation. All rights reserved. +@rem This is provided as sample to deploy the package using msdeploy.exe +@rem For information about IIS Web Deploy technology, +@rem please visit http://go.microsoft.com/?linkid=9278654 +@rem Note: This batch file assumes the package and setparametsrs.xml are in the same folder with this file +@rem --------------------------------------------------------------------------------- +@if %_echo%!==! echo off +setlocal +@rem --------------------------------------------------------------------------------- +@rem Please Make sure you have Web Deploy install in your machine. +@rem Alternatively, you can explicit set the MsDeployPath to the location it is on your machine +@rem set MSDeployPath="C:\Program Files (x86)\IIS\Microsoft Web Deploy\" +@rem --------------------------------------------------------------------------------- + +@rem --------------------------------------------------------------------------------- +@rem if user does not set MsDeployPath environment variable, we will try to retrieve it from registry. +@rem --------------------------------------------------------------------------------- +if "%MSDeployPath%" == "" ( +for /F "usebackq tokens=2*" %%i in (`reg query "HKLM\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\1" /v InstallPath`) do ( +if "%%~dpj" == "%%j" ( +set MSDeployPath=%%j +))) + +if not exist "%MSDeployPath%\msdeploy.exe" ( +echo. msdeploy.exe is not found on this machine. Please install Web Deploy before execute the script. +echo. Please visit http://go.microsoft.com/?linkid=9278654 +goto :usage +) + +set RootPath=%~dp0 +if /I "%_DeploySetParametersFile%" == "" ( +set _DeploySetParametersFile=%RootPath%NzbDrone.Web.SetParameters.xml +) + +set _ArgTestDeploy= +set _ArgDestinationType=auto +set _ArgComputerName= +set _ArgUserName= +set _ArgPassword= +set _ArgEncryptPassword= +set _ArgIncludeAcls=False +set _ArgAuthType= +set _ArgtempAgent= + +@rem --------------------------------------------------------------------------------- +@rem Simple Parse the arguments +@rem --------------------------------------------------------------------------------- +:NextArgument +set _ArgCurrent=%~1 + +if /I "%_ArgCurrent%" == "" goto :GetStarted +if /I "%_ArgCurrent%" == "/T" set _ArgTestDeploy=true&goto :ArgumentOK +if /I "%_ArgCurrent%" == "/Y" set _ArgTestDeploy=false&goto :ArgumentOK + +set _ArgFlag=%_ArgCurrent:~0,3% +set _ArgValue=%_ArgCurrent:~3% + +if /I "%_ArgFlag%" == "/M:" set _ArgComputerName=%_ArgValue%&goto :ArgumentOK +if /I "%_ArgFlag%" == "/U:" set _ArgUserName=%_ArgValue%&goto :ArgumentOK +if /I "%_ArgFlag%" == "/P:" set _ArgPassword=%_ArgValue%&goto :ArgumentOK +if /I "%_ArgFlag%" == "/E:" set _ArgEncryptPassword=%_ArgValue%&goto :ArgumentOK +if /I "%_ArgFlag%" == "/I:" set _ArgIncludeAcls=%_ArgValue%&goto :ArgumentOK +if /I "%_ArgFlag%" == "/A:" set _ArgAuthType=%_ArgValue%&goto :ArgumentOK +if /I "%_ArgFlag%" == "/G:" set _ArgtempAgent=%_ArgValue%&goto :ArgumentOK + +@rem Any addition flags, pass through to the msdeploy +set _ArgMsDeployAdditionalFlags=%_ArgMsDeployAdditionalFlags% %_ArgCurrent% + +:ArgumentOK +shift +goto :NextArgument + +:GetStarted +if /I "%_ArgTestDeploy%" == "" goto :usage +if /I "%_ArgDestinationType%" == "" goto :usage + +set _Destination=%_ArgDestinationType% +if not "%_ArgComputerName%" == "" set _Destination=%_Destination%,computerName='%_ArgComputerName%' +if not "%_ArgUserName%" == "" set _Destination=%_Destination%,userName='%_ArgUserName%' +if not "%_ArgPassword%" == "" set _Destination=%_Destination%,password='%_ArgPassword%' +if not "%_ArgAuthType%" == "" set _Destination=%_Destination%,authtype='%_ArgAuthType%' +if not "%_ArgEncryptPassword%" == "" set _Destination=%_Destination%,encryptPassword='%_ArgEncryptPassword%' +if not "%_ArgIncludeAcls%" == "" set _Destination=%_Destination%,includeAcls='%_ArgIncludeAcls%' +if not "%_ArgtempAgent%" == "" set _Destination=%_Destination%,tempAgent='%_ArgtempAgent%' + +@rem --------------------------------------------------------------------------------- +@rem add -whatif when -T is specified +@rem --------------------------------------------------------------------------------- +if /I "%_ArgTestDeploy%" NEQ "false" ( +set _MsDeployAdditionalFlags=%_MsDeployAdditionalFlags% -whatif +) + +@rem --------------------------------------------------------------------------------- +@rem pass through the addition msdeploy.exe Flags +@rem --------------------------------------------------------------------------------- +set _MsDeployAdditionalFlags=%_MsDeployAdditionalFlags% %_ArgMsDeployAdditionalFlags% + +@rem --------------------------------------------------------------------------------- +@rem check the existence of the package file +@rem --------------------------------------------------------------------------------- +if not exist "%RootPath%NzbDrone.Web.zip" ( +echo "%RootPath%NzbDrone.Web.zip" does not exist. +echo This batch file relies on this deploy source file^(s^) in the same folder. +goto :usage +) + +@rem --------------------------------------------------------------------------------- +@rem Execute msdeploy.exe command line +@rem --------------------------------------------------------------------------------- +call :CheckParameterFile +echo. Start executing msdeploy.exe +echo ------------------------------------------------------- +if not exist "%_DeploySetParametersFile%" ( +echo. "%MSDeployPath%\msdeploy.exe" -source:package='%RootPath%NzbDrone.Web.zip' -dest:%_Destination% -verb:sync -disableLink:AppPoolExtension -disableLink:ContentExtension -disableLink:CertificateExtension -skip:objectname='dirPath',absolutepath='obj\\Debug\\Package\\PackageTmp\\App_Data$' %_MsDeployAdditionalFlags% +"%MSDeployPath%\msdeploy.exe" -source:package='%RootPath%NzbDrone.Web.zip' -dest:%_Destination% -verb:sync -disableLink:AppPoolExtension -disableLink:ContentExtension -disableLink:CertificateExtension -skip:objectname='dirPath',absolutepath='obj\\Debug\\Package\\PackageTmp\\App_Data$' %_MsDeployAdditionalFlags% +) else ( +echo. "%MSDeployPath%\msdeploy.exe" -source:package='%RootPath%NzbDrone.Web.zip' -dest:%_Destination% -verb:sync -disableLink:AppPoolExtension -disableLink:ContentExtension -disableLink:CertificateExtension -skip:objectname='dirPath',absolutepath='obj\\Debug\\Package\\PackageTmp\\App_Data$' -setParamFile:"%RootPath%NzbDrone.Web.SetParameters.xml" %_MsDeployAdditionalFlags% +"%MSDeployPath%\msdeploy.exe" -source:package='%RootPath%NzbDrone.Web.zip' -dest:%_Destination% -verb:sync -disableLink:AppPoolExtension -disableLink:ContentExtension -disableLink:CertificateExtension -skip:objectname='dirPath',absolutepath='obj\\Debug\\Package\\PackageTmp\\App_Data$' -setParamFile:"%RootPath%NzbDrone.Web.SetParameters.xml" %_MsDeployAdditionalFlags% +) +goto :eof + +@rem --------------------------------------------------------------------------------- +@rem CheckParameterFile -- check if the package's setparamters.xml exists or not +@rem --------------------------------------------------------------------------------- +:CheckParameterFile +echo ========================================================= +if exist "%_DeploySetParametersFile%" ( +echo SetParameters from: +echo "%_DeploySetParametersFile%" +echo You can change IIS Application Name, Physical path, connectionString +echo or other deploy parameters in the above file. +) else ( +echo SetParamterFiles does not exist in package location. +echo Use package embedded defaultValue to deploy. +) +echo ------------------------------------------------------- +goto :eof + +@rem --------------------------------------------------------------------------------- +@rem Usage +@rem --------------------------------------------------------------------------------- +:usage +echo ========================================================= +if not exist "%RootPath%NzbDrone.Web.deploy-readme.txt" ( +echo Usage:%~nx0 [/T^|/Y] [/M:ComputerName] [/U:userName] [/P:password] [/G:tempAgent] [additional msdeploy flags ...] +echo Required flags: +echo /T Calls msdeploy.exe with the "-whatif" flag, which simulates deployment. +echo /Y Calls msdeploy.exe without the "-whatif" flag, which deploys the package to the current machine or destination server +echo Optional flags: +echo. By Default, this script deploy to the current machine where this script is invoked which will use current user credential without tempAgent. +echo. Only pass these arguments when in advance scenario. +echo /M: Msdeploy destination name of remote computer or proxy-URL. Default is local. +echo /U: Msdeploy destination user name. +echo /P: Msdeploy destination password. +echo /G: Msdeploy destination tempAgent. True or False. Default is false. +echo.[additional msdeploy flags]: note: " is required for passing = through command line. +echo "-skip:objectName=setAcl" "-skip:objectName=dbFullSql" +echo.Alternative environment variable _MsDeployAdditionalFlags is also honored. +echo. +echo. Please make sure MSDeploy is installed in the box http://go.microsoft.com/?linkid=9278654 +echo. +echo In addition, you can change IIS Application Name, Physical path, +echo connectionString and other deploy parameters in the following file: +echo "%_DeploySetParametersFile%" +echo. +echo For more information about this batch file, visit http://go.microsoft.com/fwlink/?LinkID=183544 +) else ( +start notepad "%RootPath%NzbDrone.Web.deploy-readme.txt" +) +echo ========================================================= +goto :eof + +@rem --------------------------------------------------------------------------------- +@rem CheckParameterFile -- check if the package's setparamters.xml exists or not +@rem --------------------------------------------------------------------------------- +:CheckParameterFile +echo ========================================================= +if exist "%RootPath%NzbDrone.Web.SetParameters.xml" ( +echo SetParameters from: +echo "%RootPath%NzbDrone.Web.SetParameters.xml" +echo You can change IIS Application Name, Physical path, connectionString +echo or other deploy parameters in the above file. +) else ( +echo SetParamterFiles does not exist in package location. +echo Use package embedded defaultValue to deploy. +) +echo ------------------------------------------------------- +goto :eof diff --git a/Package/NzbDrone.Web.zip b/Package/NzbDrone.Web.zip new file mode 100644 index 000000000..c93209842 Binary files /dev/null and b/Package/NzbDrone.Web.zip differ diff --git a/SABSync.5.1.ReSharper b/SABSync.5.1.ReSharper deleted file mode 100644 index d78223e0a..000000000 --- a/SABSync.5.1.ReSharper +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file