39
39
public static void CreateConfig()
41
using (XmlTextWriter xmlw = new XmlTextWriter("grub.xml", null))
43
xmlw.Formatting = Formatting.Indented;
44
xmlw.WriteStartDocument(false);
45
xmlw.WriteStartElement("configuration");
46
xmlw.WriteElementString("enablesolr", "Y");
47
xmlw.WriteElementString("solraddress", "http://soap.grub.org:8180/solr/");
48
xmlw.WriteElementString("solrusername", "user");
49
xmlw.WriteElementString("solrpassword", "password");
50
xmlw.WriteElementString("uploadaddress", "http://grub.silc.org.ua:8080");
51
xmlw.WriteElementString("uploadusername", "user");
52
xmlw.WriteElementString("uploadpassword", "password");
53
xmlw.WriteElementString("mysqlhost", "localhost");
54
xmlw.WriteElementString("mysqldb", "grub");
55
xmlw.WriteElementString("mysqluser", "user");
56
xmlw.WriteElementString("mysqlpassword", "password");
57
xmlw.WriteElementString("workunitsdirectory", "/home/thindil/workunits/wu/");
58
xmlw.WriteElementString("workunitspassword", "password");
59
xmlw.WriteElementString("useragent", "GrubNG 0.1 (http://grub.org)");
60
xmlw.WriteElementString("urlsamount", "250");
61
xmlw.WriteElementString("httpversion", "1.0");
62
xmlw.WriteElementString("accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
63
xmlw.WriteEndElement();
41
XmlTextWriter xmlw = new XmlTextWriter("grub.xml", null);
42
xmlw.Formatting = Formatting.Indented;
43
xmlw.WriteStartDocument(false);
44
xmlw.WriteStartElement("configuration");
45
xmlw.WriteElementString("enablesolr", "Y");
46
xmlw.WriteElementString("solraddress", "http://soap.grub.org:8180/solr/");
47
xmlw.WriteElementString("solrusername", "user");
48
xmlw.WriteElementString("solrpassword", "password");
49
xmlw.WriteElementString("mysqlhost", "localhost");
50
xmlw.WriteElementString("mysqldb", "grub");
51
xmlw.WriteElementString("mysqluser", "user");
52
xmlw.WriteElementString("mysqlpassword", "password");
53
xmlw.WriteElementString("workunitsdirectory", "/home/thindil/workunits/wu/");
54
xmlw.WriteElementString("workunitspassword", "password");
55
xmlw.WriteElementString("useragent", "GrubNG 0.1 (http://grub.org)");
56
xmlw.WriteElementString("urlsamount", "250");
57
xmlw.WriteElementString("httpversion", "1.0");
58
xmlw.WriteElementString("accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
59
xmlw.WriteEndElement();
129
124
XmlDocument doc = new XmlDocument();
130
125
doc.Load("grub.xml");
131
string[] nodes = new string[17] {"enablesolr", "solraddress", "solrusername",
132
"solrpassword", "uploadaddress", "uploadusername", "uploadpassword", "mysqlhost",
133
"mysqldb", "mysqluser", "mysqlpassword", "workunitsdirectory", "workunitspassword",
134
"useragent", "urlsamount", "httpversion", "accept"};
135
string[] values = new string[17] {"Y", "http://soap.grub.org:8180/solr/",
136
"user", "password", "http://grub.silc.org.ua:8080", "user", "password", "localhost",
137
"grub", "user", "password", "/home/thindil/workunits/wu/", "password",
138
"GrubNG 0.1 (http://grub.org)", "250", "1.0",
139
"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"};
126
string[] nodes = new string[14] {"enablesolr", "solraddress", "solrusername",
127
"solrpassword", "mysqlhost", "mysqldb", "mysqluser", "mysqlpassword",
128
"workunitsdirectory", "workunitspassword", "useragent", "urlsamount",
129
"httpversion", "accept"};
130
string[] values = new string[14] {"Y", "http://soap.grub.org:8180/solr/",
131
"user", "password", "localhost", "grub", "user", "password",
132
"/home/thindil/workunits/wu/", "password", "GrubNG 0.1 (http://grub.org)",
133
"250","1.0", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"};
141
135
foreach (string node in nodes)