Changeset 84 for branches/DirectWeb/UWebServer.pas
- Timestamp:
- Dec 16, 2009, 12:46:51 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DirectWeb/UWebServer.pas
r83 r84 12 12 UMIMEType, Synautil, 13 13 USqlDatabase, DOM, XMLRead; 14 15 const 16 ConfigFileName = 'Config.xml'; 14 17 15 18 type … … 41 44 42 45 procedure TWebServer.LoadConfiguration; 43 const44 ConfigFileName = 'Config.xml';45 46 var 46 47 Config: TXMLDocument; 47 I: Integer; 48 II: Integer; 48 I1: Integer; 49 I2: Integer; 50 I3: Integer; 49 51 begin 50 52 if FileExists(ConfigFileName) then begin 51 53 ReadXMLFile(Config, ConfigFileName); 52 for I := 0 to Config.ChildNodes.Count - 1 do begin 53 if Config.ChildNodes[I].NodeName = 'database' then 54 for II := 0 to Config.ChildNodes[I].ChildNodes.Count - 1 do begin; 55 if Config.ChildNodes[I].ChildNodes[II].NodeName = 'hostname' then 56 HostName := Config.ChildNodes[I].ChildNodes[II].TextContent; 57 if Config.ChildNodes[I].ChildNodes[II].NodeName = 'schema' then 58 Schema := Config.ChildNodes[I].ChildNodes[II].TextContent; 59 if Config.ChildNodes[I].ChildNodes[II].NodeName = 'username' then 60 UserName := Config.ChildNodes[I].ChildNodes[II].TextContent; 61 if Config.ChildNodes[I].ChildNodes[II].NodeName = 'password' then 62 Password := Config.ChildNodes[I].ChildNodes[II].TextContent; 54 for I1 := 0 to Config.ChildNodes.Count - 1 do 55 with Config.ChildNodes[I1] do begin 56 if NodeName = 'configuration' then 57 for I2 := 0 to ChildNodes.Count - 1 do 58 with ChildNodes[I2] do begin 59 if NodeName = 'database' then 60 for I3 := 0 to ChildNodes.Count - 1 do 61 with ChildNodes[I3] do begin 62 if NodeName = 'hostname' then 63 HostName := TextContent; 64 if NodeName = 'schema' then 65 Schema := TextContent; 66 if NodeName = 'username' then 67 UserName := TextContent; 68 if NodeName = 'password' then 69 Password := TextContent; 70 end; 71 if NodeName = 'server' then 72 for I3 := 0 to ChildNodes.Count - 1 do 73 with ChildNodes[I3] do begin 74 if NodeName = 'address' then 75 HTTPServer.Socket.Address := TextContent; 76 if NodeName = 'port' then 77 HTTPServer.Socket.Port := StrToInt(TextContent); 78 end; 63 79 end; 64 80 end; … … 272 288 HTTPServer := THTTPServer.Create; 273 289 with HTTPServer, Socket do begin 274 Address := '0.0.0.0';275 Port := 81;276 290 DocumentRoot := './'; 277 291 with RequestHandlerList do begin
Note:
See TracChangeset
for help on using the changeset viewer.