The WebRequest class returns the appropriate type for the URI scheme passed
to it. Therefore, all you have to do is parse the URI to get the scheme from
it to know what type you will get back.
The .Net Framework supports 3 specific schemes for this method:
http://, https://, and file:// - ti will always be one of these. You can use the Uri
class's "Scheme" property to discover this.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.
"Johannes" <jj******@gmail.com> wrote in message
news:11**********************@v46g2000cwv.googlegr oups.com...
When you do a webrequest like:
Dim objWebRequest As WebRequest = WebRequest.Create(objURI)
the returned class can be httpwebrequest, ftpwebrequest or any othe
descendant webrequest type that is registered on the system. How can I
determine which type is returned.
I tried if (objWebRequest is System.Net.HttpWebRequest) then .....
But the system says I am not allowed to use types in expressions.
--
BC30691: 'HttpWebRequest' is a type in 'Net' and cannot be used as an
expression.
--
How should it be done?
Johannes