Glad to hear it furesoft, but
We don't have your
Then this test code works as expected:
Good luck!
PropertyBag
really should be sufficient for this purpose.We don't have your
HttpProcessor
class, but if we modify the Create
method as follows:publicstatic PropertyBag Create(string url) { var props = new PropertyBag(); var q = new Uri("htt://localhost/" + url).Query; foreach (var qi in q.Split(new[] { '&', '?' }, StringSplitOptions.RemoveEmptyEntries)) { var s = qi.Split('='); props.Add(s[0], s[1]); } return props; }
engine.AddHostObject("_GET", Create("qux.html?foo=123&bar=456&baz=789")); engine.AddHostType("Console", typeof(Console)); engine.Execute(@" Console.WriteLine(_GET['foo']); // prints '123' Console.WriteLine(_GET['bar']); // prints '456' Console.WriteLine(_GET['baz']); // prints '789' ");