* roottypes.cs: Rename from tree.cs.
[mono.git] / mcs / class / System.Web / Test / standalone / hosting / test1 / Program1.cs
1 using System;
2 using System.Web.UI;
3 using System.Web;
4 using System.Web.Hosting;
5 using ClassLibrary1;
6 using System.IO;
7
8 namespace ConsoleApplication1
9 {
10
11         class Program
12         {
13                 static void Main (string[] args)
14                 {
15                         string master = @"<%@   Master Language=""C#"" %>
16 <!DOCTYPE html PUBLIC ""-//W3C//DTD XHTML 1.0 Transitional//EN"" ""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"">
17 <html xmlns=""http://www.w3.org/1999/xhtml"" xml:lang=""en"" >
18 <head id=""Head1"" runat=""server"">
19 <title></title>
20 </head>
21 <body>
22 <asp:contentplaceholder id=""Main"" runat=""server"" />
23 </body>
24 </html>";
25                         string page = @"<%@ Page MasterPageFile=""My.master"" %>
26 <asp:content id=""Content1"" contentplaceholderid=""Main"" runat=""server"">
27 <form id=""form1"" runat=""server"" />
28 </asp:content>";
29                         string physDir = Directory.GetCurrentDirectory ();
30                         if (!Directory.Exists ("bin"))
31                                 Directory.CreateDirectory ("bin");
32                         string masterPath = "My.master";
33                         if (!File.Exists (masterPath))
34                                 using (StreamWriter sw = new StreamWriter (masterPath))
35                                         sw.Write (master);
36                         string pagePath = "PageWithMaster.aspx";
37                         if (!File.Exists (pagePath))
38                                 using (StreamWriter sw = new StreamWriter (pagePath))
39                                         sw.Write (page);
40                         Class1 c1 = (Class1) ApplicationHost.CreateApplicationHost (
41                                         typeof (Class1), "/", physDir);
42                         c1.Run ();
43                 }
44         }
45 }
46