public string GetSubscribeUrl(SubType type) { try { for (var i = 0; i < 4; i++) { try { Log.InfoFormat("Getting subscribe url for {0}", type.Name); var wc = new WebClient(); var callurl = AppConfig.WebsitePath + "api/user/subscribe.php?username="******"&subtype=" + type.Name; Log.InfoFormat("Call url {0}", callurl); var res = wc.DownloadString(callurl).Trim(); Log.InfoFormat("Result {0}", res); if (res.Substring(0, 2) == "ok") { var url = res.Substring(3); return(url); } return(null); } catch (Exception) { if (i == 3) { throw; } } } } catch (Exception e) { Log.Warn("ss", e); throw new UserMessageException("Could not subscribe. Please visit " + AppConfig.WebsitePath + " to subscribe.", e); } return(null); }
public string GetSubscribeUrl(SubType type) { return AppConfig.WebsitePath; }
public string GetSubscribeUrl(SubType type) { return(AppConfig.WebsitePath); }
public string GetSubscribeUrl(SubType type) { try { for (var i = 0; i < 4; i++) { try { Log.InfoFormat("Getting subscribe url for {0}", type.Name); var wc = new WebClient(); var callurl = AppConfig.WebsitePath + "api/user/subscribe.php?username="******"&subtype=" + type.Name; Log.InfoFormat("Call url {0}", callurl); var res = wc.DownloadString(callurl).Trim(); Log.InfoFormat("Result {0}", res); if (res.Substring(0, 2) == "ok") { var url = res.Substring(3); return url; } return null; } catch (Exception) { if (i == 3) throw; } } } catch (Exception e) { Log.Warn("ss", e); throw new UserMessageException("Could not subscribe. Please visit " + AppConfig.WebsitePath + " to subscribe.",e); } return null; }