private void DecryptQueryString(HttpRequest _currRequest) { this.queryString = new System.Collections.Hashtable(); if (_currRequest.QueryString.Count > 0) { string rowURL = _currRequest.RawUrl.Substring(_currRequest.RawUrl.IndexOf('?') + 1); string rawQueryString = System.Web.HttpUtility.UrlDecode(rowURL); if (rawQueryString.EndsWith("&")) { rawQueryString = rawQueryString.Substring(0, rawQueryString.Length - 1); } string queryString = BaseHelper.Decrypt(rawQueryString); string val; string key; string[] keys_values = queryString.Split('&'); foreach (string key_value in keys_values) { string[] kv = key_value.Split('='); key = kv[0]; val = kv[1]; this.queryString.Add(key, val); } } }
protected override void OnStart(string[] args) { sw = new StreamWriter(this.fs); if (File.Exists(@"maps.txt")) { string[] maps = File.ReadAllLines(@"maps.txt"); foreach (string map in maps) { string[] ms = map.Split('='); ctrlmaps[ms[0]] = ms[1]; } } else { sw.WriteLine("no maps.txt file"); } Dictionary <int, wgMjController> controllers = new Dictionary <int, wgMjController>(); string[] list = client.getController(); foreach (string s in list) { string[] ss = s.Split(':'); if (!ss[0].Trim().Equals("")) { sw.WriteLine(s); sw.Flush(); wgMjController ctrl = new wgMjController(); ctrl.IP = ss[0].Trim(); ctrl.ControllerSN = System.Int32.Parse(ss[1].Trim()); ctrl.PORT = 60000; controllers.Add(ctrl.ControllerSN, ctrl); } } service.EventHandler += new OnEventHandler(evtNewInfoCallBack); service.WatchingController = controllers; }