private static string GetConfig(string configjson) { var s = String.Empty; try { using (WebClient client = new WebClient()) { // Add a user agent header in case the // requested URI contains a query. client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)"); using (Stream data = client.OpenRead(SimpleSettings.ConfigUrl + configjson)) { using (StreamReader reader = new StreamReader(data)) { s = reader.ReadToEnd(); reader.Close(); } data.Close(); } } } catch (Exception ex) { SimpleTrace.TraceException(ex); } return(s); }