⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 password.txt

📁 一个matlab密码输入界面的原代码
💻 TXT
字号:
function editPassword_Callback(hObject, eventdata, handles) 
% hObject    handle to editPassword (see GCBO) 
% eventdata  reserved - to be defined in a future version of MATLAB 
% handles    structure with handles and user data (see GUIDATA) 

% Hints: get(hObject,'String') returns contents of editPassword as text 
%        str2double(get(hObject,'String')) returns contents of editPassword as a double 

passChar = get(handles.editPassword,'UserData'); 
if strcmp(passChar,'5201314') 
   msgbox('OK! You can entern my heart now no3!'); 
else 
   msgbox('Sorry,we have no words together no4!'); 
end 



% --- Executes on key press over editPassword with no controls selected. 
function editPassword_KeyPressFcn(hObject, eventdata, handles) 
% hObject    handle to editPassword (see GCBO) 
% eventdata  reserved - to be defined in a future version of MATLAB 
% handles    structure with handles and user data (see GUIDATA) 
currChar = get(gcf,'CurrentKey') 
switch currChar 
   case {'backspace','delete'}, 
       Char = []; 
       set(gcbo,'String',''); 
       drawnow; 
   case 'return', 
       passChar = get(gcbo,'UserData'); 
       if strcmp(passChar,'5201314') 
           msgbox('OK! You can entern my heart now no1!'); 
       else 
           msgbox('Sorry,we have no words together no2!'); 
       end 
       return 
   otherwise, 
       oldChar = get(gcbo,'UserData'); 
       Char = [oldChar,currChar]; 
       set(gcbo,'string',char('*'*ones(1,length(Char)))); 
end 
set(gcbo,'UserData',Char); 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -