473,387 Members | 1,549 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

mask password in c# console application?

Hi
Is it possible to mask console input in a c# console application?
What I mean is: if I entered string "test" in the console, it'll echo
"****"(or nothing) instead of the string "test".

I've tried setting the foregroud color of the console the same as the
backgroud color through native API, but it doesn't really hide the password,
actually, users can manually change the foregroud color in a windows console
window, or they can copy the password from the right place of the screen
directly even they do not 'see' it. Is there a better way to do it?

thanks
Yang Liu
Nov 15 '05 #1
2 11293
Your best bet may be using this:
http://www.gotdotnet.com/Community/U...s/Details.aspx
?SampleGuid=b76d1f08-2d79-47bd-825b-0489938aae0f

It's a Microsoft sample API showing how to manipulate
other aspects of the console and may help you mask input.
-----Original Message-----
Hi
Is it possible to mask console input in a c# console application?What I mean is: if I entered string "test" in the console, it'll echo"****"(or nothing) instead of the string "test".

I've tried setting the foregroud color of the console the same as thebackgroud color through native API, but it doesn't really hide the password,actually, users can manually change the foregroud color in a windows consolewindow, or they can copy the password from the right place of the screendirectly even they do not 'see' it. Is there a better way to do it?
thanks
Yang Liu
.

Nov 15 '05 #2
Thanks Richard, got it.

"Richard A. Lowe" <ch*****@yumspamyumYahoo.com> wrote in message
news:13****************************@phx.gbl...
Your best bet may be using this:
http://www.gotdotnet.com/Community/U...s/Details.aspx
?SampleGuid=b76d1f08-2d79-47bd-825b-0489938aae0f

It's a Microsoft sample API showing how to manipulate
other aspects of the console and may help you mask input.
-----Original Message-----
Hi
Is it possible to mask console input in a c# console

application?
What I mean is: if I entered string "test" in the

Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Francis Debrabandere | last post by:
Hi all, I'm a beginner in ms access, and I'm working on my first real application. But to finish it up I'm facing a problem. I'm not able to solve and maybe someone can help me. I have made a...
1
by: John | last post by:
I am creating an application which is password controlled on startup. I created a textbox for the user to enter the password. However, I would like to also have a menu option so the user can...
1
by: Joe Spin | last post by:
Hi, I'm using the TextBox.PasswordChar property with a '*' to mask passwords written in the textbox. In some workstations it works fine , but there are some workstations (win2K and XP) that...
2
by: SharpCoderMP | last post by:
hi, i'm writing a console application and i would like to be able to safely retrive password from the user, so noone can see how it is being typed. consider this scenario: Console.Write("Enter...
0
by: gibsonsgman | last post by:
Hello, I have a form with a text field on it. I have applied the 'Password' input mask because it is a password field. However, when I enter the correct password, it says the password is...
3
by: julianmoors | last post by:
Hey, Currently I'm writing a VB.NET/1.1 app and I need to mask the input for the password field. Does anyone know how to do this in VB? I've seen a C# example, but wouldn't know how to convert...
11
by: gopal | last post by:
Hi, I am trying to call the OSQL utility from my C# console application and i am having problems i have the following code In Main method ProcessStartInfo psi = new...
8
by: vermarajeev | last post by:
How can I create a C++ Console application, compiled with GCC, portable to Linux and Windows, with a password prompt without echo (does not show the password as you type it)? I would like...
5
by: jehugaleahsa | last post by:
Hello: We have a request for an console application to change the administrative password on our user's machines during an upcoming update. The console application will be called from a batch...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.