Either of the two provided snipts address the same issue.
- the csharp file addresses the issue with a block of code you should call in your 'main' program-process.
- the xml
app.config
may alternatively be used for brevity.
Without implementing the provided setting, you will find it difficult to write an application having the ability to stream ShoutCast audio data from a shoutcast-server due limitations within .NET's web/client/socket configuration settings. To address this issue, the microsoft-forum-post(s) point out a per-application configuration setting that resolves such an issue.
Now, this leaves for some other potential erronious handling of URI data. For this, you may like to google .NET URI HACKS
on stack-overflow or google.
see: how-do-i-enable-useunsafeheaderparsing-from-code-net-20