Source Code Login GUI Mysql Matlab
Berikut adalah Source code login Matlab yang bisa digunakan sebagai referensi. pilih salah satu yang paling mudah.
Login 1
user=get(handles.edun,'String');
pass=get(handles.edpass,'String');
u='admin'; %username
p='123'; %password
if strcmp(user,u) && strcmp(pass,p)
close();
FormUtama1();
else
msgbox('Username/Password Salah');
return
end
Login 2
Login 3 (MySQL)
Login 1
user=get(handles.edun,'String');
pass=get(handles.edpass,'String');
u='admin'; %username
p='123'; %password
if strcmp(user,u) && strcmp(pass,p)
close();
FormUtama1();
else
msgbox('Username/Password Salah');
return
end
Login 2
usernamePwdData = curs.Data;
guiUsername = get(handles.edit1,'String');
guiPassword = get(handles.edit2,'String');
validUser = false;
for k=1:length(usernamePwdData)
username = usernamePwdData{k,1};
password = usernamePwdData{k,2};
if strcmp(username,guiUsername) && strcmp(password,guiPassword)
validUser = true;
break;
end
end
if validUser
AdminManagement()
UserManagement()
else
msgbox('wrong pwd');
end
Login 3 (MySQL)
[con,table,kolom]=koneksiuser();
username=get(handles.txtusername,'String');
password=get(handles.txtpassword,'String');
setdbprefs('NullNumberWrite', 'NaN');
SQL=['select * from ' table ' where username = ''', username,''' and password = ''',password, '''']
curs = exec(con,SQL);
curs = fetch(curs)
mydata=curs.Data
numrows = rows(curs)
if(numrows > 0)
hm = msgbox('Login','Login Sukses','help');
close(); close();
Menuutama();
else
hm = msgbox('Login gagal, username / password salah','Login','help');
end
username=get(handles.txtusername,'String');
password=get(handles.txtpassword,'String');
setdbprefs('NullNumberWrite', 'NaN');
SQL=['select * from ' table ' where username = ''', username,''' and password = ''',password, '''']
curs = exec(con,SQL);
curs = fetch(curs)
mydata=curs.Data
numrows = rows(curs)
if(numrows > 0)
hm = msgbox('Login','Login Sukses','help');
close(); close();
Menuutama();
else
hm = msgbox('Login gagal, username / password salah','Login','help');
end
Untuk tampilan formnya sebagai berikut
Terimakasih semoga bermanfaat
Posting Komentar untuk "Source Code Login GUI Mysql Matlab"