• 大小: 116KB
    文件类型: .rar
    金币: 2
    下载: 3 次
    发布日期: 2021-06-04
  • 语言: Matlab
  • 标签: matlab  GUI  

资源简介

用Matlab GUI做的密码登陆框,喜欢的朋友可以试试!

资源截图

代码片段和文件信息

function varargout = a2(varargin)
gui_Singleton = 1;
gui_State = struct(‘gui_Name‘       mfilename ...
                   ‘gui_Singleton‘  gui_Singleton ...
                   ‘gui_OpeningFcn‘ @a2_OpeningFcn ...
                   ‘gui_OutputFcn‘  @a2_OutputFcn ...
                   ‘gui_LayoutFcn‘  []  ...
                   ‘gui_Callback‘   []);
if nargin && ischar(varargin{1})
    gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
    [varargout{1:nargout}] = gui_mainfcn(gui_State varargin{:});
else
    gui_mainfcn(gui_State varargin{:});
end

function a2_OpeningFcn(hobject eventdata handles varargin)
handles.output = hobject;
javaframe = get(hobject ‘Javaframe‘);
javaframe.setFigureIcon(javax.swing.ImageIcon(‘同济大学.jpg‘));
axes(handles.axes1)
imshow(‘背景图片.jpg‘)
[num txt raw] = xlsread(‘user_information.xls‘);
if ~iscellstr(raw)
    for i = 1 : 2
        n(i) = isnumeric(raw{i});
    end
    raw{n} = num2str(raw{n});
end
global theif
theif = 0;
global vid
vid =-1;
global numofshot
numofshot=1;
handles.code = raw{21};
guidata(hobject handles);

function varargout = a2_OutputFcn(hobject eventdata handles) 
varargout{1} = handles.output;

function login_user_Callback(hobject eventdata handles)

function login_user_CreateFcn(hobject eventdata handles)
if ispc
    set(hobject ‘BackgroundColor‘ ‘white‘);
else
    set(hobject ‘BackgroundColor‘ get(0 ‘defaultUicontrolBackgroundColor‘));
end

function log_Callback(hobject eventdata handles)
global theif
global vid
code =get(gcf‘userdata‘);

codes = handles.code;

if  isequal(codes code)
   
    
    delete(gcf);
    figure
else
    errordlg(‘密码错误!‘ ‘错误提示‘);
    set(handles.login_code ‘string‘ ‘‘)
    set(hobject ‘userdata‘ ‘‘)
    theif = theif+1;
end
if theif>2
try
vid = videoinput(‘winvideo‘1);
vid_src=getselectedsource(vid);
data = getsnapshot(vid);
set(vid‘TriggerRepeat‘Inf);
set(vid‘framesPerTrigger‘1);
set(vid‘frameGrabInterval‘1);
vidRes = get(vid ‘VideoResolution‘);
nBands = get(vid ‘NumberOfBands‘);
frame = getsnapshot(vid);
global numofshot
str=[‘theif‘ num2str(numofshot)‘.jpg‘];
imwrite(framestr‘jpg‘);
numofshot=numofshot+1;
end
MailAddress = ‘****‘;   %发件人的邮箱
password = ‘****‘;      %邮箱密码
setpref(‘Internet‘‘E_mail‘MailAddress);
setpref(‘Internet‘‘SMTP_Server‘‘smtp.gmail.com‘);
setpref(‘Internet‘‘SMTP_Username‘MailAddress);
setpref(‘Internet‘‘SMTP_Password‘password);
props = java.lang.System.getProperties;
props.setProperty(‘mail.smtp.auth‘‘true‘);
props.setProperty(‘mail.smtp.socketFactory.class‘ ‘javax.net.ssl.SSLSocketFactory‘);
props.setProperty(‘mail.smtp.socketFactory.port‘‘465‘);
subject = ‘****‘;   %邮件标题
content1 = ‘****‘;  %邮件内容
sender=‘****‘;      %发飞信短信的手机号
password=‘****‘;    %飞信密码
receiver=‘****‘;    %接受短信手机号
content2=‘****‘;    %短信内容
end
if theif == 3
url=[‘http://sms.api.bz/fetion.php?username=‘ sende

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      22671  2010-01-18 11:05  密码登陆框\a2.fig

     文件       6863  2010-01-18 11:02  密码登陆框\a2.m

     文件      35530  2009-10-22 23:05  密码登陆框\同济大学.jpg

     文件       6818  2010-01-18 11:01  密码登陆框\a2.asv

     文件       2404  2009-11-18 18:34  密码登陆框\button.jpg

     文件      14108  2009-11-17 02:36  密码登陆框\背景图片.jpg

     文件      13824  2009-11-03 00:29  密码登陆框\user_information.xls

     文件      39122  2010-01-18 13:39  密码登陆框\theif8.jpg

     目录          0  2010-01-18 10:42  密码登陆框

----------- ---------  ---------- -----  ----

               141340                    9


评论

共有 条评论