our application requests a URL from a user however the URL might include information after the .com or .com.uk (any country designation) address ending.
for example the user may provide us with an address;
www.example.com/sample/userbin?form=sl&t=
Of course the above URL is made up and won't work but it illustrates my point.
Our application also stores connection data to enable the application to access the internet through a proxy server etc. It also allows the user to specify the Port number but we note that WebClient does not provide a member for Port Number.
The only other way is to append the port number to the URL but how can we do this when we don't know the URL provided by the user?
Why don't you know the domain? If the user has entered a valid URL it matches a pattern like:
//<domain>/path/file/whatever
or
<domain>/path/file/whatever
Add port:
<domain>:<port>/path/file/whatever
I don't know if this will help you, but ports in URLs come directly after the hostname, preceded by a colon.
Example: (www.example.com on port 8080)
http://www.example.com:8080/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With