diff --git a/aspclassiccompiler/.vs/ASPClassicCompiler/config/applicationhost.config b/aspclassiccompiler/.vs/ASPClassicCompiler/config/applicationhost.config new file mode 100644 index 0000000..7bd3852 --- /dev/null +++ b/aspclassiccompiler/.vs/ASPClassicCompiler/config/applicationhost.config @@ -0,0 +1,1029 @@ + + + + + + + + +
+
+
+
+
+
+
+
+ + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+ +
+
+ +
+
+ +
+
+
+ + +
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/aspclassiccompiler/ASPClassicCompiler.sln b/aspclassiccompiler/ASPClassicCompiler.sln index 3ace6db..bf36406 100644 --- a/aspclassiccompiler/ASPClassicCompiler.sln +++ b/aspclassiccompiler/ASPClassicCompiler.sln @@ -1,60 +1,65 @@ -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{244AF685-4E12-4893-89DA-939A2964C0FB}" - ProjectSection(SolutionItems) = preProject - License.txt = License.txt - EndProjectSection -EndProject -Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Parser", "Parser\Parser.vbproj", "{57A0B340-BDA4-4DE3-B449-52B8C51D84B8}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VBScript", "VBScript\VBScript.csproj", "{0846368D-EA96-4AC4-81AF-E4F9B78CE60B}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Asp", "asp\Asp.csproj", "{F076A2D0-5200-42D7-9AEA-9E1260EFB138}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AspWebApp", "AspWebApp\AspWebApp.csproj", "{24BF0EA3-2D82-4E85-B13D-EA9279F58812}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NerdDinnerAsp", "NerdDinnerAsp\NerdDinnerAsp.csproj", "{328C148C-DBEE-41A4-B1C7-104CBB216556}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VBScriptTest", "VBScriptTest\VBScriptTest.csproj", "{3153B5A6-B372-46D0-A10B-0CC4C4FBAE9D}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VBSC", "VBSC\VBSC.csproj", "{556BAE6E-AA67-48C7-ACD6-1AB0AA930197}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {57A0B340-BDA4-4DE3-B449-52B8C51D84B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {57A0B340-BDA4-4DE3-B449-52B8C51D84B8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {57A0B340-BDA4-4DE3-B449-52B8C51D84B8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {57A0B340-BDA4-4DE3-B449-52B8C51D84B8}.Release|Any CPU.Build.0 = Release|Any CPU - {0846368D-EA96-4AC4-81AF-E4F9B78CE60B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0846368D-EA96-4AC4-81AF-E4F9B78CE60B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0846368D-EA96-4AC4-81AF-E4F9B78CE60B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0846368D-EA96-4AC4-81AF-E4F9B78CE60B}.Release|Any CPU.Build.0 = Release|Any CPU - {F076A2D0-5200-42D7-9AEA-9E1260EFB138}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F076A2D0-5200-42D7-9AEA-9E1260EFB138}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F076A2D0-5200-42D7-9AEA-9E1260EFB138}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F076A2D0-5200-42D7-9AEA-9E1260EFB138}.Release|Any CPU.Build.0 = Release|Any CPU - {24BF0EA3-2D82-4E85-B13D-EA9279F58812}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {24BF0EA3-2D82-4E85-B13D-EA9279F58812}.Debug|Any CPU.Build.0 = Debug|Any CPU - {24BF0EA3-2D82-4E85-B13D-EA9279F58812}.Release|Any CPU.ActiveCfg = Release|Any CPU - {24BF0EA3-2D82-4E85-B13D-EA9279F58812}.Release|Any CPU.Build.0 = Release|Any CPU - {328C148C-DBEE-41A4-B1C7-104CBB216556}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {328C148C-DBEE-41A4-B1C7-104CBB216556}.Debug|Any CPU.Build.0 = Debug|Any CPU - {328C148C-DBEE-41A4-B1C7-104CBB216556}.Release|Any CPU.ActiveCfg = Release|Any CPU - {328C148C-DBEE-41A4-B1C7-104CBB216556}.Release|Any CPU.Build.0 = Release|Any CPU - {3153B5A6-B372-46D0-A10B-0CC4C4FBAE9D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3153B5A6-B372-46D0-A10B-0CC4C4FBAE9D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3153B5A6-B372-46D0-A10B-0CC4C4FBAE9D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3153B5A6-B372-46D0-A10B-0CC4C4FBAE9D}.Release|Any CPU.Build.0 = Release|Any CPU - {556BAE6E-AA67-48C7-ACD6-1AB0AA930197}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {556BAE6E-AA67-48C7-ACD6-1AB0AA930197}.Debug|Any CPU.Build.0 = Debug|Any CPU - {556BAE6E-AA67-48C7-ACD6-1AB0AA930197}.Release|Any CPU.ActiveCfg = Release|Any CPU - {556BAE6E-AA67-48C7-ACD6-1AB0AA930197}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.1.32328.378 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{244AF685-4E12-4893-89DA-939A2964C0FB}" + ProjectSection(SolutionItems) = preProject + License.txt = License.txt + EndProjectSection +EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Parser", "Parser\Parser.vbproj", "{57A0B340-BDA4-4DE3-B449-52B8C51D84B8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VBScript", "VBScript\VBScript.csproj", "{0846368D-EA96-4AC4-81AF-E4F9B78CE60B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Asp", "asp\Asp.csproj", "{F076A2D0-5200-42D7-9AEA-9E1260EFB138}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AspWebApp", "AspWebApp\AspWebApp.csproj", "{24BF0EA3-2D82-4E85-B13D-EA9279F58812}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NerdDinnerAsp", "NerdDinnerAsp\NerdDinnerAsp.csproj", "{328C148C-DBEE-41A4-B1C7-104CBB216556}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VBScriptTest", "VBScriptTest\VBScriptTest.csproj", "{3153B5A6-B372-46D0-A10B-0CC4C4FBAE9D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VBSC", "VBSC\VBSC.csproj", "{556BAE6E-AA67-48C7-ACD6-1AB0AA930197}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {57A0B340-BDA4-4DE3-B449-52B8C51D84B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {57A0B340-BDA4-4DE3-B449-52B8C51D84B8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {57A0B340-BDA4-4DE3-B449-52B8C51D84B8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {57A0B340-BDA4-4DE3-B449-52B8C51D84B8}.Release|Any CPU.Build.0 = Release|Any CPU + {0846368D-EA96-4AC4-81AF-E4F9B78CE60B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0846368D-EA96-4AC4-81AF-E4F9B78CE60B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0846368D-EA96-4AC4-81AF-E4F9B78CE60B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0846368D-EA96-4AC4-81AF-E4F9B78CE60B}.Release|Any CPU.Build.0 = Release|Any CPU + {F076A2D0-5200-42D7-9AEA-9E1260EFB138}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F076A2D0-5200-42D7-9AEA-9E1260EFB138}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F076A2D0-5200-42D7-9AEA-9E1260EFB138}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F076A2D0-5200-42D7-9AEA-9E1260EFB138}.Release|Any CPU.Build.0 = Release|Any CPU + {24BF0EA3-2D82-4E85-B13D-EA9279F58812}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {24BF0EA3-2D82-4E85-B13D-EA9279F58812}.Debug|Any CPU.Build.0 = Debug|Any CPU + {24BF0EA3-2D82-4E85-B13D-EA9279F58812}.Release|Any CPU.ActiveCfg = Release|Any CPU + {24BF0EA3-2D82-4E85-B13D-EA9279F58812}.Release|Any CPU.Build.0 = Release|Any CPU + {328C148C-DBEE-41A4-B1C7-104CBB216556}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {328C148C-DBEE-41A4-B1C7-104CBB216556}.Debug|Any CPU.Build.0 = Debug|Any CPU + {328C148C-DBEE-41A4-B1C7-104CBB216556}.Release|Any CPU.ActiveCfg = Release|Any CPU + {328C148C-DBEE-41A4-B1C7-104CBB216556}.Release|Any CPU.Build.0 = Release|Any CPU + {3153B5A6-B372-46D0-A10B-0CC4C4FBAE9D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3153B5A6-B372-46D0-A10B-0CC4C4FBAE9D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3153B5A6-B372-46D0-A10B-0CC4C4FBAE9D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3153B5A6-B372-46D0-A10B-0CC4C4FBAE9D}.Release|Any CPU.Build.0 = Release|Any CPU + {556BAE6E-AA67-48C7-ACD6-1AB0AA930197}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {556BAE6E-AA67-48C7-ACD6-1AB0AA930197}.Debug|Any CPU.Build.0 = Debug|Any CPU + {556BAE6E-AA67-48C7-ACD6-1AB0AA930197}.Release|Any CPU.ActiveCfg = Release|Any CPU + {556BAE6E-AA67-48C7-ACD6-1AB0AA930197}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {391AFB89-55FA-499F-99F7-112509430600} + EndGlobalSection +EndGlobal diff --git a/aspclassiccompiler/AspWebApp/AspWebApp.csproj b/aspclassiccompiler/AspWebApp/AspWebApp.csproj index 1254e82..26043b3 100644 --- a/aspclassiccompiler/AspWebApp/AspWebApp.csproj +++ b/aspclassiccompiler/AspWebApp/AspWebApp.csproj @@ -1,171 +1,191 @@ - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {24BF0EA3-2D82-4E85-B13D-EA9279F58812} - {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - AspWebApp - AspWebApp - v3.5 - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\ - TRACE - prompt - 4 - - - true - bin\x86\Debug\ - DEBUG;TRACE - full - x86 - prompt - - - bin\x86\Release\ - TRACE - true - pdbonly - x86 - prompt - - - - False - ..\asp\bin\Release\Dlrsoft.Asp.dll - - - - - 3.5 - - - 3.5 - - - 3.5 - - - 3.5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - False - True - 3465 - / - - - False - False - - - False - - - - + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {24BF0EA3-2D82-4E85-B13D-EA9279F58812} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + AspWebApp + AspWebApp + v3.5 + + + + + 3.5 + false + + + + + + + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\ + TRACE + prompt + 4 + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + prompt + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + prompt + + + + + + 3.5 + + + 3.5 + + + 3.5 + + + 3.5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {f076a2d0-5200-42d7-9aea-9e1260efb138} + Asp + + + + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + + + + + + False + True + 3465 + / + + + False + False + + + False + + + + \ No newline at end of file diff --git a/aspclassiccompiler/Backup/ASPClassicCompiler.sln b/aspclassiccompiler/Backup/ASPClassicCompiler.sln new file mode 100644 index 0000000..926557f --- /dev/null +++ b/aspclassiccompiler/Backup/ASPClassicCompiler.sln @@ -0,0 +1,60 @@ +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{244AF685-4E12-4893-89DA-939A2964C0FB}" + ProjectSection(SolutionItems) = preProject + License.txt = License.txt + EndProjectSection +EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Parser", "Parser\Parser.vbproj", "{57A0B340-BDA4-4DE3-B449-52B8C51D84B8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VBScript", "VBScript\VBScript.csproj", "{0846368D-EA96-4AC4-81AF-E4F9B78CE60B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Asp", "asp\Asp.csproj", "{F076A2D0-5200-42D7-9AEA-9E1260EFB138}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AspWebApp", "AspWebApp\AspWebApp.csproj", "{24BF0EA3-2D82-4E85-B13D-EA9279F58812}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NerdDinnerAsp", "NerdDinnerAsp\NerdDinnerAsp.csproj", "{328C148C-DBEE-41A4-B1C7-104CBB216556}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VBScriptTest", "VBScriptTest\VBScriptTest.csproj", "{3153B5A6-B372-46D0-A10B-0CC4C4FBAE9D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VBSC", "VBSC\VBSC.csproj", "{556BAE6E-AA67-48C7-ACD6-1AB0AA930197}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {57A0B340-BDA4-4DE3-B449-52B8C51D84B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {57A0B340-BDA4-4DE3-B449-52B8C51D84B8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {57A0B340-BDA4-4DE3-B449-52B8C51D84B8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {57A0B340-BDA4-4DE3-B449-52B8C51D84B8}.Release|Any CPU.Build.0 = Release|Any CPU + {0846368D-EA96-4AC4-81AF-E4F9B78CE60B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0846368D-EA96-4AC4-81AF-E4F9B78CE60B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0846368D-EA96-4AC4-81AF-E4F9B78CE60B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0846368D-EA96-4AC4-81AF-E4F9B78CE60B}.Release|Any CPU.Build.0 = Release|Any CPU + {F076A2D0-5200-42D7-9AEA-9E1260EFB138}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F076A2D0-5200-42D7-9AEA-9E1260EFB138}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F076A2D0-5200-42D7-9AEA-9E1260EFB138}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F076A2D0-5200-42D7-9AEA-9E1260EFB138}.Release|Any CPU.Build.0 = Release|Any CPU + {24BF0EA3-2D82-4E85-B13D-EA9279F58812}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {24BF0EA3-2D82-4E85-B13D-EA9279F58812}.Debug|Any CPU.Build.0 = Debug|Any CPU + {24BF0EA3-2D82-4E85-B13D-EA9279F58812}.Release|Any CPU.ActiveCfg = Release|Any CPU + {24BF0EA3-2D82-4E85-B13D-EA9279F58812}.Release|Any CPU.Build.0 = Release|Any CPU + {328C148C-DBEE-41A4-B1C7-104CBB216556}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {328C148C-DBEE-41A4-B1C7-104CBB216556}.Debug|Any CPU.Build.0 = Debug|Any CPU + {328C148C-DBEE-41A4-B1C7-104CBB216556}.Release|Any CPU.ActiveCfg = Release|Any CPU + {328C148C-DBEE-41A4-B1C7-104CBB216556}.Release|Any CPU.Build.0 = Release|Any CPU + {3153B5A6-B372-46D0-A10B-0CC4C4FBAE9D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3153B5A6-B372-46D0-A10B-0CC4C4FBAE9D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3153B5A6-B372-46D0-A10B-0CC4C4FBAE9D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3153B5A6-B372-46D0-A10B-0CC4C4FBAE9D}.Release|Any CPU.Build.0 = Release|Any CPU + {556BAE6E-AA67-48C7-ACD6-1AB0AA930197}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {556BAE6E-AA67-48C7-ACD6-1AB0AA930197}.Debug|Any CPU.Build.0 = Debug|Any CPU + {556BAE6E-AA67-48C7-ACD6-1AB0AA930197}.Release|Any CPU.ActiveCfg = Release|Any CPU + {556BAE6E-AA67-48C7-ACD6-1AB0AA930197}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/aspclassiccompiler/Backup/AspWebApp/AspWebApp.csproj b/aspclassiccompiler/Backup/AspWebApp/AspWebApp.csproj new file mode 100644 index 0000000..6d161b5 --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/AspWebApp.csproj @@ -0,0 +1,171 @@ + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {24BF0EA3-2D82-4E85-B13D-EA9279F58812} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + AspWebApp + AspWebApp + v3.5 + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\ + TRACE + prompt + 4 + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + prompt + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + prompt + + + + False + ..\asp\bin\Release\Dlrsoft.Asp.dll + + + + + 3.5 + + + 3.5 + + + 3.5 + + + 3.5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + False + True + 3465 + / + + + False + False + + + False + + + + + \ No newline at end of file diff --git a/aspclassiccompiler/Backup/AspWebApp/Database/AddDelete.asp b/aspclassiccompiler/Backup/AspWebApp/Database/AddDelete.asp new file mode 100644 index 0000000..d4d896b --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/Database/AddDelete.asp @@ -0,0 +1,59 @@ +<%@ LANGUAGE = VBScript %> +<% Option Explicit %> +<% Response.Expires= -1 %> + + + + + + Add/Delete Database Sample + + + + + + + + Add/Delete Database Sample
+ +
+ + <% + Dim oConn + Dim oRs + Dim filePath + + + ' Map authors database to physical path + filePath = Server.MapPath("authors.mdb") + + + ' Create ADO Connection Component to connect with sample database + + + + Set oConn = Server.CreateObject("ADODB.Connection") + oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & filePath + + ' To add, delete and update recordset, it is recommended to use + ' direct SQL statement instead of ADO methods. + + oConn.Execute "insert into authors (author, YearBorn) values ('Paul Enfield', 1967)" + + ' Output Result + Set oRs = oConn.Execute (" select * from authors where Author= 'Paul Enfield' and YearBorn =1967 " ) + Response.Write("

Inserted Author: " & oRs("Author") & "," & oRs("YearBorn")) + ' Close Recordset + oRs.Close + Set oRs= Nothing + + + ' Delete the inserted record + oConn.Execute "Delete From authors where author='Paul Enfield' and YearBorn = 1967 " + + ' Output Status Result + Response.Write("

Deleted Author: Paul Enfield, 1967") + %> + + diff --git a/aspclassiccompiler/Backup/AspWebApp/Database/Authors.mdb b/aspclassiccompiler/Backup/AspWebApp/Database/Authors.mdb new file mode 100644 index 0000000..debc42c Binary files /dev/null and b/aspclassiccompiler/Backup/AspWebApp/Database/Authors.mdb differ diff --git a/aspclassiccompiler/Backup/AspWebApp/Database/Blob.Asp b/aspclassiccompiler/Backup/AspWebApp/Database/Blob.Asp new file mode 100644 index 0000000..351b746 --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/Database/Blob.Asp @@ -0,0 +1,48 @@ +<% @ LANGUAGE=VBScript %> +<% Option Explicit %> + + +<% + ' This sample utilizes the Image field in the PUB_INFO table. + ' This table is installed with Microsoft SQL Server in the + ' PUBS database. + + + Dim oConn + Dim oRs + Dim Pic + Dim PicSize + Dim strConn + + + ' Setup HTTP Header Information so that the browser interprets + ' the returned data as a gif graphic file. Note that browsers + ' interpret returned information using MIME headers -- not file + ' extensions. + + Response.Buffer = TRUE + Response.ContentType = "image/gif" + + + ' Create ADO Connection Object. Use OLEDB Source with + ' default sa account and no password + + Set oConn = Server.CreateObject("ADODB.Connection") + strConn="Provider=SQLOLEDB;User ID=sa;Initial Catalog=pubs;Data Source="& Request.ServerVariables("SERVER_NAME") + ' Query SQL to obtain recordset containing gif BLOB + oConn.Open strConn + Set oRs = oConn.Execute("SELECT logo FROM pub_info WHERE pub_id='0736'") + + ' Obtain local variable of GIF + + PicSize = oRs("logo").ActualSize + Pic = oRs("logo").GetChunk(PicSize) + + + ' Write Data back to client. Because MIME type is set to + ' image/gif, the browser will automatically render as picture + + Response.BinaryWrite Pic + Response.End +%> +dsafds \ No newline at end of file diff --git a/aspclassiccompiler/Backup/AspWebApp/Database/LimitRows.asp b/aspclassiccompiler/Backup/AspWebApp/Database/LimitRows.asp new file mode 100644 index 0000000..247b0df --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/Database/LimitRows.asp @@ -0,0 +1,93 @@ +<%@ LANGUAGE = VBScript %> +<% Option Explicit %> + + + + + + LimitRows From Database + + + + + + + + + LimitRows From Database
+ +


+ + Contacts within the Authors Database:

+ + <% + Dim oConn + Dim oRs + Dim curDir + Dim Index + + + ' Map authors database to physical path + + curDir = Server.MapPath("authors.mdb") + + ' Create ADO Connection Component to connect + ' with sample database + + Set oConn = Server.CreateObject("ADODB.Connection") + oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & curDir + + + ' Create ADO Recordset Component + + Set oRs = Server.CreateObject("ADODB.Recordset") + Set oRs.ActiveConnection = oConn + + + ' Set Recordset PageSize so that it only + ' holds 10 rows + + oRs.PageSize = 10 + + + ' Get recordset + + oRs.Source = "SELECT * FROM authors" + oRs.CursorType = adOpenStatic + + + ' Open Recordset + oRs.Open + %> + + + + <% + Dim RecordCount + RecordCount = 0 + + Do while ((Not oRs.eof) And (RecordCount < oRs.PageSize)) %> + + + <% For Index=0 to (oRs.fields.count-1) %> + + <% Next %> + + + <% + RecordCount = RecordCount + 1 + oRs.MoveNext + Loop + %> + +
<% = oRs(Index)%>
+ + + <% + oRs.close + oConn.close + %> + + + diff --git a/aspclassiccompiler/Backup/AspWebApp/Database/MultiScrolling.asp b/aspclassiccompiler/Backup/AspWebApp/Database/MultiScrolling.asp new file mode 100644 index 0000000..a22bf3c --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/Database/MultiScrolling.asp @@ -0,0 +1,124 @@ +<% @LANGUAGE="VBSCRIPT" %> +<% Option Explicit %> + + + + + MultiScrolling Database Sample + + + + + + + + + MultiScrolling Database Sample
+ +
+ + Contacts within the Authors Database:

+ + <% + Dim oConn + Dim oRs + Dim filePath + Dim Mv + Dim PageNo + Dim j + Dim i + + + ' Map authors database to physical path + + filePath = Server.MapPath("authors.mdb") + + + ' Create ADO Connection Component to connect with + ' sample database + Set oConn = Server.CreateObject("ADODB.Connection") + oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & filePath + + + ' Create ADO Recordset Component + + Set oRs = Server.CreateObject("ADODB.Recordset") + + + ' Determine what PageNumber the scrolling currently is on + + Mv = Request("Mv") + + If Request("PageNo") = "" Then + PageNo = 1 + Else + PageNo = Request("PageNo") + End If + + ' Setup Query Recordset (4 records per page) + + oRs.Open "SELECT * FROM Authors", oConn, adOpenStatic + oRs.PageSize = 4 + + + ' Adjust PageNumber as Appropriate + If Mv = "Page Up" or Mv = "Page Down" Then + Select Case Mv + Case "Page Up" + If PageNo > 1 Then + PageNo = PageNo - 1 + Else + PageNo = 1 + End If + Case "Page Down" + If oRs.AbsolutePage < oRs.PageCount Then + PageNo = PageNo + 1 + Else + PageNo = oRs.PageCount + End If + Case Else + PageNo = 1 + End Select + End If + + oRs.AbsolutePage = PageNo + %> + + + + + <% For j = 1 to oRs.PageSize %> + + <% For i = 0 to oRs.Fields.Count - 1 %> + + <% Next %> + + + <% + oRs.MoveNext + + ' Don't try to print the EOF record. + If oRs.EOF Then + Exit For + End If + Next %> +
<%= oRs(i) %>
+ + + +
+ + + <% If PageNo < oRs.PageCount Then %> + + <% End If %> + + <% If PageNo > 1 Then %> + + <% End If %> + +
+ + + diff --git a/aspclassiccompiler/Backup/AspWebApp/Database/SimpleQuery.asp b/aspclassiccompiler/Backup/AspWebApp/Database/SimpleQuery.asp new file mode 100644 index 0000000..13e1f20 --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/Database/SimpleQuery.asp @@ -0,0 +1,71 @@ +<%@ LANGUAGE = VBScript %> +<% Option Explicit %> + + + + Simple ADO Query + + + + + + + + Simple ADO Query with ASP
+ +
+ + Contacts within the Authors Database:

+ + <% + Dim oConn + Dim oRs + Dim filePath + Dim Index + + + ' Map authors database to physical path + filePath = Server.MapPath("authors.mdb") + + + ' Create ADO Connection Component to connect + ' with sample database + + + + Set oConn = Server.CreateObject("ADODB.Connection") + oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & filePath + + + ' Execute a SQL query and store the results + ' within recordset + + Set oRs = oConn.Execute("SELECT * From authors") + %> + + + + <% + Do while (Not oRs.eof) %> + + + <% For Index=0 to (oRs.fields.count-1) %> + + <% Next %> + + + <% oRs.MoveNext + Loop + %> + + +
<%= oRs(Index)%>
+ + + <% + oRs.close + oConn.close + %> + + + diff --git a/aspclassiccompiler/Backup/AspWebApp/Database/StoredProcedures.asp b/aspclassiccompiler/Backup/AspWebApp/Database/StoredProcedures.asp new file mode 100644 index 0000000..2b7dc4a --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/Database/StoredProcedures.asp @@ -0,0 +1,63 @@ +<% @ LANGUAGE="VBSCRIPT" %> +<% Option Explicit %> + + +<% ' This example can be used to call the ByRoyalty stored procedure + ' installed with the PUBS database with Microsoft SQL Server. + + ' This sample assumes that SQL Server is running on the local machine +%> + + + + + Using Stored Procedures + + + + + + + + Using Stored Procedures

+ + <% + Dim oConn + Dim strConn + Dim oCmd + Dim oRs + + Set oConn = Server.CreateObject("ADODB.Connection") + Set oCmd = Server.CreateObject("ADODB.Command") + + + ' Open ADO Connection using account "sa" + ' and blank password + + strConn="Provider=SQLOLEDB;User ID=sa;Initial Catalog=pubs;Data Source="& Request.ServerVariables("SERVER_NAME") + oConn.Open strConn + Set oCmd.ActiveConnection = oConn + + + ' Setup Call to Stored Procedure and append parameters + + oCmd.CommandText = "{call byroyalty(?)}" + oCmd.Parameters.Append oCmd.CreateParameter("@Percentage", adInteger, adParamInput) + + + ' Assign value to input parameter + + oCmd("@Percentage") = 75 + + + ' Fire the Stored Proc and assign resulting recordset + ' to our previously created object variable + + Set oRs = oCmd.Execute + %> + + Author ID = <% Response.Write oRs("au_id") %>
+ + + diff --git a/aspclassiccompiler/Backup/AspWebApp/Database/Update.asp b/aspclassiccompiler/Backup/AspWebApp/Database/Update.asp new file mode 100644 index 0000000..c4842fb --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/Database/Update.asp @@ -0,0 +1,54 @@ +<%@ LANGUAGE = VBScript %> +<% Option Explicit %> + + + + + Update Database + + + + + + + + Update Database
+ +


+ + <% + Dim oConn ' object for ADODB.Connection obj + Dim oRs ' object for output recordset object + Dim filePath ' Directory of authors.mdb file + + + ' Map authors database to physical path + filePath = Server.MapPath("authors.mdb") + + ' Create ADO Connection Component to connect with sample database + + Set oConn = Server.CreateObject("ADODB.Connection") + oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & filePath + + ' To add, delete and update recordset, it is recommended to use + ' direct SQL statement instead of ADO methods. + oConn.Execute "Update Authors Set Author ='Scott Clinton'" _ + & "where Author='Scott Guthrie' " + Set oRs = oConn.Execute ( "select * from Authors where author" _ + & "= 'Scott Clinton'" ) + %> + + Changed Author: <%= oRs("Author") %>, <%= oRs("Yearborn") %>

+ + <% + oConn.Execute "Update Authors Set Author ='Scott Guthrie'" _ + & "where Author='Scott Clinton' " + Set oRs = oConn.Execute ( "select * from Authors where author" _ + & "= 'Scott Guthrie'" ) + %> + + Changed Author: <%= oRs("Author") %>, <%= oRs("Yearborn") %> + + + diff --git a/aspclassiccompiler/Backup/AspWebApp/Database/adovbs.inc b/aspclassiccompiler/Backup/AspWebApp/Database/adovbs.inc new file mode 100644 index 0000000..21a2d28 --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/Database/adovbs.inc @@ -0,0 +1,33 @@ +<% +'-------------------------------------------------------------------- +' Microsoft ADO +' +' Copyright (c) 1996-1998 Microsoft Corporation. +' +' +' +' ADO constants include file for VBScript +' +'-------------------------------------------------------------------- + +'---- CursorTypeEnum Values ---- +Const adOpenForwardOnly = 0 +Const adOpenKeyset = 1 +Const adOpenDynamic = 2 +Const adOpenStatic = 3 + +'---- CursorOptionEnum Values ---- +Const adHoldRecords = &H00000100 +Const adMovePrevious = &H00000200 +Const adAddNew = &H01000400 +Const adDelete = &H01000800 + +'... +'... Lots more lines like the ones above go here ... +'... + +'---- RecordTypeEnum Values ---- +Const adSimpleRecord = 0 +Const adCollectionRecord = 1 +Const adStructDoc = 2 +%> diff --git a/aspclassiccompiler/Backup/AspWebApp/Properties/AssemblyInfo.cs b/aspclassiccompiler/Backup/AspWebApp/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..71e952c --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("AspWebApp")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("DLRSoft")] +[assembly: AssemblyProduct("VBScript.NET")] +[assembly: AssemblyCopyright("Copyright © DLRSoft 2009")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("3d5900ae-111a-45be-96b3-d9e4606ca793")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("0.5.2.32072")] diff --git a/aspclassiccompiler/Backup/AspWebApp/Simple/Arrays.asp b/aspclassiccompiler/Backup/AspWebApp/Simple/Arrays.asp new file mode 100644 index 0000000..21588ba --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/Simple/Arrays.asp @@ -0,0 +1,112 @@ +<%@ LANGUAGE = VBScript %> +<% Option Explicit %> + + + +<% + 'Declare a simple fixed size array. + Dim aFixed(4) + + 'Declare a dynamic (resizable) array. + Dim aColors() + + + 'Assign values to fixed size array. + + aFixed(0) = "Fixed" + aFixed(1) = "Size" + aFixed(2) = "Array" + aFixed(3) = "Session ID: " & Session.SessionID + + + 'Allocate storage for the array. + Redim aColors(14) + + 'Store values representing a simple color table + 'to each of the elements. + + aColors(0) = "RED" '[#FF0000] + aColors(1) = "GREEN" '[#008000] + aColors(2) = "BLUE" '[#0000FF] + aColors(3) = "AQUA" '[#00FFFF] + aColors(4) = "YELLOW" '[#FFFF00] + aColors(5) = "FUCHSIA" '[#FF00FF] + aColors(6) = "GRAY" '[#808080] + aColors(7) = "LIME" '[#00FF00] + aColors(8) = "MAROON" '[#800000] + aColors(9) = "NAVY" '[#000080] + aColors(10) = "OLIVE" '[#808000] + aColors(11) = "PURPLE" '[#800080] + aColors(12) = "SILVER" '[#C0C0C0] + aColors(13) = "TEAL" '[#008080] +%> + + + + Array Sample + + + + + + + + Array Sample
+ +


+ + + + + + + + + + + + + +
+ + A Resizable Array
+
+
+ + A Fixed Size (4 element) Array
+
+
+ <% + Dim intColors + Dim i + + 'Calculate array size. + intColors = UBound(aColors) + + 'Print out contents of resizable array into + 'table column. + + For i = 0 To intColors - 1 + Response.Write("" & aColors(i) &"
") + Next + %> +
+ <% + 'Calculate Array Size. + intColors = UBound(aFixed) + + + 'Print out contents of fixed array into table + 'column. + + For i = 0 To intColors -1 + Response.Write(aFixed(i) & "
") + Next + %> +
+ + diff --git a/aspclassiccompiler/Backup/AspWebApp/Simple/Components.Asp b/aspclassiccompiler/Backup/AspWebApp/Simple/Components.Asp new file mode 100644 index 0000000..d0108b4 --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/Simple/Components.Asp @@ -0,0 +1,40 @@ +<%@ LANGUAGE = VBScript %> +<% Option Explicit %> + + + + + + Using Components + + + + + + + + + Using Components with ASP
+ +
+ + This script uses the Tools component that + comes with IIS to generate a random number. +
+
+ + <% + Dim objExample + + 'Instantiate Component on the Server. + Set objExample = Server.CreateObject("MSWC.Tools") + %> + + Random Number = <%= objExample.Random() %> + + + diff --git a/aspclassiccompiler/Backup/AspWebApp/Simple/Conditional.asp b/aspclassiccompiler/Backup/AspWebApp/Simple/Conditional.asp new file mode 100644 index 0000000..ecf93f0 --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/Simple/Conditional.asp @@ -0,0 +1,60 @@ +<%@ LANGUAGE = VBScript %> +<% Option Explicit %> + + + + + + Conditional Operator Sample + + + + + + + + + Conditional Operator Sample
+ +
+ + + <% + Dim varDate + varDate = Date() + %> + +

The date is: <%= varDate %>

+ + <% + 'Select Case statement to display a message based on the day of the month. + Select Case Day(varDate) + Case 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 + Response.Write("

It's the beginning of the month.

") + + Case 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 + Response.Write("

It's the middle of the month.

") + + Case Else + Response.Write("

It's the end of the month.

") + End Select + %> + +

The time is: <%= Time %>

+ + <% + 'Check for AM/PM, and output appropriate message. + + If (Right(Time,2)="AM") Then + Response.Write("

Good Morning

") + Else + Response.Write("

Good Evening

") + End If + %> + + + diff --git a/aspclassiccompiler/Backup/AspWebApp/Simple/Functions.asp b/aspclassiccompiler/Backup/AspWebApp/Simple/Functions.asp new file mode 100644 index 0000000..3279680 --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/Simple/Functions.asp @@ -0,0 +1,54 @@ +<%@ LANGUAGE = VBScript %> +<% Option Explicit %> + + + + + + + + + Functions + + + + + + + Server Side Functions
+ +

+ The function "PrintOutMsg" prints out a specific message a set number of times.

+ + + <% + 'Store number of times function printed message. + Dim intTimes + + 'Call function. + intTimes = PrintOutMsg("This is a function test!", 4) + + 'Output the function return value. + Response.Write("

The function printed out the message " & intTimes & " times.") + %> + + diff --git a/aspclassiccompiler/Backup/AspWebApp/Simple/HeaderInfo.Asp b/aspclassiccompiler/Backup/AspWebApp/Simple/HeaderInfo.Asp new file mode 100644 index 0000000..f99ef4b --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/Simple/HeaderInfo.Asp @@ -0,0 +1 @@ +This text is coming from HeaderInfo.asp. \ No newline at end of file diff --git a/aspclassiccompiler/Backup/AspWebApp/Simple/Includes.asp b/aspclassiccompiler/Backup/AspWebApp/Simple/Includes.asp new file mode 100644 index 0000000..2e2ed64 --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/Simple/Includes.asp @@ -0,0 +1,32 @@ +<%@ LANGUAGE = VBScript %> +<% Option Explicit %> + + + + + + Server Side Includes + + + + + + + + Server Side Includes
+ + +

Server-Side Includes can be done using the + #Include File command. The below text in bold + has been generated with a Server-Side Include: + +

+ +

Include files can be referenced using either + absolute or relative paths.
+ + diff --git a/aspclassiccompiler/Backup/AspWebApp/Simple/Looping.asp b/aspclassiccompiler/Backup/AspWebApp/Simple/Looping.asp new file mode 100644 index 0000000..4b0b7a4 --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/Simple/Looping.asp @@ -0,0 +1,71 @@ +<%@ LANGUAGE = VBScript %> +<% Option Explicit %> + + + + + + Looping + + + + + + + + + Looping with ASP
+ +


+ + + + <% + Dim intCounter + For intCounter = 1 to 5 %> + + > + + Hello World with a For Loop!
+
+ + <% next %> +
+ + + + <% + intCounter = 1 + While(intCounter < 6) %> + + > + + Hello World with a While Loop!
+
+ + <% intCounter = intCounter + 1 %> + + <% wend %> +
+ + + + + <% + intCounter = 1 + Do While(intCounter < 6) %> + + > + + Hello World with a Do...While Loop!
+
+ + <% intCounter = intCounter+1 %> + + <% loop %> + + diff --git a/aspclassiccompiler/Backup/AspWebApp/Simple/Variables.asp b/aspclassiccompiler/Backup/AspWebApp/Simple/Variables.asp new file mode 100644 index 0000000..f779b8e --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/Simple/Variables.asp @@ -0,0 +1,90 @@ +<%@ LANGUAGE = VBScript %> +<% Option Explicit %> + + + + + + + Variable Sample + + + + + + + + Variable Sample
+ +
+

Integer Manipulation

+ + <% + 'Declare variable. + Dim intVar + + 'Assign the variable an integer value. + intVar = 5 + %> + + +

<%= intVar %> + <%= intVar %> = <%= intVar + intVar %>

+ + +
+

String Manipulation

+ + <% + 'Declare variable. + Dim strVar + + 'Assign the variable a string value. + strVar = "Jemearl" + %> + +

This example was done by <%= strVar + " Smith" %>

+ + +
+

Boolean Manipulation

+ + <% + 'Declare variable. + Dim blnVar + + 'Assign the variable a Boolean value. + blnVar = true + + 'Output message based on value. + If (blnVar) Then + Response.Write "

The Boolean value is True.

" + Else + Response.Write "

The Boolean value is False.

" + End If + %> + +
+

Date and Time

+ + <% + 'Declare variable. + Dim dtmVar + + 'Assign the variable a value. + dtmVar = #08 / 27 / 97 5:11:42pm# + %> + +

The date and time is <%= dtmVar %> + + <% + 'Set the variable to the web server date and time. + dtmVar = Now() + %> + +

The system date and time is <%= dtmVar %>

+ + diff --git a/aspclassiccompiler/Backup/AspWebApp/Web.config b/aspclassiccompiler/Backup/AspWebApp/Web.config new file mode 100644 index 0000000..3834862 --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/Web.config @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/aspclassiccompiler/Backup/AspWebApp/components/AdRotator.asp b/aspclassiccompiler/Backup/AspWebApp/components/AdRotator.asp new file mode 100644 index 0000000..7129629 --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/components/AdRotator.asp @@ -0,0 +1,34 @@ +<%@ LANGUAGE = VBScript %> +<% Option Explicit %> + + + + + + Ad Rotator Sample + + + + + + + + Ad Rotator Sample
+ +
+ + + <% + Dim objAd + Set objAd = Server.CreateObject("MSWC.AdRotator") + %> + + <%= objAd.GetAdvertisement("adrot.txt") %> + Revisit Page + + + diff --git a/aspclassiccompiler/Backup/AspWebApp/components/BrowserCap.asp b/aspclassiccompiler/Backup/AspWebApp/components/BrowserCap.asp new file mode 100644 index 0000000..ec72dd9 --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/components/BrowserCap.asp @@ -0,0 +1,170 @@ +<% @ LANGUAGE = VBScript %> +<% Option Explicit %> +<% Response.Buffer=TRue %> +<% Response.Expires=-1 %> + + + + + + + + + + Using the Browser Capabilities Component + + + +

Using the Browser Capabilities Component

+
+ + <% + Dim objBrowsCap + Set objBrowsCap = Server.CreateObject("MSWC.BrowserType") + %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <% If objBrowsCap.browser = "IE" and objBrowsCap.version >4 then %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <% End if %> + +
Cap NameValue
browser <% = objBrowsCap.browser %>
version <% = objBrowsCap.version %>
cookies <% = objBrowsCap.cookies %>
javaapplets<% = objBrowsCap.javaapplets %>
VBScript<% = objBrowsCap.VBScript %>
JavaScript<%=objBrowsCap.JavaScript%>
platform<% = objBrowsCap.platform %>
New Feature for IE5
horizontal resolution<% = objBrowsCap.width %>
vertical resolution<% = objBrowsCap.height %>
availHeight<% = objBrowsCap.availHeight %>
availWidth<% = objBrowsCap.availWidth %>
Buffer Depth<% = objBrowsCap.bufferDepth %>
Color Depth<% = objBrowsCap.colorDepth %>
Java enabled ?<% = objBrowsCap.javaEnabled %>
cpu Class<% = objBrowsCap.cpuClass %>
system Language<% = objBrowsCap.systemLanguage %>
user Language<% = objBrowsCap.userLanguage %>
connectionType (lan, modem, offline)<% = objBrowsCap.connectionType %>
Is Java installed ?<% = objBrowsCap.Java%>
MSJava version<% = objBrowsCap.javaVersion%>
Is MSJava version equal to "5,0,3016,0" ?<% = objBrowsCap.compVersion%>
+ + + + + + + + + + + + + + + + + + + + + + diff --git a/aspclassiccompiler/Backup/AspWebApp/components/CDO.Asp b/aspclassiccompiler/Backup/AspWebApp/components/CDO.Asp new file mode 100644 index 0000000..f087c4d --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/components/CDO.Asp @@ -0,0 +1,48 @@ +<%@ Language = VBScript %> +<% Option Explicit %> + + + + + + + CDO Component + + + + + + + + + CDO Component + +

This sample demonstrates how to use the Collaboration + Data Objects for NTS Component to send a simple + e-mail message. + +

To actually send the message, you must have the SMTP + Server that comes with the Windows NT Option Pack Installed. + + <% + Dim objMyMail + Set objMyMail = Server.CreateObject("CDONTS.NewMail") + + 'For demonstration purposes, both From and To + 'properties are set to the same address. + + objMyMail.From = "someone@Microsoft.com" + objMyMail.To = "someone@Microsoft.com" + + objMyMail.Subject = "Sample" + objMyMail.Body = "I hope you like the sample" + + 'Send the message + objMyMail.Send + %> + + diff --git a/aspclassiccompiler/Backup/AspWebApp/components/ContentRotator.Asp b/aspclassiccompiler/Backup/AspWebApp/components/ContentRotator.Asp new file mode 100644 index 0000000..f753064 --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/components/ContentRotator.Asp @@ -0,0 +1,46 @@ +<%@ LANGUAGE = VBScript %> +<% Option Explicit %> + + + + +<% + 'Make sure that the client-browser doesn't cache. + + Response.Expires = 0 +%> + + + + + Content Rotator Sample + + + + + + + + + Content Rotator Sample
+ +


+ + <% + Dim objContRot + Set objContRot = Server.CreateObject("MSWC.ContentRotator") + + 'Specify the file that has the content. + + Response.Write(objContRot.ChooseContent("tiprot.txt")) + %> + +
+ Refresh (You may have to do this several times) + + + diff --git a/aspclassiccompiler/Backup/AspWebApp/components/Counters/Docs/Contents.Htm b/aspclassiccompiler/Backup/AspWebApp/components/Counters/Docs/Contents.Htm new file mode 100644 index 0000000..76d1ab4 --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/components/Counters/Docs/Contents.Htm @@ -0,0 +1,15 @@ +Contents + +
+
    + Counters Component
    +
      + Counters Component
      + Get method
      + Increment method
      + Remove method
      + Set method
      +
    +
+
+ diff --git a/aspclassiccompiler/Backup/AspWebApp/components/Counters/Docs/Counter1.Htm b/aspclassiccompiler/Backup/AspWebApp/components/Counters/Docs/Counter1.Htm new file mode 100644 index 0000000..dbfa39a --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/components/Counters/Docs/Counter1.Htm @@ -0,0 +1,143 @@ + + + + + +Counters Component + + + + + + + + +

Counters Component

+ +

The Counter component creates a Counters object that can create, store, +increment, and retrieve any number of individual counters.

+ +

A counter is a persistent value that contains an integer. You can manipulate a counter +with the Get, Increment, Set, and Remove methods of the Counters +object. Once you create the counter, it persists until you remove it.

+ +

Counters do not automatically increment on an event like a page hit. You must manually +set or increment counters using the Set and Increment methods.

+ +

Counters are not limited in scope. Once you create a counter, any page on your site can +retrieve or manipulate its value. For example, if you increment and display a counter +named hits in a page called Page1.asp, and you increment hits in another +page called Page2.asp, both pages will increment the same counter. If you hit Page1.asp, +and increment hits to 34, hitting Page2.asp will increment hits to 35. The +next time you hit Page1.asp, hits will increment to 36.

+ +

All counters are stored in a single text file, Counters.txt, which is located in the +same directory as the Counters.dll file.

+ +

File Names

+ + + + + + + + + + +
Counters.dllThe Counters component.
Counters.txtThe file that stores all individual counters on a site. Counters.txt is a UTF8-encoded + file. You can have any Unicode characters in a counter name.
+ +


+

+ +

Syntax

+ +

Create the Counters object one time on your server by adding the following to +the Global.asa file:

+ +
<OBJECT 
+RUNAT=Server 
+SCOPE=Application 
+ID=Counter 
+PROGID="MSWC.Counters"> 
+</OBJECT>
+ +

Registry Entries

+ +

None.

+ +

Remarks

+ +

Only create one Counters object in your site. This single Counters object +can create any number of individual counters.

+ +

Note For Personal Web Server on Windows 95, a Counters component has already +been specified in the Global.asa file in the default virtual directory. You can work with +the Counters object the component creates as if it were a built-in object by +calling Counters.Get, Counters.Increment, Counters.Remove, and Counters.Set. You should not create another instance of the Counters object.

+ +

Methods

+ + + + + + + + + + + + + + + + + + +
Get Returns the value of the counter.
Increment Increases the counter by 1.
Remove Removes the counter from the Counters.txt file.
Set Sets the value of the counter to a specific integer.
+ +


+

+ +

Example

+ +

Create an instance of the Counters object in the Global.asa file with the ID +attribute set to Counter:

+ +
<OBJECT RUNAT=Server SCOPE=Application ID=Counter PROGID="MSWC.Counters"> </OBJECT>
+ 
+ +

You can then use that Counters object on one page to create all the counters you +need:

+ +
There have been <%= Counter.Increment('defaultPageHits') %> to this site.
+ 
+ +

Then on another page you can increment the counter in the following manner:

+ +
You are visitor number<%= Counter.Increment('LinksPageHits') %> to this page.
+ 
+
+ + diff --git a/aspclassiccompiler/Backup/AspWebApp/components/Counters/Docs/Counter2.Htm b/aspclassiccompiler/Backup/AspWebApp/components/Counters/Docs/Counter2.Htm new file mode 100644 index 0000000..784c889 --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/components/Counters/Docs/Counter2.Htm @@ -0,0 +1,85 @@ + + + + + +Get + + + + + + + + +

Get

+ +

The Get method takes the name of a counter and returns the current value of the +counter. If the counter doesn't exist, the method creates it and sets it to 0.

+ +

Syntax

+ +
Counters.Get(CounterName)
+ 
+ +

Parameters

+ +
+
CounterName
+
A string containing the name of the counter.
+
+ +

Example

+ +

Display the value a counter with <%= Counters.Get(CounterName) %>. +Assign the value of the counter to a variable with <% countervar = Counters.Get(CounterName) +%>.

+ +

The following script displays the vote tally from a poll about favorite colors.

+ +
<% If colornumber = "1" Then 
+    Counters.Increment("greencounter") 
+Else 
+    If colornumber = "2" Then 
+        Counters.Increment("bluecounter") 
+    Else 
+        If colornumber = "0" Then 
+            Counters.Increment("redcounter") 
+        End If 
+    End If 
+End If %>
+<P>Current vote tally:
+<P>red: <% =Counters.Get("redcounter") %>
+<P>green: <% = Counters.Get("greencounter") %> 
+<P>blue: <% = Counters.Get("bluecounter") %>
+ 
+ +

Applies To

+ +

Counters component

+ +

See Also

+ +

Increment, Remove, Set

+
+ + diff --git a/aspclassiccompiler/Backup/AspWebApp/components/Counters/Docs/Counter3.Htm b/aspclassiccompiler/Backup/AspWebApp/components/Counters/Docs/Counter3.Htm new file mode 100644 index 0000000..30783c4 --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/components/Counters/Docs/Counter3.Htm @@ -0,0 +1,78 @@ + + + + + +Increment + + + + + + + + +

Increment

+ +

The Increment method takes the name of a counter, adds 1 to the current value of +the counter, and returns the counter's new value. If the counter doesn't exist, the method +creates it and sets its value to 1.

+ +

Syntax

+ +
Counters.Increment(CounterName)
+ 
+ +

Parameters

+ +
+
CounterName
+
A string containing the name of the counter.
+
+ +

Example

+ +

Increment the value of a counter with <% Counters.Increment(CounterName) +%>. Increment and display the value of a counter with <%= +Counters.Increment(CounterName) %>.

+ +

To retrieve the value of a counter, use Counters.Get. To set a counter to a +specific value, use Counters.Set.

+ +

The following code implements a one-line page-hit counter.

+ +
<P>There have been <%= Counters.Increment("hits") %> visits to this Web page. </P>
+ 
+ +

In this example, Counters.Increment increases the counter by one each time the +client requests the page from the server.

+ +

Applies To

+ +

Counters component

+ +

See Also

+ +

Get, Remove, Set

+
+ + diff --git a/aspclassiccompiler/Backup/AspWebApp/components/Counters/Docs/Counter4.Htm b/aspclassiccompiler/Backup/AspWebApp/components/Counters/Docs/Counter4.Htm new file mode 100644 index 0000000..7546df8 --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/components/Counters/Docs/Counter4.Htm @@ -0,0 +1,68 @@ + + + + + +Remove + + + + + + + + +

Remove

+ +

The Remove method takes the name of a counter, removes the counter from the +Counters object, and deletes the counter from the Counters.txt file.

+ +

Syntax

+ +
Counters.Remove(CounterName)
+ 
+ +

Parameters

+ +
+
CounterName
+
A string containing the name of the counter.
+
+ +

Example

+ +

The following code removes the counter hitscounter from the Counters.txt +file.

+ +
<% Counters.Remove(hitscounter) %> 
+ 
+ +

Applies To

+ +

Counters component

+ +

See Also

+ +

Get, Increment, Set

+
+ + diff --git a/aspclassiccompiler/Backup/AspWebApp/components/Counters/Docs/Counter5.Htm b/aspclassiccompiler/Backup/AspWebApp/components/Counters/Docs/Counter5.Htm new file mode 100644 index 0000000..dbe15e8 --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/components/Counters/Docs/Counter5.Htm @@ -0,0 +1,74 @@ + + + + + +Set + + + + + + + + +

Set

+ +

The Set method takes the name of a counter and an integer, sets the counter to +the value of the integer, and returns the new value. If the counter doesn't exist, Counters.Set +creates it and sets it to the value of the integer.

+ +

To retrieve the value of a counter, use Counters.Get. To increment a counter by +1, use Counters.Increment.

+ +

Syntax

+ +
Counters.Set(CounterName, int)
+ 
+ +

Parameters

+ +
+
CounterName
+
A string containing the name of the counter.
+
+
int
+
The new integer value for CounterName.
+
+ +

Example

+ +

The following code resets the hit counter pageHits to 0:

+ +
<% Counters.Set(pageHits, 0) %> 
+ 
+ +

Applies To

+ +

Counter component

+ +

See Also

+ +

Get, Increment, Remove

+
+ + diff --git a/aspclassiccompiler/Backup/AspWebApp/components/Counters/Docs/Default.Htm b/aspclassiccompiler/Backup/AspWebApp/components/Counters/Docs/Default.Htm new file mode 100644 index 0000000..202d47d --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/components/Counters/Docs/Default.Htm @@ -0,0 +1,16 @@ + + + + +Counters Component + + + + + + + <body> + </body> + + + diff --git a/aspclassiccompiler/Backup/AspWebApp/components/Counters/Sample/Counters_JScript.Asp b/aspclassiccompiler/Backup/AspWebApp/components/Counters/Sample/Counters_JScript.Asp new file mode 100644 index 0000000..b3a1457 --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/components/Counters/Sample/Counters_JScript.Asp @@ -0,0 +1,33 @@ +<%@ LANGUAGE="JSCRIPT" %> + + + + + +Document Title + + +

Demo of the Counters ASP Component

+ +<% + +var ObjCounter; +var nCount; + + +try +{ + ObjCounter = Application("MSCounters"); + nCount = ObjCounter.Increment("NoOfHits") ; +} +catch (err) +{ + Response.Write ("

Error: Could not get the instance of the Counters Object.
Error Code:" + err.errCode ); + Response.End(); +} + Response.Write ("

There have been "+ nCount + " visits to this Web page. Refresh this page to increment
the counter.

"); + +%> + + + diff --git a/aspclassiccompiler/Backup/AspWebApp/components/Counters/Sample/Counters_VBScript.Asp b/aspclassiccompiler/Backup/AspWebApp/components/Counters/Sample/Counters_VBScript.Asp new file mode 100644 index 0000000..744dcdd --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/components/Counters/Sample/Counters_VBScript.Asp @@ -0,0 +1,31 @@ +<%@ LANGUAGE="VBSCRIPT" %> + + + + + +Document Title + + +

Demo of the Counters ASP Component

+ +<% +On Error Resume Next + +Dim ObjCounter +Dim nCount + + +Set ObjCounter = Application("MSCounters") +nCount = ObjCounter.Increment("NoOfHits") + + +If (Err <> 0) then + Response.Write ("

Error: Could not get the instance of the Counters Object.
Error Code:" + CStr(nErr) ) +Else + Response.Write ("

There have been "+ CStr(nCount) + " visits to this Web page. Refresh this page to increment
the counter.

") +End If +%> + + + diff --git a/aspclassiccompiler/Backup/AspWebApp/components/Counters/Sample/Global.Asa b/aspclassiccompiler/Backup/AspWebApp/components/Counters/Sample/Global.Asa new file mode 100644 index 0000000..72a5879 --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/components/Counters/Sample/Global.Asa @@ -0,0 +1,41 @@ + \ No newline at end of file diff --git a/aspclassiccompiler/Backup/AspWebApp/components/Counters/TOURL.Htm b/aspclassiccompiler/Backup/AspWebApp/components/Counters/TOURL.Htm new file mode 100644 index 0000000..6ae91a1 --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/components/Counters/TOURL.Htm @@ -0,0 +1,2 @@ + diff --git a/aspclassiccompiler/Backup/AspWebApp/components/FileSystem.Asp b/aspclassiccompiler/Backup/AspWebApp/components/FileSystem.Asp new file mode 100644 index 0000000..397280a --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/components/FileSystem.Asp @@ -0,0 +1,68 @@ +<%@ Language = VBScript %> +<% Option Explicit %> + + + + +<% + 'Define constants. + + Const FORREADING = 1 + Const FORWRITING = 2 + Const FORAPPENDING = 8 +%> + + + + + FileSystem Component + + + + + + + + FileSystem Component
+ +
+ + + <% + Dim curDir + Dim objScriptObject, objMyFile + Dim x + + 'Map current path to physical path. + + curDir = Server.MapPath("/components") + + + 'Create FileSytemObject component. + + Set objScriptObject = Server.CreateObject("Scripting.FileSystemObject") + + + 'Create and write to a file. + + Set objMyFile = objScriptObject.CreateTextFile(curDir + "\" + "MyTextFile.txt", FORWRITING) + + For x = 1 to 5 + objMyFile.WriteLine "Line number " & x & " was written on " & now & "
" + Next + + objMyfile.Close + %> + + <% + 'Read from file and output to screen. + Set objMyFile = objScriptObject.OpenTextFile(curDir + "\" + "MyTextFile.txt", FORREADING) + Response.Write objMyFile.ReadAll + %> + + + diff --git a/aspclassiccompiler/Backup/AspWebApp/components/PermissionCheck.Asp b/aspclassiccompiler/Backup/AspWebApp/components/PermissionCheck.Asp new file mode 100644 index 0000000..86e168d --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/components/PermissionCheck.Asp @@ -0,0 +1,38 @@ +<%@ Language = VBScript%> +<% Option Explicit %> + + + + + + Permission Checker + + + + + + + + Permission Checker
+ + <% + 'Instantiate Permission Checker Component. + + Dim objPermCheck + Set objPermCheck = Server.CreateObject("MSWC.PermissionChecker") + %> + +

Verify current user's access to a sample file: + +

Using Physical Path = + <%= objPermCheck.HasAccess(".\PermissionCheck_VBScript.asp") %>
+ +

Using Virtual Path = + <%= objPermCheck.HasAccess("/iissamples/sdk/asp/components/PermissionCheck_VBScript.asp") %> + + + diff --git a/aspclassiccompiler/Backup/AspWebApp/components/Tiprot.Txt b/aspclassiccompiler/Backup/AspWebApp/components/Tiprot.Txt new file mode 100644 index 0000000..e65b21e --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/components/Tiprot.Txt @@ -0,0 +1,12 @@ +%% #1 +Don't run with scissors. + +%% #1 +%% // Additional line of comments +%% // Yet another line of comments + + Let a

smile

be your umbrella. + + +%% #1 + diff --git a/aspclassiccompiler/Backup/AspWebApp/components/Tools.Asp b/aspclassiccompiler/Backup/AspWebApp/components/Tools.Asp new file mode 100644 index 0000000..e5d48b0 --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/components/Tools.Asp @@ -0,0 +1,96 @@ +<%@ LANGUAGE = VBScript %> +<% Option Explicit %> + + + + + + + Tools Component + + + + + + + + + Tools Component
+
+ + <% + Dim objTools + Dim FoundFile, blnFileExists, blnFileDoesNotExist, NotFoundFile + Dim intRand, intRandPos, intRandBelow + + 'Create the Tools Object + + Set objTools = Server.CreateObject("MSWC.Tools") + %> + + +

FileExists Example

+ <% + FoundFile = "Tools_VBScript.asp" + NotFoundFile = "blah.asp" + + 'Check if file exists. + + blnFileExists = objTools.FileExists(FoundFile) + + + 'Output response appropriately. + + If (blnFileExists) Then + Response.Write "The File " & FoundFile & " Exists
" + Else + Response.Write "The File " & FoundFile & " Does Not Exist
" + End If + + + 'Check if file exists. + + blnFileDoesNotExist = objTools.FileExists(NotFoundFile) + + + 'Output response appropriately. + + If (blnFileDoesNotExist) Then + Response.Write "The File " & NotFoundFile & " Exists" + Else + Response.write "The File " & NotFoundFile & " Does Not Exist" + End If + %> + + +

Random Integer Example

+ <% + 'Random integer. + + intRand = objTools.Random + Response.Write "Random integer: " + Response.Write intRand + Response.Write "
" + + + 'Positive random integer. + + intRandPos = Abs( objTools.Random ) + Response.Write "Positive random integer: " + Response.Write intRandPos + Response.Write "
" + + + 'Positive random integer between 0 and 100. + + intRandBelow = Abs( objTools.Random ) Mod 100 + Response.write "Random integer below 100: " + Response.write intRandBelow + Response.write "
" + %> + + diff --git a/aspclassiccompiler/Backup/AspWebApp/components/adrot.txt b/aspclassiccompiler/Backup/AspWebApp/components/adrot.txt new file mode 100644 index 0000000..dc71a30 --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/components/adrot.txt @@ -0,0 +1,14 @@ +Redirect www.microsoft.com +width 88 +height 31 +border 1 +* +nts_iis.gif +http://www.microsoft.com/ntserver/web/default.asp +Microsoft Internet Information Services +80 +ie.gif +- +Microsoft Internet Explorer +20 + diff --git a/aspclassiccompiler/Backup/AspWebApp/components/clientcap.htm b/aspclassiccompiler/Backup/AspWebApp/components/clientcap.htm new file mode 100644 index 0000000..d7f59a5 --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/components/clientcap.htm @@ -0,0 +1,74 @@ + + + + + + + + + + + + diff --git a/aspclassiccompiler/Backup/AspWebApp/components/ie.gif b/aspclassiccompiler/Backup/AspWebApp/components/ie.gif new file mode 100644 index 0000000..3c7cd36 Binary files /dev/null and b/aspclassiccompiler/Backup/AspWebApp/components/ie.gif differ diff --git a/aspclassiccompiler/Backup/AspWebApp/components/nts_iis.gif b/aspclassiccompiler/Backup/AspWebApp/components/nts_iis.gif new file mode 100644 index 0000000..e5474df Binary files /dev/null and b/aspclassiccompiler/Backup/AspWebApp/components/nts_iis.gif differ diff --git a/aspclassiccompiler/Backup/AspWebApp/default.htm b/aspclassiccompiler/Backup/AspWebApp/default.htm new file mode 100644 index 0000000..792a31e --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/default.htm @@ -0,0 +1,48 @@ + + + + + + +

This project contains some ASP Classic Compiler Samples Pages

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FolderFileComments
ComponentsIIS 5 Platform SDK Sample. Need to install the COM components. Components like + BrowserCap will not work because it requires the COM+ comtext to accesses the + Request object.
FileSystem.aspWorks without registering any component. Need to grant ASP worker process account read/write access to the directory.
Tools.aspTested in Windows XP. Failed to register the component in Vista.
DatabaseIIS 5 Platform SDK Sample. Some the Access samples tested. Make sure that the OLEDB provider is installed. Need read/write access to the access.mdb in the directory.
SimpleIIS 5 Platform SDK Sample. All the samples tested.
testSome small samples used during development.
+ + diff --git a/aspclassiccompiler/Backup/AspWebApp/test/BuiltinConstants.asp b/aspclassiccompiler/Backup/AspWebApp/test/BuiltinConstants.asp new file mode 100644 index 0000000..416ad14 --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/test/BuiltinConstants.asp @@ -0,0 +1,13 @@ + + + + + <%=vbSunday %>
+ <%=vbMonday %>
+ <%=vbTuesday %>
+ <%=vbWednesday %>
+ <%=vbThursday %>
+ <%=vbFriday %>
+ <%=vbSaturday %>
+ + \ No newline at end of file diff --git a/aspclassiccompiler/Backup/AspWebApp/test/byref.asp b/aspclassiccompiler/Backup/AspWebApp/test/byref.asp new file mode 100644 index 0000000..8b56930 --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/test/byref.asp @@ -0,0 +1,15 @@ +<% + sub main() + dim a + a = 2 + mysub a + response.Write a + end sub + + sub mysub(a) + a = a + 1 + response.Write a + end sub + + main +%> \ No newline at end of file diff --git a/aspclassiccompiler/Backup/AspWebApp/test/byref2.asp b/aspclassiccompiler/Backup/AspWebApp/test/byref2.asp new file mode 100644 index 0000000..799455b --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/test/byref2.asp @@ -0,0 +1,8 @@ +<% + sub mysub(byval a) + a = a + 1 + response.Write a + end sub + + mysub 5 +%> \ No newline at end of file diff --git a/aspclassiccompiler/Backup/AspWebApp/test/call.asp b/aspclassiccompiler/Backup/AspWebApp/test/call.asp new file mode 100644 index 0000000..19e7c36 --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/test/call.asp @@ -0,0 +1,12 @@ + + + + +<% + Response.Write("Something") + Response.Write(1) + Response.Write " MORE" + Call Response.Write(" CALL ") +%> + + \ No newline at end of file diff --git a/aspclassiccompiler/Backup/AspWebApp/test/datatypes.asp b/aspclassiccompiler/Backup/AspWebApp/test/datatypes.asp new file mode 100644 index 0000000..1f39ff3 --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/test/datatypes.asp @@ -0,0 +1,11 @@ + + + + + Vartype of 123456 is <%=VarType(123456) %>
+ Vartype of .23456 is <%=VarType(.23456) %>
+ VarType of <%=Server.HtmlEncode("&hFFFFFF")%> is <%=VarType(&hFFFFFF) %>
+ VarType of 1.23e-3 is <%=VarType(1.23e-3)%>
+ VarType of #12/21/1999# is <%=VarType(#12/21/1999#)%>
+ + \ No newline at end of file diff --git a/aspclassiccompiler/Backup/AspWebApp/test/datetest.asp b/aspclassiccompiler/Backup/AspWebApp/test/datetest.asp new file mode 100644 index 0000000..46c781b --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/test/datetest.asp @@ -0,0 +1,25 @@ + + + + + + +<%= WeekdayName(Weekday(DateSerial(1963, 11, 22))) %> +<%= WeekdayName(Weekday(DateSerial(1963, 10, 15))) %> +<%= WeekdayName(Weekday(DateSerial(1995, 6, 2))) %> +<%= WeekdayName(Weekday(DateSerial(1997, 5, 5))) %> +<% +setlocale(4100) +for i = 1 to 7 + Response.Write(weekdayname(i) & "
") +next + %> + <% + for i = 1 to 12 + Response.Write(monthname(i) & "
") +next + %> + <%=FormatDateTime(DateSerial(1997, 5, 5), 1) %> +<%=FormatCurrency(10000000) %> + + diff --git a/aspclassiccompiler/Backup/AspWebApp/test/extension.asp b/aspclassiccompiler/Backup/AspWebApp/test/extension.asp new file mode 100644 index 0000000..8a2708d --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/test/extension.asp @@ -0,0 +1,6 @@ +<% +option explicit +dim s +s = "111-222-3333" +response.Write s.RemoveNonNumeric() +%> \ No newline at end of file diff --git a/aspclassiccompiler/Backup/AspWebApp/test/forloop.asp b/aspclassiccompiler/Backup/AspWebApp/test/forloop.asp new file mode 100644 index 0000000..6b95815 --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/test/forloop.asp @@ -0,0 +1,17 @@ +<% +option explicit +%> + + + + +<% + dim i + for i = 1 to 8 + response.write i + next + + response.write i +%> + + \ No newline at end of file diff --git a/aspclassiccompiler/Backup/AspWebApp/test/function.asp b/aspclassiccompiler/Backup/AspWebApp/test/function.asp new file mode 100644 index 0000000..d6cb9f1 --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/test/function.asp @@ -0,0 +1,24 @@ +<% +option explicit +%> + + + + +<% +sub printnum(n) + response.write n + for i = 1 to n + response.write i + next +end sub + +dim i + +printnum 5 + + + +%> + + \ No newline at end of file diff --git a/aspclassiccompiler/Backup/AspWebApp/test/if.asp b/aspclassiccompiler/Backup/AspWebApp/test/if.asp new file mode 100644 index 0000000..84af213 --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/test/if.asp @@ -0,0 +1,24 @@ +<% +option explicit +%> + + + + +<% + dim i, color + + i = 3 + if i = 1 then + color = "red" + elseif i = 2 then + color = "green" + elseif i = 3 then + color = "blue" + else + color = "blank" + end if + response.write color +%> + + \ No newline at end of file diff --git a/aspclassiccompiler/Backup/AspWebApp/test/ifnull.asp b/aspclassiccompiler/Backup/AspWebApp/test/ifnull.asp new file mode 100644 index 0000000..ad6aa60 --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/test/ifnull.asp @@ -0,0 +1,10 @@ +<% +option explicit + Dim oConn + Dim oRs + oRs = "something" + If oRs.EOF Then + End If + + +%> \ No newline at end of file diff --git a/aspclassiccompiler/Backup/AspWebApp/test/imports.asp b/aspclassiccompiler/Backup/AspWebApp/test/imports.asp new file mode 100644 index 0000000..d0f2163 --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/test/imports.asp @@ -0,0 +1,12 @@ +<% +imports system + +dim sb + +sb = new System.Text.StringBuilder() +sb.append("this") +sb.append(" is ") +sb.append(" stringbuilder!") +response.write sb.toString() + +%> \ No newline at end of file diff --git a/aspclassiccompiler/Backup/AspWebApp/test/literals.asp b/aspclassiccompiler/Backup/AspWebApp/test/literals.asp new file mode 100644 index 0000000..0992b5c --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/test/literals.asp @@ -0,0 +1,12 @@ + + + + + Integer <%=123456 %>
+ Floating Point <%=.23456 %>
+ Hex <%=&hFFFFFF%>
+ Oct <%=&123456& %>
+ Exponent <%=1.23e-3%>
+ Date <%=#12/21/1999#%>
+ + \ No newline at end of file diff --git a/aspclassiccompiler/Backup/AspWebApp/test/perftest.asp b/aspclassiccompiler/Backup/AspWebApp/test/perftest.asp new file mode 100644 index 0000000..bbb3e44 --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/test/perftest.asp @@ -0,0 +1,20 @@ +<% +option explicit + +dim loops +dim counter +dim tickes + +tickes = Timer() +loops = 10000000 +counter = 0.0 + +while loops > 0 + loops = loops - 1 + counter = counter + 1.0 +wend + +Response.Write("DoLoop result " & counter & "
") +Response.Write("Executing the while loop took: " & ((Timer()-tickes) * 1000.0) & "ms" & "
") + +%> \ No newline at end of file diff --git a/aspclassiccompiler/Backup/AspWebApp/test/perftest2.asp b/aspclassiccompiler/Backup/AspWebApp/test/perftest2.asp new file mode 100644 index 0000000..8d9f0c0 --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/test/perftest2.asp @@ -0,0 +1,24 @@ +<% +option explicit + +perftest + +sub perftest() + dim loops + dim counter + dim tickes + tickes = Timer() + + loops = 10000000 + counter = 0.0 + + while loops > 0 + loops = loops - 1 + counter = counter + 1.0 + wend + + Response.Write("DoLoop result " & counter & "
") + Response.Write("Executing the while loop took: " & ((Timer()-tickes) * 1000.0) & "ms" & "
") +end sub + +%> \ No newline at end of file diff --git a/aspclassiccompiler/Backup/AspWebApp/test/servervars.asp b/aspclassiccompiler/Backup/AspWebApp/test/servervars.asp new file mode 100644 index 0000000..0e01e03 --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/test/servervars.asp @@ -0,0 +1,14 @@ + + + + + <% + url = Request.ServerVariables("HTTP_URL") +x = instr(1, url, "url=", 1) +if x > 0 then + url = Mid(url, x + 4) +end if + %> + <%=url%> + + \ No newline at end of file diff --git a/aspclassiccompiler/Backup/AspWebApp/test/with.asp b/aspclassiccompiler/Backup/AspWebApp/test/with.asp new file mode 100644 index 0000000..5902895 --- /dev/null +++ b/aspclassiccompiler/Backup/AspWebApp/test/with.asp @@ -0,0 +1,15 @@ + + + + + <% with response %> + <%.Write vbSunday %>
+ <%.Write vbMonday %>
+ <%.Write vbTuesday %>
+ <%.Write vbWednesday %>
+ <%.Write vbThursday %>
+ <%.Write vbFriday %>
+ <%.Write vbSaturday %>
+ <% end with %> + + \ No newline at end of file diff --git a/aspclassiccompiler/Backup/NerdDinnerAsp/Content/Site.css b/aspclassiccompiler/Backup/NerdDinnerAsp/Content/Site.css new file mode 100644 index 0000000..8dd7ee2 --- /dev/null +++ b/aspclassiccompiler/Backup/NerdDinnerAsp/Content/Site.css @@ -0,0 +1,378 @@ +/*---------------------------------------------------------- +The base color for this template is #5c87b2. If you'd like +to use a different color start by replacing all instances of +#5c87b2 with your new color. +----------------------------------------------------------*/ +body +{ + background-color: #5c87b2; + font-size: .75em; + font-family: Verdana, Helvetica, Sans-Serif; + margin: 0; + padding: 0; + color: #696969; +} + +a:link +{ + color: #034af3; + text-decoration: underline; +} +a:visited +{ + color: #505abc; +} +a:hover +{ + color: #1d60ff; + text-decoration: none; +} +a:active +{ + color: #12eb87; +} + +p, ul +{ + margin-bottom: 20px; + line-height: 1.6em; +} + +/* HEADINGS +----------------------------------------------------------*/ +h1, h2, h3, h4, h5, h6 +{ + font-size: 1.5em; + color: #000; + font-family: Arial, Helvetica, sans-serif; +} + +h1 +{ + font-size: 2em; + padding-bottom: 0; + margin-bottom: 0; +} +h2 +{ + padding: 0 0 10px 0; +} +h3 +{ + font-size: 1.2em; +} +h4 +{ + font-size: 1.1em; +} +h5, h6 +{ + font-size: 1em; +} + +/* this rule styles

tags that are the +first child of the left and right table columns */ +.rightColumn > h1, .rightColumn > h2, .leftColumn > h1, .leftColumn > h2 +{ + margin-top: 0; +} + +/* PRIMARY LAYOUT ELEMENTS +----------------------------------------------------------*/ + +/* you can specify a greater or lesser percentage for the +page width. Or, you can specify an exact pixel width. */ +.page +{ + width: 90%; + margin-left: auto; + margin-right: auto; +} + +#header +{ + position: relative; + margin-bottom: 0px; + color: #000; + padding: 0; +} + +#header h1 +{ + font-weight: bold; + padding: 5px 0; + margin: 0; + color: #fff; + border: none; + line-height: 2em; + font-family: Arial, Helvetica, sans-serif; + font-size: 32px !important; +} + +#main +{ + padding: 30px 30px 15px 30px; + background-color: #fff; + margin-bottom: 30px; + _height: 1px; /* only IE6 applies CSS properties starting with an underscrore */ + height: 590px; +} + +#footer +{ + color: #999; + padding: 10px 0; + text-align: center; + line-height: normal; + margin: 0; + font-size: .9em; +} + +/* TAB MENU +----------------------------------------------------------*/ +ul#menu +{ + border-bottom: 1px #5C87B2 solid; + padding: 0 0 2px; + position: relative; + margin: 0; + text-align: right; +} + +ul#menu li +{ + display: inline; + list-style: none; +} + +ul#menu li#greeting +{ + padding: 10px 20px; + font-weight: bold; + text-decoration: none; + line-height: 2.8em; + color: #fff; +} + +ul#menu li a +{ + padding: 10px 20px; + font-weight: bold; + text-decoration: none; + line-height: 2.8em; + background-color: #e8eef4; + color: #034af3; +} + +ul#menu li a:hover +{ + background-color: #fff; + text-decoration: none; +} + +ul#menu li a:active +{ + background-color: #a6e2a6; + text-decoration: none; +} + +ul#menu li.selected a +{ + background-color: #fff; + color: #000; +} + +/* FORM LAYOUT ELEMENTS +----------------------------------------------------------*/ + +fieldset +{ + margin: 1em 0; + padding: 1em; + border: 1px solid #CCC; +} + +fieldset p +{ + margin: 2px 12px 10px 10px; +} + +fieldset label +{ + display: block; +} + +fieldset label.inline +{ + display: inline; +} + +legend +{ + font-size: 1.1em; + font-weight: 600; + padding: 2px 4px 8px 4px; +} + +input[type="text"] +{ + width: 200px; + border: 1px solid #CCC; +} + +input[type="password"] +{ + width: 200px; + border: 1px solid #CCC; +} + +/* TABLE +----------------------------------------------------------*/ + +table +{ + border: solid 1px #e8eef4; + border-collapse: collapse; +} + +table td +{ + padding: 5px; + border: solid 1px #e8eef4; +} + +table th +{ + padding: 6px 5px; + text-align: left; + background-color: #e8eef4; + border: solid 1px #e8eef4; +} + +/* MISC +----------------------------------------------------------*/ +.clear +{ + clear: both; +} + +.error +{ + color:Red; +} + +#menucontainer +{ + margin-top:40px; +} + +div#title +{ + display:block; + float:left; + text-align:left; +} + +#logindisplay +{ + font-size:1.1em; + display:block; + text-align:right; + margin:10px; + color:White; +} + +#logindisplay a:link +{ + color: white; + text-decoration: underline; +} + +#logindisplay a:visited +{ + color: white; + text-decoration: underline; +} + +#logindisplay a:hover +{ + color: white; + text-decoration: none; +} + +.field-validation-error +{ + color: #ff0000; +} + +.input-validation-error +{ + border: 1px solid #ff0000; + background-color: #ffeeee; +} + +.validation-summary-errors +{ + font-weight: bold; + color: #ff0000; +} + +#dinnerform textarea +{ + width:200px; + height:70px; +} + +#dinnerDiv textarea +{ + width:200px; + height:70px; +} + +#rsvpmsg +{ + color:Red; +} + +hr +{ + padding:0px, 10px, 0px, 10px; + height:1px; +} + +#pagination +{ + text-align:center; +} + +#dinnerDiv { + float: left; + width: 280px; +} + +#mapDiv { + float: left; +} + +#mapDivLeft { + float: left; +} + +#mapDivRight { + padding: 30px 0px 0px 20px; + float: left; +} + +#dinnerList { + padding:0px 0px 0px 0px; +} + +#searchBox { + padding:0px 0px 10px 0px; +} + +#theMap { + position: relative; + width: 500px; + height: 450px; +} \ No newline at end of file diff --git a/aspclassiccompiler/Backup/NerdDinnerAsp/Content/nerd.jpg b/aspclassiccompiler/Backup/NerdDinnerAsp/Content/nerd.jpg new file mode 100644 index 0000000..f60b5b4 Binary files /dev/null and b/aspclassiccompiler/Backup/NerdDinnerAsp/Content/nerd.jpg differ diff --git a/aspclassiccompiler/Backup/NerdDinnerAsp/Controllers/AccountController.cs b/aspclassiccompiler/Backup/NerdDinnerAsp/Controllers/AccountController.cs new file mode 100644 index 0000000..d2b5661 --- /dev/null +++ b/aspclassiccompiler/Backup/NerdDinnerAsp/Controllers/AccountController.cs @@ -0,0 +1,297 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Security.Principal; +using System.Web; +using System.Web.Mvc; +using System.Web.Security; +using System.Web.UI; + +namespace NerdDinner.Controllers { + + [HandleError] + public class AccountController : Controller { + + // This constructor is used by the MVC framework to instantiate the controller using + // the default forms authentication and membership providers. + + public AccountController() + : this(null, null) { + } + + // This constructor is not used by the MVC framework but is instead provided for ease + // of unit testing this type. See the comments at the end of this file for more + // information. + public AccountController(IFormsAuthentication formsAuth, IMembershipService service) { + FormsAuth = formsAuth ?? new FormsAuthenticationService(); + MembershipService = service ?? new AccountMembershipService(); + } + + public IFormsAuthentication FormsAuth { + get; + private set; + } + + public IMembershipService MembershipService { + get; + private set; + } + + public ActionResult LogOn() { + + return View(); + } + + [AcceptVerbs(HttpVerbs.Post)] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings", + Justification = "Needs to take same parameter type as Controller.Redirect()")] + public ActionResult LogOn(string userName, string password, bool rememberMe, string returnUrl) { + + if (!ValidateLogOn(userName, password)) { + ViewData["rememberMe"] = rememberMe; + return View(); + } + + FormsAuth.SignIn(userName, rememberMe); + if (!String.IsNullOrEmpty(returnUrl)) { + return Redirect(returnUrl); + } + else { + return RedirectToAction("Index", "Home"); + } + } + + public ActionResult LogOff() { + + FormsAuth.SignOut(); + + return RedirectToAction("Index", "Home"); + } + + public ActionResult Register() { + + ViewData["PasswordLength"] = MembershipService.MinPasswordLength; + + return View(); + } + + [AcceptVerbs(HttpVerbs.Post)] + public ActionResult Register(string userName, string email, string password, string confirmPassword) { + + ViewData["PasswordLength"] = MembershipService.MinPasswordLength; + + if (ValidateRegistration(userName, email, password, confirmPassword)) { + // Attempt to register the user + MembershipCreateStatus createStatus = MembershipService.CreateUser(userName, password, email); + + if (createStatus == MembershipCreateStatus.Success) { + FormsAuth.SignIn(userName, false /* createPersistentCookie */); + return RedirectToAction("Index", "Home"); + } + else { + ModelState.AddModelError("_FORM", ErrorCodeToString(createStatus)); + } + } + + // If we got this far, something failed, redisplay form + return View(); + } + + [Authorize] + public ActionResult ChangePassword() { + + ViewData["PasswordLength"] = MembershipService.MinPasswordLength; + + return View(); + } + + [Authorize] + [AcceptVerbs(HttpVerbs.Post)] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", + Justification = "Exceptions result in password not being changed.")] + public ActionResult ChangePassword(string currentPassword, string newPassword, string confirmPassword) { + + ViewData["PasswordLength"] = MembershipService.MinPasswordLength; + + if (!ValidateChangePassword(currentPassword, newPassword, confirmPassword)) { + return View(); + } + + try { + if (MembershipService.ChangePassword(User.Identity.Name, currentPassword, newPassword)) { + return RedirectToAction("ChangePasswordSuccess"); + } + else { + ModelState.AddModelError("_FORM", "The current password is incorrect or the new password is invalid."); + return View(); + } + } + catch { + ModelState.AddModelError("_FORM", "The current password is incorrect or the new password is invalid."); + return View(); + } + } + + public ActionResult ChangePasswordSuccess() { + + return View(); + } + + protected override void OnActionExecuting(ActionExecutingContext filterContext) { + if (filterContext.HttpContext.User.Identity is WindowsIdentity) { + throw new InvalidOperationException("Windows authentication is not supported."); + } + } + + #region Validation Methods + + private bool ValidateChangePassword(string currentPassword, string newPassword, string confirmPassword) { + if (String.IsNullOrEmpty(currentPassword)) { + ModelState.AddModelError("currentPassword", "You must specify a current password."); + } + if (newPassword == null || newPassword.Length < MembershipService.MinPasswordLength) { + ModelState.AddModelError("newPassword", + String.Format(CultureInfo.CurrentCulture, + "You must specify a new password of {0} or more characters.", + MembershipService.MinPasswordLength)); + } + + if (!String.Equals(newPassword, confirmPassword, StringComparison.Ordinal)) { + ModelState.AddModelError("_FORM", "The new password and confirmation password do not match."); + } + + return ModelState.IsValid; + } + + private bool ValidateLogOn(string userName, string password) { + if (String.IsNullOrEmpty(userName)) { + ModelState.AddModelError("username", "You must specify a username."); + } + if (String.IsNullOrEmpty(password)) { + ModelState.AddModelError("password", "You must specify a password."); + } + if (!MembershipService.ValidateUser(userName, password)) { + ModelState.AddModelError("_FORM", "The username or password provided is incorrect."); + } + + return ModelState.IsValid; + } + + private bool ValidateRegistration(string userName, string email, string password, string confirmPassword) { + if (String.IsNullOrEmpty(userName)) { + ModelState.AddModelError("username", "You must specify a username."); + } + if (String.IsNullOrEmpty(email)) { + ModelState.AddModelError("email", "You must specify an email address."); + } + if (password == null || password.Length < MembershipService.MinPasswordLength) { + ModelState.AddModelError("password", + String.Format(CultureInfo.CurrentCulture, + "You must specify a password of {0} or more characters.", + MembershipService.MinPasswordLength)); + } + if (!String.Equals(password, confirmPassword, StringComparison.Ordinal)) { + ModelState.AddModelError("_FORM", "The new password and confirmation password do not match."); + } + return ModelState.IsValid; + } + + private static string ErrorCodeToString(MembershipCreateStatus createStatus) { + // See http://msdn.microsoft.com/en-us/library/system.web.security.membershipcreatestatus.aspx for + // a full list of status codes. + switch (createStatus) { + case MembershipCreateStatus.DuplicateUserName: + return "Username already exists. Please enter a different user name."; + + case MembershipCreateStatus.DuplicateEmail: + return "A username for that e-mail address already exists. Please enter a different e-mail address."; + + case MembershipCreateStatus.InvalidPassword: + return "The password provided is invalid. Please enter a valid password value."; + + case MembershipCreateStatus.InvalidEmail: + return "The e-mail address provided is invalid. Please check the value and try again."; + + case MembershipCreateStatus.InvalidAnswer: + return "The password retrieval answer provided is invalid. Please check the value and try again."; + + case MembershipCreateStatus.InvalidQuestion: + return "The password retrieval question provided is invalid. Please check the value and try again."; + + case MembershipCreateStatus.InvalidUserName: + return "The user name provided is invalid. Please check the value and try again."; + + case MembershipCreateStatus.ProviderError: + return "The authentication provider returned an error. Please verify your entry and try again. If the problem persists, please contact your system administrator."; + + case MembershipCreateStatus.UserRejected: + return "The user creation request has been canceled. Please verify your entry and try again. If the problem persists, please contact your system administrator."; + + default: + return "An unknown error occurred. Please verify your entry and try again. If the problem persists, please contact your system administrator."; + } + } + #endregion + } + + // The FormsAuthentication type is sealed and contains static members, so it is difficult to + // unit test code that calls its members. The interface and helper class below demonstrate + // how to create an abstract wrapper around such a type in order to make the AccountController + // code unit testable. + + public interface IFormsAuthentication { + void SignIn(string userName, bool createPersistentCookie); + void SignOut(); + } + + public class FormsAuthenticationService : IFormsAuthentication { + public void SignIn(string userName, bool createPersistentCookie) { + FormsAuthentication.SetAuthCookie(userName, createPersistentCookie); + } + public void SignOut() { + FormsAuthentication.SignOut(); + } + } + + public interface IMembershipService { + int MinPasswordLength { get; } + + bool ValidateUser(string userName, string password); + MembershipCreateStatus CreateUser(string userName, string password, string email); + bool ChangePassword(string userName, string oldPassword, string newPassword); + } + + public class AccountMembershipService : IMembershipService { + private MembershipProvider _provider; + + public AccountMembershipService() + : this(null) { + } + + public AccountMembershipService(MembershipProvider provider) { + _provider = provider ?? Membership.Provider; + } + + public int MinPasswordLength { + get { + return _provider.MinRequiredPasswordLength; + } + } + + public bool ValidateUser(string userName, string password) { + return _provider.ValidateUser(userName, password); + } + + public MembershipCreateStatus CreateUser(string userName, string password, string email) { + MembershipCreateStatus status; + _provider.CreateUser(userName, password, email, null, null, true, null, out status); + return status; + } + + public bool ChangePassword(string userName, string oldPassword, string newPassword) { + MembershipUser currentUser = _provider.GetUser(userName, true /* userIsOnline */); + return currentUser.ChangePassword(oldPassword, newPassword); + } + } +} diff --git a/aspclassiccompiler/Backup/NerdDinnerAsp/Controllers/DinnersController.cs b/aspclassiccompiler/Backup/NerdDinnerAsp/Controllers/DinnersController.cs new file mode 100644 index 0000000..381f465 --- /dev/null +++ b/aspclassiccompiler/Backup/NerdDinnerAsp/Controllers/DinnersController.cs @@ -0,0 +1,189 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web.Mvc; +using NerdDinner.Helpers; +using NerdDinner.Models; + +namespace NerdDinner.Controllers { + + // + // ViewModel Classes + + public class DinnerFormViewModel { + + // Properties + public Dinner Dinner { get; private set; } + public SelectList Countries { get; private set; } + + // Constructor + public DinnerFormViewModel(Dinner dinner) { + Dinner = dinner; + Countries = new SelectList(PhoneValidator.Countries, Dinner.Country); + } + } + + // + // Controller Class + + [HandleError] + public class DinnersController : Controller { + + IDinnerRepository dinnerRepository; + + // + // Dependency Injection enabled constructors + + public DinnersController() + : this(new DinnerRepository()) { + } + + public DinnersController(IDinnerRepository repository) { + dinnerRepository = repository; + } + + // + // GET: /Dinners/ + // /Dinners/Page/2 + + public ActionResult Index(int? page) { + + const int pageSize = 10; + + var upcomingDinners = dinnerRepository.FindUpcomingDinners(); + var paginatedDinners = new PaginatedList(upcomingDinners, page ?? 0, pageSize); + + return View(paginatedDinners); + } + + // + // GET: /Dinners/Details/5 + + public ActionResult Details(int id) { + + Dinner dinner = dinnerRepository.GetDinner(id); + + if (dinner == null) + return View("NotFound"); + + return View(dinner); + } + + // + // GET: /Dinners/Edit/5 + + [Authorize] + public ActionResult Edit(int id) { + + Dinner dinner = dinnerRepository.GetDinner(id); + + if (!dinner.IsHostedBy(User.Identity.Name)) + return View("InvalidOwner"); + + return View(new DinnerFormViewModel(dinner)); + } + + // + // POST: /Dinners/Edit/5 + + [AcceptVerbs(HttpVerbs.Post), Authorize] + public ActionResult Edit(int id, FormCollection collection) { + + Dinner dinner = dinnerRepository.GetDinner(id); + + if (!dinner.IsHostedBy(User.Identity.Name)) + return View("InvalidOwner"); + + try { + UpdateModel(dinner); + + dinnerRepository.Save(); + + return RedirectToAction("Details", new { id=dinner.DinnerID }); + } + catch { + ModelState.AddModelErrors(dinner.GetRuleViolations()); + + return View(new DinnerFormViewModel(dinner)); + } + } + + // + // GET: /Dinners/Create + + [Authorize] + public ActionResult Create() { + + Dinner dinner = new Dinner() { + EventDate = DateTime.Now.AddDays(7) + }; + + return View(new DinnerFormViewModel(dinner)); + } + + // + // POST: /Dinners/Create + + [AcceptVerbs(HttpVerbs.Post), Authorize] + public ActionResult Create(Dinner dinner) { + + if (ModelState.IsValid) { + + try { + dinner.HostedBy = User.Identity.Name; + + RSVP rsvp = new RSVP(); + rsvp.AttendeeName = User.Identity.Name; + dinner.RSVPs.Add(rsvp); + + dinnerRepository.Add(dinner); + dinnerRepository.Save(); + + return RedirectToAction("Details", new { id=dinner.DinnerID }); + } + catch { + ModelState.AddModelErrors(dinner.GetRuleViolations()); + } + } + + return View(new DinnerFormViewModel(dinner)); + } + + // + // HTTP GET: /Dinners/Delete/1 + + [Authorize] + public ActionResult Delete(int id) { + + Dinner dinner = dinnerRepository.GetDinner(id); + + if (dinner == null) + return View("NotFound"); + + if (!dinner.IsHostedBy(User.Identity.Name)) + return View("InvalidOwner"); + + return View(dinner); + } + + // + // HTTP POST: /Dinners/Delete/1 + + [AcceptVerbs(HttpVerbs.Post), Authorize] + public ActionResult Delete(int id, string confirmButton) { + + Dinner dinner = dinnerRepository.GetDinner(id); + + if (dinner == null) + return View("NotFound"); + + if (!dinner.IsHostedBy(User.Identity.Name)) + return View("InvalidOwner"); + + dinnerRepository.Delete(dinner); + dinnerRepository.Save(); + + return View("Deleted"); + } + } +} diff --git a/aspclassiccompiler/Backup/NerdDinnerAsp/Controllers/HomeController.cs b/aspclassiccompiler/Backup/NerdDinnerAsp/Controllers/HomeController.cs new file mode 100644 index 0000000..8b52b8d --- /dev/null +++ b/aspclassiccompiler/Backup/NerdDinnerAsp/Controllers/HomeController.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Mvc; + +namespace NerdDinner.Controllers { + + [HandleError] + public class HomeController : Controller { + + public ActionResult Index() { + return View(); + } + + public ActionResult About() { + return View(); + } + } +} diff --git a/aspclassiccompiler/Backup/NerdDinnerAsp/Controllers/RSVPController.cs b/aspclassiccompiler/Backup/NerdDinnerAsp/Controllers/RSVPController.cs new file mode 100644 index 0000000..7b71cb9 --- /dev/null +++ b/aspclassiccompiler/Backup/NerdDinnerAsp/Controllers/RSVPController.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Mvc; +using NerdDinner.Models; + +namespace NerdDinner.Controllers +{ + public class RSVPController : Controller { + + IDinnerRepository dinnerRepository; + + // + // Dependency Injection enabled constructors + + public RSVPController() + : this(new DinnerRepository()) { + } + + public RSVPController(IDinnerRepository repository) { + dinnerRepository = repository; + } + + // + // AJAX: /Dinners/Register/1 + + [Authorize, AcceptVerbs(HttpVerbs.Post)] + public ActionResult Register(int id) { + + Dinner dinner = dinnerRepository.GetDinner(id); + + if (!dinner.IsUserRegistered(User.Identity.Name)) { + + RSVP rsvp = new RSVP(); + rsvp.AttendeeName = User.Identity.Name; + + dinner.RSVPs.Add(rsvp); + dinnerRepository.Save(); + } + + return Content("Thanks - we'll see you there!"); + } + } +} diff --git a/aspclassiccompiler/Backup/NerdDinnerAsp/Controllers/SearchController.cs b/aspclassiccompiler/Backup/NerdDinnerAsp/Controllers/SearchController.cs new file mode 100644 index 0000000..fb782a8 --- /dev/null +++ b/aspclassiccompiler/Backup/NerdDinnerAsp/Controllers/SearchController.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Mvc; +using NerdDinner.Models; + +namespace NerdDinner.Controllers { + + public class JsonDinner { + public int DinnerID { get; set; } + public string Title { get; set; } + public double Latitude { get; set; } + public double Longitude { get; set; } + public string Description { get; set; } + public int RSVPCount { get; set; } + } + + public class SearchController : Controller { + + IDinnerRepository dinnerRepository; + + // + // Dependency Injection enabled constructors + + public SearchController() + : this(new DinnerRepository()) { + } + + public SearchController(IDinnerRepository repository) { + dinnerRepository = repository; + } + + // + // AJAX: /Search/FindByLocation?longitude=45&latitude=-90 + + [AcceptVerbs(HttpVerbs.Post)] + public ActionResult SearchByLocation(float latitude, float longitude) { + + var dinners = dinnerRepository.FindByLocation(latitude, longitude); + + var jsonDinners = from dinner in dinners + select new JsonDinner { + DinnerID = dinner.DinnerID, + Latitude = dinner.Latitude, + Longitude = dinner.Longitude, + Title = dinner.Title, + Description = dinner.Description, + RSVPCount = dinner.RSVPs.Count + }; + + return Json(jsonDinners.ToList()); + } + } +} diff --git a/aspclassiccompiler/Backup/NerdDinnerAsp/Default.aspx b/aspclassiccompiler/Backup/NerdDinnerAsp/Default.aspx new file mode 100644 index 0000000..f639413 --- /dev/null +++ b/aspclassiccompiler/Backup/NerdDinnerAsp/Default.aspx @@ -0,0 +1,3 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="NerdDinner._Default" %> + +<%-- Please do not delete this file. It is used to ensure that ASP.NET MVC is activated by IIS when a user makes a "/" request to the server. --%> diff --git a/aspclassiccompiler/Backup/NerdDinnerAsp/Default.aspx.cs b/aspclassiccompiler/Backup/NerdDinnerAsp/Default.aspx.cs new file mode 100644 index 0000000..16a8f6e --- /dev/null +++ b/aspclassiccompiler/Backup/NerdDinnerAsp/Default.aspx.cs @@ -0,0 +1,13 @@ +using System.Web; +using System.Web.Mvc; +using System.Web.UI; + +namespace NerdDinner { + public partial class _Default : Page { + public void Page_Load(object sender, System.EventArgs e) { + HttpContext.Current.RewritePath(Request.ApplicationPath, false); + IHttpHandler httpHandler = new MvcHttpHandler(); + httpHandler.ProcessRequest(HttpContext.Current); + } + } +} diff --git a/aspclassiccompiler/Backup/NerdDinnerAsp/Global.asax b/aspclassiccompiler/Backup/NerdDinnerAsp/Global.asax new file mode 100644 index 0000000..8b18fdb --- /dev/null +++ b/aspclassiccompiler/Backup/NerdDinnerAsp/Global.asax @@ -0,0 +1 @@ +<%@ Application Codebehind="Global.asax.cs" Inherits="NerdDinner.MvcApplication" Language="C#" %> diff --git a/aspclassiccompiler/Backup/NerdDinnerAsp/Global.asax.cs b/aspclassiccompiler/Backup/NerdDinnerAsp/Global.asax.cs new file mode 100644 index 0000000..961c768 --- /dev/null +++ b/aspclassiccompiler/Backup/NerdDinnerAsp/Global.asax.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Mvc; +using System.Web.Routing; +using Dlrsoft.Asp.Mvc; + +namespace NerdDinner { + + public class MvcApplication : System.Web.HttpApplication { + + public void RegisterRoutes(RouteCollection routes) { + + routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); + + routes.MapRoute( + "UpcomingDinners", + "Dinners/Page/{page}", + new { controller = "Dinners", action = "Index" } + ); + + routes.MapRoute( + "Default", // Route name + "{controller}/{action}/{id}", // URL with parameters + new { controller = "Home", action = "Index", id = "" } // Parameter defaults + ); + } + + void Application_Start() { + RegisterRoutes(RouteTable.Routes); + ViewEngines.Engines.Clear(); + ViewEngines.Engines.Add(new AspViewEngine()); + ViewEngines.Engines.Add(new WebFormViewEngine()); + } + } +} \ No newline at end of file diff --git a/aspclassiccompiler/Backup/NerdDinnerAsp/Helpers/ControllerHelpers.cs b/aspclassiccompiler/Backup/NerdDinnerAsp/Helpers/ControllerHelpers.cs new file mode 100644 index 0000000..ea6b24e --- /dev/null +++ b/aspclassiccompiler/Backup/NerdDinnerAsp/Helpers/ControllerHelpers.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using NerdDinner.Models; +using System.Web.Mvc; + +namespace NerdDinner.Helpers { + + public static class ModelStateHelpers { + + public static void AddModelErrors(this ModelStateDictionary modelState, IEnumerable errors) { + + foreach (RuleViolation issue in errors) { + modelState.AddModelError(issue.PropertyName, issue.ErrorMessage); + } + } + } +} diff --git a/aspclassiccompiler/Backup/NerdDinnerAsp/Helpers/PaginatedList.cs b/aspclassiccompiler/Backup/NerdDinnerAsp/Helpers/PaginatedList.cs new file mode 100644 index 0000000..e8c3dbc --- /dev/null +++ b/aspclassiccompiler/Backup/NerdDinnerAsp/Helpers/PaginatedList.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace NerdDinner.Helpers { + + public class PaginatedList : List { + + public int PageIndex { get; private set; } + public int PageSize { get; private set; } + public int TotalCount { get; private set; } + public int TotalPages { get; private set; } + + public PaginatedList(IQueryable source, int pageIndex, int pageSize) { + PageIndex = pageIndex; + PageSize = pageSize; + TotalCount = source.Count(); + TotalPages = (int) Math.Ceiling(TotalCount / (double)PageSize); + + this.AddRange(source.Skip(PageIndex * PageSize).Take(PageSize)); + } + + public bool HasPreviousPage { + get { + return (PageIndex > 0); + } + } + + public bool HasNextPage { + get { + return (PageIndex+1 < TotalPages); + } + } + } +} diff --git a/aspclassiccompiler/Backup/NerdDinnerAsp/Helpers/PhoneValidator.cs b/aspclassiccompiler/Backup/NerdDinnerAsp/Helpers/PhoneValidator.cs new file mode 100644 index 0000000..2a3e590 --- /dev/null +++ b/aspclassiccompiler/Backup/NerdDinnerAsp/Helpers/PhoneValidator.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Text.RegularExpressions; + +namespace NerdDinner.Helpers { + + public class PhoneValidator { + + static IDictionary countryRegex = new Dictionary() + { + { "USA", new Regex("^[2-9]\\d{2}-\\d{3}-\\d{4}$")}, + { "UK", new Regex("(^1300\\d{6}$)|(^1800|1900|1902\\d{6}$)|(^0[2|3|7|8]{1}[0-9]{8}$)|(^13\\d{4}$)|(^04\\d{2,3}\\d{6}$)")}, + { "Netherlands", new Regex("(^\\+[0-9]{2}|^\\+[0-9]{2}\\(0\\)|^\\(\\+[0-9]{2}\\)\\(0\\)|^00[0-9]{2}|^0)([0-9]{9}$|[0-9\\-\\s]{10}$)")}, + }; + + public static bool IsValidNumber(string phoneNumber, string country) { + + if (country != null && countryRegex.ContainsKey(country)) + return countryRegex[country].IsMatch(phoneNumber); + else + return false; + } + + public static IEnumerable Countries { + get { + return countryRegex.Keys; + } + } + } +} diff --git a/aspclassiccompiler/Backup/NerdDinnerAsp/Models/Dinner.cs b/aspclassiccompiler/Backup/NerdDinnerAsp/Models/Dinner.cs new file mode 100644 index 0000000..8f26640 --- /dev/null +++ b/aspclassiccompiler/Backup/NerdDinnerAsp/Models/Dinner.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Data.Linq; +using System.Web.Mvc; +using NerdDinner.Helpers; + +namespace NerdDinner.Models { + + [Bind(Include="Title,Description,EventDate,Address,Country,ContactPhone,Latitude,Longitude")] + public partial class Dinner { + + public bool IsHostedBy(string userName) { + return HostedBy.Equals(userName, StringComparison.InvariantCultureIgnoreCase); + } + + public bool IsUserRegistered(string userName) { + return RSVPs.Any(r => r.AttendeeName.Equals(userName, StringComparison.InvariantCultureIgnoreCase)); + } + + public bool IsValid { + get { return (GetRuleViolations().Count() == 0); } + } + + public IEnumerable GetRuleViolations() { + + if (String.IsNullOrEmpty(Title)) + yield return new RuleViolation("Title is required", "Title"); + + if (String.IsNullOrEmpty(Description)) + yield return new RuleViolation("Description is required", "Description"); + + if (String.IsNullOrEmpty(HostedBy)) + yield return new RuleViolation("HostedBy is required", "HostedBy"); + + if (String.IsNullOrEmpty(Address)) + yield return new RuleViolation("Address is required", "Address"); + + if (String.IsNullOrEmpty(Country)) + yield return new RuleViolation("Country is required", "Address"); + + if (String.IsNullOrEmpty(ContactPhone)) + yield return new RuleViolation("Phone# is required", "ContactPhone"); + + if (!PhoneValidator.IsValidNumber(ContactPhone, Country)) + yield return new RuleViolation("Phone# does not match country", "ContactPhone"); + + yield break; + } + + partial void OnValidate(ChangeAction action) { + if (!IsValid) + throw new ApplicationException("Rule violations prevent saving"); + } + } +} diff --git a/aspclassiccompiler/Backup/NerdDinnerAsp/Models/DinnerRepository.cs b/aspclassiccompiler/Backup/NerdDinnerAsp/Models/DinnerRepository.cs new file mode 100644 index 0000000..e018d7c --- /dev/null +++ b/aspclassiccompiler/Backup/NerdDinnerAsp/Models/DinnerRepository.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace NerdDinner.Models { + + public class DinnerRepository : NerdDinner.Models.IDinnerRepository { + + NerdDinnerDataContext db = new NerdDinnerDataContext(); + + // + // Query Methods + + public IQueryable FindAllDinners() { + return db.Dinners; + } + + public IQueryable FindUpcomingDinners() { + return from dinner in FindAllDinners() + where dinner.EventDate > DateTime.Now + orderby dinner.EventDate + select dinner; + } + + public IQueryable FindByLocation(float latitude, float longitude) { + var dinners = from dinner in FindUpcomingDinners() + join i in db.NearestDinners(latitude, longitude) + on dinner.DinnerID equals i.DinnerID + select dinner; + + return dinners; + } + + public Dinner GetDinner(int id) { + return db.Dinners.SingleOrDefault(d => d.DinnerID == id); + } + + // + // Insert/Delete Methods + + public void Add(Dinner dinner) { + db.Dinners.InsertOnSubmit(dinner); + } + + public void Delete(Dinner dinner) { + db.RSVPs.DeleteAllOnSubmit(dinner.RSVPs); + db.Dinners.DeleteOnSubmit(dinner); + } + + // + // Persistence + + public void Save() { + db.SubmitChanges(); + } + } +} diff --git a/aspclassiccompiler/Backup/NerdDinnerAsp/Models/IDinnerRepository.cs b/aspclassiccompiler/Backup/NerdDinnerAsp/Models/IDinnerRepository.cs new file mode 100644 index 0000000..79a6e8a --- /dev/null +++ b/aspclassiccompiler/Backup/NerdDinnerAsp/Models/IDinnerRepository.cs @@ -0,0 +1,18 @@ +using System; +using System.Linq; + +namespace NerdDinner.Models { + + public interface IDinnerRepository { + + IQueryable FindAllDinners(); + IQueryable FindByLocation(float latitude, float longitude); + IQueryable FindUpcomingDinners(); + Dinner GetDinner(int id); + + void Add(Dinner dinner); + void Delete(Dinner dinner); + + void Save(); + } +} diff --git a/aspclassiccompiler/Backup/NerdDinnerAsp/Models/NerdDinner.dbml b/aspclassiccompiler/Backup/NerdDinnerAsp/Models/NerdDinner.dbml new file mode 100644 index 0000000..8b5ee48 --- /dev/null +++ b/aspclassiccompiler/Backup/NerdDinnerAsp/Models/NerdDinner.dbml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/aspclassiccompiler/Backup/NerdDinnerAsp/Models/NerdDinner.dbml.layout b/aspclassiccompiler/Backup/NerdDinnerAsp/Models/NerdDinner.dbml.layout new file mode 100644 index 0000000..7736e82 --- /dev/null +++ b/aspclassiccompiler/Backup/NerdDinnerAsp/Models/NerdDinner.dbml.layout @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/aspclassiccompiler/Backup/NerdDinnerAsp/Models/NerdDinner.designer.cs b/aspclassiccompiler/Backup/NerdDinnerAsp/Models/NerdDinner.designer.cs new file mode 100644 index 0000000..04acff0 --- /dev/null +++ b/aspclassiccompiler/Backup/NerdDinnerAsp/Models/NerdDinner.designer.cs @@ -0,0 +1,583 @@ +#pragma warning disable 1591 +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.3521 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace NerdDinner.Models +{ + using System.Data.Linq; + using System.Data.Linq.Mapping; + using System.Data; + using System.Collections.Generic; + using System.Reflection; + using System.Linq; + using System.Linq.Expressions; + using System.ComponentModel; + using System; + + + [System.Data.Linq.Mapping.DatabaseAttribute(Name="NerdDinner")] + public partial class NerdDinnerDataContext : System.Data.Linq.DataContext + { + + private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource(); + + #region Extensibility Method Definitions + partial void OnCreated(); + partial void InsertDinner(Dinner instance); + partial void UpdateDinner(Dinner instance); + partial void DeleteDinner(Dinner instance); + partial void InsertRSVP(RSVP instance); + partial void UpdateRSVP(RSVP instance); + partial void DeleteRSVP(RSVP instance); + #endregion + + public NerdDinnerDataContext() : + base(global::System.Configuration.ConfigurationManager.ConnectionStrings["NerdDinnerConnectionString"].ConnectionString, mappingSource) + { + OnCreated(); + } + + public NerdDinnerDataContext(string connection) : + base(connection, mappingSource) + { + OnCreated(); + } + + public NerdDinnerDataContext(System.Data.IDbConnection connection) : + base(connection, mappingSource) + { + OnCreated(); + } + + public NerdDinnerDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) : + base(connection, mappingSource) + { + OnCreated(); + } + + public NerdDinnerDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) : + base(connection, mappingSource) + { + OnCreated(); + } + + public System.Data.Linq.Table Dinners + { + get + { + return this.GetTable(); + } + } + + public System.Data.Linq.Table RSVPs + { + get + { + return this.GetTable(); + } + } + + [Function(Name="dbo.NearestDinners", IsComposable=true)] + public IQueryable NearestDinners([Parameter(DbType="Real")] System.Nullable lat, [Parameter(Name="long", DbType="Real")] System.Nullable @long) + { + return this.CreateMethodCallQuery(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), lat, @long); + } + + [Function(Name="dbo.DistanceBetween", IsComposable=true)] + public System.Nullable DistanceBetween([Parameter(Name="Lat1", DbType="Real")] System.Nullable lat1, [Parameter(Name="Long1", DbType="Real")] System.Nullable long1, [Parameter(Name="Lat2", DbType="Real")] System.Nullable lat2, [Parameter(Name="Long2", DbType="Real")] System.Nullable long2) + { + return ((System.Nullable)(this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), lat1, long1, lat2, long2).ReturnValue)); + } + } + + [Table(Name="dbo.Dinners")] + public partial class Dinner : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private int _DinnerID; + + private string _Title; + + private System.DateTime _EventDate; + + private string _Description; + + private string _HostedBy; + + private string _ContactPhone; + + private string _Address; + + private string _Country; + + private double _Latitude; + + private double _Longitude; + + private EntitySet _RSVPs; + + #region Extensibility Method Definitions + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnDinnerIDChanging(int value); + partial void OnDinnerIDChanged(); + partial void OnTitleChanging(string value); + partial void OnTitleChanged(); + partial void OnEventDateChanging(System.DateTime value); + partial void OnEventDateChanged(); + partial void OnDescriptionChanging(string value); + partial void OnDescriptionChanged(); + partial void OnHostedByChanging(string value); + partial void OnHostedByChanged(); + partial void OnContactPhoneChanging(string value); + partial void OnContactPhoneChanged(); + partial void OnAddressChanging(string value); + partial void OnAddressChanged(); + partial void OnCountryChanging(string value); + partial void OnCountryChanged(); + partial void OnLatitudeChanging(double value); + partial void OnLatitudeChanged(); + partial void OnLongitudeChanging(double value); + partial void OnLongitudeChanged(); + #endregion + + public Dinner() + { + this._RSVPs = new EntitySet(new Action(this.attach_RSVPs), new Action(this.detach_RSVPs)); + OnCreated(); + } + + [Column(Storage="_DinnerID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)] + public int DinnerID + { + get + { + return this._DinnerID; + } + set + { + if ((this._DinnerID != value)) + { + this.OnDinnerIDChanging(value); + this.SendPropertyChanging(); + this._DinnerID = value; + this.SendPropertyChanged("DinnerID"); + this.OnDinnerIDChanged(); + } + } + } + + [Column(Storage="_Title", DbType="NVarChar(50) NOT NULL", CanBeNull=false)] + public string Title + { + get + { + return this._Title; + } + set + { + if ((this._Title != value)) + { + this.OnTitleChanging(value); + this.SendPropertyChanging(); + this._Title = value; + this.SendPropertyChanged("Title"); + this.OnTitleChanged(); + } + } + } + + [Column(Storage="_EventDate", DbType="DateTime NOT NULL")] + public System.DateTime EventDate + { + get + { + return this._EventDate; + } + set + { + if ((this._EventDate != value)) + { + this.OnEventDateChanging(value); + this.SendPropertyChanging(); + this._EventDate = value; + this.SendPropertyChanged("EventDate"); + this.OnEventDateChanged(); + } + } + } + + [Column(Storage="_Description", DbType="NVarChar(256)")] + public string Description + { + get + { + return this._Description; + } + set + { + if ((this._Description != value)) + { + this.OnDescriptionChanging(value); + this.SendPropertyChanging(); + this._Description = value; + this.SendPropertyChanged("Description"); + this.OnDescriptionChanged(); + } + } + } + + [Column(Storage="_HostedBy", DbType="NVarChar(50) NOT NULL", CanBeNull=false)] + public string HostedBy + { + get + { + return this._HostedBy; + } + set + { + if ((this._HostedBy != value)) + { + this.OnHostedByChanging(value); + this.SendPropertyChanging(); + this._HostedBy = value; + this.SendPropertyChanged("HostedBy"); + this.OnHostedByChanged(); + } + } + } + + [Column(Storage="_ContactPhone", DbType="NVarChar(50) NOT NULL", CanBeNull=false)] + public string ContactPhone + { + get + { + return this._ContactPhone; + } + set + { + if ((this._ContactPhone != value)) + { + this.OnContactPhoneChanging(value); + this.SendPropertyChanging(); + this._ContactPhone = value; + this.SendPropertyChanged("ContactPhone"); + this.OnContactPhoneChanged(); + } + } + } + + [Column(Storage="_Address", DbType="NVarChar(50)")] + public string Address + { + get + { + return this._Address; + } + set + { + if ((this._Address != value)) + { + this.OnAddressChanging(value); + this.SendPropertyChanging(); + this._Address = value; + this.SendPropertyChanged("Address"); + this.OnAddressChanged(); + } + } + } + + [Column(Storage="_Country", DbType="NVarChar(30)")] + public string Country + { + get + { + return this._Country; + } + set + { + if ((this._Country != value)) + { + this.OnCountryChanging(value); + this.SendPropertyChanging(); + this._Country = value; + this.SendPropertyChanged("Country"); + this.OnCountryChanged(); + } + } + } + + [Column(Storage="_Latitude", DbType="Float NOT NULL")] + public double Latitude + { + get + { + return this._Latitude; + } + set + { + if ((this._Latitude != value)) + { + this.OnLatitudeChanging(value); + this.SendPropertyChanging(); + this._Latitude = value; + this.SendPropertyChanged("Latitude"); + this.OnLatitudeChanged(); + } + } + } + + [Column(Storage="_Longitude", DbType="Float NOT NULL")] + public double Longitude + { + get + { + return this._Longitude; + } + set + { + if ((this._Longitude != value)) + { + this.OnLongitudeChanging(value); + this.SendPropertyChanging(); + this._Longitude = value; + this.SendPropertyChanged("Longitude"); + this.OnLongitudeChanged(); + } + } + } + + [Association(Name="Dinner_RSVP", Storage="_RSVPs", ThisKey="DinnerID", OtherKey="DinnerID")] + public EntitySet RSVPs + { + get + { + return this._RSVPs; + } + set + { + this._RSVPs.Assign(value); + } + } + + public event PropertyChangingEventHandler PropertyChanging; + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void SendPropertyChanging() + { + if ((this.PropertyChanging != null)) + { + this.PropertyChanging(this, emptyChangingEventArgs); + } + } + + protected virtual void SendPropertyChanged(String propertyName) + { + if ((this.PropertyChanged != null)) + { + this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + + private void attach_RSVPs(RSVP entity) + { + this.SendPropertyChanging(); + entity.Dinner = this; + } + + private void detach_RSVPs(RSVP entity) + { + this.SendPropertyChanging(); + entity.Dinner = null; + } + } + + [Table(Name="dbo.RSVP")] + public partial class RSVP : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private int _RsvpID; + + private int _DinnerID; + + private string _AttendeeName; + + private EntityRef _Dinner; + + #region Extensibility Method Definitions + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnRsvpIDChanging(int value); + partial void OnRsvpIDChanged(); + partial void OnDinnerIDChanging(int value); + partial void OnDinnerIDChanged(); + partial void OnAttendeeNameChanging(string value); + partial void OnAttendeeNameChanged(); + #endregion + + public RSVP() + { + this._Dinner = default(EntityRef); + OnCreated(); + } + + [Column(Storage="_RsvpID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)] + public int RsvpID + { + get + { + return this._RsvpID; + } + set + { + if ((this._RsvpID != value)) + { + this.OnRsvpIDChanging(value); + this.SendPropertyChanging(); + this._RsvpID = value; + this.SendPropertyChanged("RsvpID"); + this.OnRsvpIDChanged(); + } + } + } + + [Column(Storage="_DinnerID", DbType="Int NOT NULL")] + public int DinnerID + { + get + { + return this._DinnerID; + } + set + { + if ((this._DinnerID != value)) + { + if (this._Dinner.HasLoadedOrAssignedValue) + { + throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); + } + this.OnDinnerIDChanging(value); + this.SendPropertyChanging(); + this._DinnerID = value; + this.SendPropertyChanged("DinnerID"); + this.OnDinnerIDChanged(); + } + } + } + + [Column(Storage="_AttendeeName", DbType="NVarChar(50) NOT NULL", CanBeNull=false)] + public string AttendeeName + { + get + { + return this._AttendeeName; + } + set + { + if ((this._AttendeeName != value)) + { + this.OnAttendeeNameChanging(value); + this.SendPropertyChanging(); + this._AttendeeName = value; + this.SendPropertyChanged("AttendeeName"); + this.OnAttendeeNameChanged(); + } + } + } + + [Association(Name="Dinner_RSVP", Storage="_Dinner", ThisKey="DinnerID", OtherKey="DinnerID", IsForeignKey=true)] + public Dinner Dinner + { + get + { + return this._Dinner.Entity; + } + set + { + Dinner previousValue = this._Dinner.Entity; + if (((previousValue != value) + || (this._Dinner.HasLoadedOrAssignedValue == false))) + { + this.SendPropertyChanging(); + if ((previousValue != null)) + { + this._Dinner.Entity = null; + previousValue.RSVPs.Remove(this); + } + this._Dinner.Entity = value; + if ((value != null)) + { + value.RSVPs.Add(this); + this._DinnerID = value.DinnerID; + } + else + { + this._DinnerID = default(int); + } + this.SendPropertyChanged("Dinner"); + } + } + } + + public event PropertyChangingEventHandler PropertyChanging; + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void SendPropertyChanging() + { + if ((this.PropertyChanging != null)) + { + this.PropertyChanging(this, emptyChangingEventArgs); + } + } + + protected virtual void SendPropertyChanged(String propertyName) + { + if ((this.PropertyChanged != null)) + { + this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + } + + public partial class NearestDinnersResult + { + + private int _DinnerID; + + public NearestDinnersResult() + { + } + + [Column(Storage="_DinnerID", DbType="Int NOT NULL")] + public int DinnerID + { + get + { + return this._DinnerID; + } + set + { + if ((this._DinnerID != value)) + { + this._DinnerID = value; + } + } + } + } +} +#pragma warning restore 1591 diff --git a/aspclassiccompiler/Backup/NerdDinnerAsp/Models/RuleViolation.cs b/aspclassiccompiler/Backup/NerdDinnerAsp/Models/RuleViolation.cs new file mode 100644 index 0000000..1a578e6 --- /dev/null +++ b/aspclassiccompiler/Backup/NerdDinnerAsp/Models/RuleViolation.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace NerdDinner.Models { + + public class RuleViolation { + + public string ErrorMessage { get; private set; } + public string PropertyName { get; private set; } + + public RuleViolation(string errorMessage) { + ErrorMessage = errorMessage; + } + + public RuleViolation(string errorMessage, string propertyName) { + ErrorMessage = errorMessage; + PropertyName = propertyName; + } + } +} diff --git a/aspclassiccompiler/Backup/NerdDinnerAsp/NerdDinnerAsp.csproj b/aspclassiccompiler/Backup/NerdDinnerAsp/NerdDinnerAsp.csproj new file mode 100644 index 0000000..542de41 --- /dev/null +++ b/aspclassiccompiler/Backup/NerdDinnerAsp/NerdDinnerAsp.csproj @@ -0,0 +1,215 @@ + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {328C148C-DBEE-41A4-B1C7-104CBB216556} + {603c0e0b-db56-11dc-be95-000d561079b0};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + NerdDinner + NerdDinner + v3.5 + false + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\ + TRACE + prompt + 4 + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + prompt + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + prompt + + + + False + ..\asp\bin\Release\Dlrsoft.Asp.dll + + + + + 3.5 + + + 3.5 + + + 3.5 + + + False + C:\Program Files\Microsoft ASP.NET\ASP.NET MVC RC\Assemblies\System.Web.Abstractions.dll + 3.5 + + + C:\Program Files\Microsoft ASP.NET\ASP.NET MVC RC\Assemblies\System.Web.Mvc.dll + False + True + + + False + C:\Program Files\Microsoft ASP.NET\ASP.NET MVC RC\Assemblies\System.Web.Routing.dll + 3.5 + + + 3.5 + + + + + + + + + + + + + + + + + Code + + + Default.aspx + ASPXCodeBehind + + + Global.asax + + + + + + + + + True + True + NerdDinner.dbml + + + + + + + + + NerdDinner.mdf + + + + + + + + + + + + + + ASPXCodeBehind + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MSLinqToSQLGenerator + NerdDinner.designer.cs + Designer + + + + + + + + NerdDinner.dbml + + + + + + + + + + + + + False + True + 60848 + / + + + False + False + + + False + + + + + \ No newline at end of file diff --git a/aspclassiccompiler/Backup/NerdDinnerAsp/Properties/AssemblyInfo.cs b/aspclassiccompiler/Backup/NerdDinnerAsp/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..c7c7f74 --- /dev/null +++ b/aspclassiccompiler/Backup/NerdDinnerAsp/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("NerdDinner")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("NerdDinner")] +[assembly: AssemblyCopyright("Copyright © 2009")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("3f961952-a5a3-4ca2-bc29-5b46b500177d")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("0.5.2.32072")] diff --git a/aspclassiccompiler/Backup/NerdDinnerAsp/Scripts/Map.js b/aspclassiccompiler/Backup/NerdDinnerAsp/Scripts/Map.js new file mode 100644 index 0000000..e12505a --- /dev/null +++ b/aspclassiccompiler/Backup/NerdDinnerAsp/Scripts/Map.js @@ -0,0 +1,138 @@ +/// + +var map = null; +var points = []; +var shapes = []; +var center = null; + +function LoadMap(latitude, longitude, onMapLoaded) { + map = new VEMap('theMap'); + options = new VEMapOptions(); + options.EnableBirdseye = false; + + // Makes the control bar less obtrusize. + map.SetDashboardSize(VEDashboardSize.Small); + + if (onMapLoaded != null) + map.onLoadMap = onMapLoaded; + + if (latitude != null && longitude != null) { + center = new VELatLong(latitude, longitude); + } + + map.LoadMap(center, null, null, null, null, null, null, options); +} + +function LoadPin(LL, name, description) { + var shape = new VEShape(VEShapeType.Pushpin, LL); + + //Make a nice Pushpin shape with a title and description + shape.SetTitle(" " + escape(name) + ""); + if (description !== undefined) { + shape.SetDescription("

" + + escape(description) + "

"); + } + map.AddShape(shape); + points.push(LL); + shapes.push(shape); +} + +function FindAddressOnMap(where) { + var numberOfResults = 20; + var setBestMapView = true; + var showResults = true; + + map.Find("", where, null, null, null, + numberOfResults, showResults, true, true, + setBestMapView, callbackForLocation); +} + +function callbackForLocation(layer, resultsArray, places, + hasMore, VEErrorMessage) { + + clearMap(); + + if (places == null) + return; + + //Make a pushpin for each place we find + $.each(places, function(i, item) { + var description = ""; + if (item.Description !== undefined) { + description = item.Description; + } + var LL = new VELatLong(item.LatLong.Latitude, + item.LatLong.Longitude); + + LoadPin(LL, item.Name, description); + }); + + //Make sure all pushpins are visible + if (points.length > 1) { + map.SetMapView(points); + } + + //If we've found exactly one place, that's our address. + if (points.length === 1) { + $("#Latitude").val(points[0].Latitude); + $("#Longitude").val(points[0].Longitude); + } +} + +function clearMap() { + map.Clear(); + points = []; + shapes = []; +} + +function FindDinnersGivenLocation(where) { + map.Find("", where, null, null, null, null, null, false, + null, null, callbackUpdateMapDinners); +} + +function callbackUpdateMapDinners(layer, resultsArray, places, hasMore, VEErrorMessage) { + $("#dinnerList").empty(); + clearMap(); + var center = map.GetCenter(); + + $.post("/Search/SearchByLocation", { latitude: center.Latitude, + longitude: center.Longitude + }, function(dinners) { + $.each(dinners, function(i, dinner) { + + var LL = new VELatLong(dinner.Latitude, dinner.Longitude, 0, null); + + var RsvpMessage = ""; + + if (dinner.RSVPCount == 1) + RsvpMessage = "" + dinner.RSVPCount + " RSVP"; + else + RsvpMessage = "" + dinner.RSVPCount + " RSVPs"; + + // Add Pin to Map + LoadPin(LL, '' + + dinner.Title + '', + "

" + dinner.Description + "

" + RsvpMessage); + + //Add a dinner to the