C# 2008 SP1
I am using the code to detect if a proxy has been set under \"Internet Options\". If there is a proxy then I will set this in my webclient.
So I
First, GetDefaultProxy is marked as deprecated so you have no guarantee it will be around in even the immediate future. Second, Address can be null so the code you gave risks a NullReferenceException: