没有回显输入密码实现
来源:互联网 发布:mac书法字体下载 编辑:程序博客网 时间:2024/06/06 08:59
InputPassword.exe
注意:
为避免64位操作系统出现错误,做以下设置:
1.MFC的使用:选择“在静态库中使用MFC”
2.配置属性——》C/C++——》常规——》检测64位可移植性问题——》是
#include <stdio.h>#include <string.h>#include <conio.h>#define MAX_PWD_LEN 32void GetPassword(char * pwd){int i = 0;char c;while ((c=getch()) != '\r'){if (i >= MAX_PWD_LEN-1){break;}pwd[i] = c;++i;}}int main(void){char pwd[MAX_PWD_LEN];memset(pwd, 0, MAX_PWD_LEN);GetPassword(pwd);printf_s("%s", pwd);return 0;}
bat脚本:
@echo offecho input the password of sa :set /p sapwd=input the sapwd :echo %sapwd%>>log.txtecho %sapwd%|findstr "^[a-z0-9A-Z_]*$" 1>nul 2>nulif not %errorlevel%==0 ( echo "the sapwd you input is invalid.")for /f "delims=" %%i in ('InputPassword.exe') do ( set sapwd=%%i ) echo %sapwd% >>log.txtecho %sapwd%|findstr "^[a-z0-9A-Z_]*$" 1>nul 2>nulif not %errorlevel%==0 ( echo "the sapwd you input is invalid.")pause
- 没有回显输入密码实现
- C语言编程中实现输入密码回显星号
- C语言编程中实现输入密码回显星号
- [心得]C语言中实现密码输入 回显星号*
- C语言编程中实现输入密码回显星号
- C语言编程中实现输入密码回显星号
- 实现用户登录时若没有输入用户名,给出用户名不能为空的提示,若没有输入密码,给出密码不能为空的提示
- 输入密码回显星号
- C语言实现输入密码
- expect实现自动输入密码
- C语言实现密码输入
- Edittext实现密码输入框
- 实现简单输入支付密码的输入
- C语言输入密码回显*号
- c语言输入密码回显程序
- java控制台输入密码禁用回显
- 输入密码回显星号 -- C语言
- shell输入密码隐藏回显
- asp.net 委托用法 适合新手
- 电路常识性概念(2)-电容
- QT常见错误三
- PreparedStatement的用法
- PrivateConstrctor
- 没有回显输入密码实现
- Shell编程基础
- Oracle数据导入导出
- linux 权限详解
- iOS开发如何实现消息推送机制
- C# UDP通信实现(提供源码下载)
- 6、面向对象之封装
- 数组下标为0
- 电路常识性概念(3)-TTL与CMOS集成电路