Created
October 20, 2016 16:25
-
-
Save jpluimers/1907705123bc7cf20906902715f0dcac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
procedure TUriFrame.UpdateUriEdit; | |
var | |
aIdUri: TIdURI; | |
lDirectory: string; | |
lPort: Integer; | |
lProtocol: string; | |
begin | |
// URI := TIdURI.Create('http://login:password@somehost.somedomain.com:8080/some_path/something_else.html?param1=val¶m2=val'); | |
aIdUri := TIdURI.Create(); | |
try | |
aIdUri.Host := HostEdit.Text; | |
aIdUri.Path := PathEdit.Text; // TODO -o##jpl -cFix : Encode special charactersl ike @ and : | |
aIdUri.Password := PasswordEdit.Text; // TODO -o##jpl -cFix : Encode special charactersl ike @ and : | |
lPort := PortEdit.Value; | |
if (Protocol = sSftp) or (lPort <> cDefaultPortsByProtocol[Protocol]) then | |
aIdUri.Port := lPort.ToString(); | |
aIdUri.Protocol := cProtoclNamesByProtocol[Protocol]; | |
aIdUri.UserName := UserNameEdit.Text; | |
UriEdit.Text := aIdUri.GetFullURI(); | |
finally | |
aIdUri.Free(); | |
end; | |
{$ifdef DEBUG} | |
PasswordEdit.Hint := PasswordEdit.Text; | |
PasswordEdit.ShowHint := True; | |
{$endif DEBUG} | |
end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment