Author Topic: Masking password entry in a console application  (Read 271 times)


  • New Member
  • *
  • Posts: 14
Masking password entry in a console application
« on: December 01, 2023, 05:02:58 pm »
Apologies if this has been asked before, but my Google-fu is not strong enough.

I have a small console app (Windows) which I want users to enter a username and password to access. Obviously I don't want the password to be displayed while being typed but having searched around for a way to mask input, I have yet to find a way to mask the input.

I did find a solution somebody had written for Delphi, however the password comes out garbled and unusable when writing it back out to test, so something is going wrong there.

If anybody has any thoughts I'd be very grateful!

(Also for various arcane reasons I can't use the CRT unit.)

UPDATE: Never mind! I fixed it. There was a missing line in the Delphi code I was using that didn't properly initialise a string.
« Last Edit: December 01, 2023, 05:07:20 pm by imperiusdamian »


TinyPortal © 2005-2018