Commit 212cec14 by BellCodeEditor

save project

parent b7561945
Showing with 8 additions and 2 deletions
......@@ -30,17 +30,23 @@ def register(): # 注册验证
with open("user.txt",'w',encoding='utf-8') as f:
f.write(content)
reg_to_login()
def login(): # 登录验证
name,password = app_login.get_input()
pwd = users.get(name)
result = str(users)
if n > 0:
if name in result:
if pwd == password:
messagebox.showinfo("提示",'登陆成功')
else:
messagebox.showwarning('警告','密码错误')
n=n-1
messagebox.showwarning('警告','密码错误','还剩'+str(n)+'次机会')
else:
n = n-1
messagebox.showwarning('警告','用户名错误','还剩'+str(n)+'次机会')
else:
messagebox.showwarning('警告','用户名错误')
messagebox.showwarning('警告',"次数用尽")
class My_login(): # 登录窗口
def __init__(self):
self.root = tkinter.Tk()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment