public string GetUrl(string path) { if (string.IsNullOrEmpty(baseUrl)) { string[] baseUrls = new string[] { "http://a1.easemob.com/", "http://a2.easemob.com/" }; Random r = new Random(DateTime.Now.Millisecond); int idx = r.Next(0, baseUrls.Length - 1); baseUrl = baseUrls[idx]; } return(string.Concat(baseUrl, AppKey.Replace("#", "/"), "/", path.TrimStart('/'))); }