Commit 4eb1d2f2 by BellCodeEditor

save project

parent 91b88599
Showing with 7 additions and 7 deletions
import tkinter import tkinter
import json
from tkinter import messagebox from tkinter import messagebox
import json
with open("user.txt",'r',encoding="utf-8") as file1: with open("user.txt",'r',encoding="utf-8") as file1:
info = file1.read() info = file1.read()
...@@ -29,13 +28,12 @@ def register(): # 注册验证 ...@@ -29,13 +28,12 @@ def register(): # 注册验证
messagebox.showwarning("警告","用户密码名不一致") messagebox.showwarning("警告","用户密码名不一致")
else: else:
users[name] = password1 users[name] = password1
content = json.dumps(users) content2 = json.dumps(users)
with open("user.txt",'w',encoding="utf-8") as file2: with open("user.txt",'w',encoding="utf-8") as file2:
file2.write(content) file2.write(content2)
messagebox.showinfo("成功","注册成功") messagebox.showinfo("成功","登录成功")
def login(): # 登录验证 def login(): # 登录验证
pass name,password = app_login
class My_login(): # 登录窗口 class My_login(): # 登录窗口
def __init__(self): def __init__(self):
......
{"admin": "123456"}
\ No newline at end of file
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