title: set default proxy programmatically instead of using app.config
body: <p>Being behind a proxy, my .Net 4.0 C# application only works when there is an app.config with the following content:</p>
  
  <pre><code>&lt;system.net&gt;
      &lt;defaultProxy enabled="true" useDefaultCredentials="true"&gt;
          &lt;proxy /&gt;
          &lt;bypasslist /&gt;
          &lt;module /&gt;
      &lt;/defaultProxy&gt;
  &lt;/system.net&gt;
  </code></pre>
  
  <p>Now since I don't want to have an app.config and since embedding app.config is not recommended, what is the C# code that has the same effect as that xml chunk in the app.config and where do I place it?</p>