К основному контенту

Парсинг URL'а средствами Indy

Очень просто
uses IdURI;

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
  URI: TIdURI;
begin
  URI := TIdURI.Create('http://login:password@somehost.somedomain.com:8080/some_path/something_else.html?param1=val¶m2=val');
  try
    Memo1.lines.add(URI.Protocol);
    Memo1.lines.add(URI.Username);
    Memo1.lines.add(URI.Password);
    Memo1.lines.add(URI.Host);
    Memo1.lines.add(URI.Port);
    Memo1.lines.add(URI.Path);
    Memo1.lines.add(URI.Document);
    Memo1.lines.add(URI.Params);
  finally
    URI.Free;
  end;
end;

Комментарии

Популярные сообщения из этого блога

Firebird various delimiters for GET_WORDS

Использование процедуры GET_WORDS для разных разделителей можно в таком виде: select WORD from GET_WORDS((select list(WORD, ';') from GET_WORDS((select list(WORD) from GET_WORDS('12 7712 12,12;12 333556', ' ')), ',')), ';') где используются последовательно несколько разделителей ' ', ',' и ';' .

Библиотека Firebird для моих программ

Часто ставлю свои программы, используемые Firebird, без установки официального клиента. Для нормальной работы программы нужна библиотека fbclient.dll, лучше взятая с сервера, где лежит база Для Windows XP ещё надо Microsoft C/C ++ Runtime Libraries Microsoft.VC80.CRT.manifest msvcp80.dll msvcr80.dll Всё это надо поместить в c:\Windows\System32 или прямо в папку с программой.

When does a ShortCut fire?

Yesterday I discovered a situation wherein a keyboard ShortCut did not fire when I was expecting it to. The specific situation was: I pressed the ShortCut key combination for an Action of an ActionList on an MDI child, while a side bar on the MDI form was focussed. I always was under the impression that ShortCuts would work globally. In exactly which circumstances do or do they not fire? Answer When does a ShortCut fire? That's a deceptively simple question with a surprisingly long answer. First I will deal with some basics and then follow the ShortCut through the VCL code to finally arrive at - I hope - a satisfying conclusion. What is a ShortCut? A ShortCut represents a special keyboard combination of one or more keys that cause an operation. Special means special to the programmer who gives meaning to the specific key combination. In Delphi a ShortCut is of type TShortCut which is declared as a whole number wi...