控制控制台

var

    s:string;

begin

    AllocConsole;

    try

        Write('Type here your words and press Enter');

        Readln(s);

        ShowMessage(Format('You typed: "%s"',[s]));

    finally

        FreeConsole;

    end;

end;

原文地址:https://www.cnblogs.com/djcsch2001/p/2035813.html