• /r/csharp
  • Having trouble with some loop logic

    Hi all, I’m working on a little project that is a profanity filter. I’m having an issue with some of the loop logic with regard to some of the possible filter variations. For example: Word: ass Variations: a=4, s=$ Here is a snippet of my code: https://pastebin.com/Edt0GYyx Output: Word: ass variation: 4ss variation: a$s variation: […]

  • /r/csharp
  • retrying HTTP web request inside try/catch

    I have a function that may or may not require proxy authentication. public void PostNotification(string URL) { var updateRequest = HttpWebRequest.Create(URL) as HttpWebRequest; updateRequest.ContentLength = 0; updateRequest.ContentType = REQUEST_CONTENT_TYPE; updateRequest.Method = REQUEST_METHOD_TYPE; var postResponse = default(WebResponse); try { postResponse = updateRequest.GetResponse(); } catch (Exception ex) { Console.WriteLine(ex.Message); updateRequest.Proxy.Credentials = (System.Net.NetworkCredential)System.Net.CredentialCache.DefaultNetworkCredentials; postResponse = updateRequest.GetResponse(); } finally […]