I need to be able to break a URL down into different segments. Take this path for example:
http://login:password@somehost.somedomain.com:8080/some_path/somet
XE2 ships with Indy, which has a TIdURI class for that purpose, eg:
uses
..., IdURI;
var
URI: TIdURI;
URI := TIdURI.Create('http://login:password@somehost.somedomain.com:8080/some_path/something_else.html?param1=val¶m2=val');
try
// Protocol = URI.Protocol
// Username = URI.Username
// Password = URI.Password
// Host = URI.Host
// Port = URI.Port
// Path = URI.Path
// Query = URI.Params
finally
URI.Free;
end;