Interview Question in Visual Studio 2005


 

Interview Question :: Casting String value to other Data Type

Okay, I am working on proxy browser (ie a browser to surf the web while using proxies). These proxies are obtained either through a daily download of proxies from partner pages or a weekly download of a specific text file (the code shown in the example below is an example of the latter). The problem I have, is that when I test the program I get the following "CAST EXCEPTION" error. I suppose it indicates that I cannot use my proxy value (a string) for WebProxy. Does anyone know of a way to cast that string value to a data type suited for WebProxy? This is in VB.NET

BTW, I am using Visual Studio 2005

DETAILS:

CAST EXCEPTION UNHANDLED

Unable to cast object of type 'System.String' to type 'System.Net.IWebProxy'.
by ksk