Beispiel #1
0
 def rank_a():
     if messagebox.askokcancel(title='退出', message='确定退出登录吗?'):
         window.destroy()
         sys.exit("tuchuxiton")
         window.destroy()
         import menu1
         menu1.menu(username, s)
    def run(self):
        global desconected
        desconected = False
        global client2
        client1 = serverConection1()
        client2 = serverConection2()
        if clientConnected2:
            username, host, port = dataClient2()
            lsTracks, numTrack = sendTrack(username)
            lsAlbums, numAlbum, lsTrackAlbums, numTrackAlbum = sendAlbum(
                username)

            json_username = json.dumps(username)
            json_host = json.dumps(host)
            json_port = json.dumps(port)

            json_lsTracks = json.dumps(lsTracks)
            json_numTrack = json.dumps(numTrack)

            json_lsAlbums = json.dumps(lsAlbums)
            json_numAlbum = json.dumps(numAlbum)
            json_lsTrackAlbums = json.dumps(lsTrackAlbums)
            json_numTrackAlbum = json.dumps(numTrackAlbum)

            client2.listenClientData(json_username, json_host, json_port)
            client2.listenClientSong(json_lsTracks, json_numTrack)
            client2.listenClientAlbum(json_lsAlbums, json_numAlbum,
                                      json_lsTrackAlbums, json_numTrackAlbum)
            print(
                "\nSe han compartido una copia de tus archivos locales con el servidor Secundario de NAPSTER RPC."
            )
            if clientConnected == False:
                desconected = menu(client2, username)
Beispiel #3
0
    def usr_login():
        #获取账号和密码
        username = var_usr_name.get()
        usr_pwd = var_usr_pwd.get()
        #获取存储的账户信息
        db=Mysqlpython("test")
        sel="select name,password from user where name='%s' or password='******'"%(str(username),str(usr_pwd))
        r=db.all(sel)
        # print(r)

        pwd = r[0][1]

        if usr_pwd != pwd:
            tk.messagebox.showerror(message="对不起输入错误请重试!")

        elif usr_pwd == pwd:
            tk.messagebox.showinfo(title="Welcome to 智能之星-Robot",
                                message=username+":欢迎来到智能之星"  )
            window.destroy()
            menu1.menu(username, s)#登录之后运行的函数或者窗口
Beispiel #4
0
        def regist_to_mysql():
            np = new_pwd.get()
            npc = new_pwd_confirm.get()
            nn = new_name.get()

            db=Mysqlpython("test")
            sel="select name from user where name='%s'"%str(nn)
            s=db.all(sel)
            # print(s)

            if s:
                tk.messagebox.showerror('对不起,此账号已存在!')
            elif np != npc:
                tk.messagebox.showerror('对不起',"两次密码输入不一致!")
            else:
                # try:
                db=Mysqlpython("test")
                ins="insert into user (name,password) values ('%s','%s')"%(str(nn),str(np))
                db.zhixing(ins)
                tk.messagebox.showinfo("Welcome","您已注册成功")

                window.destroy()
                menu1.menu(nn, s)    #注册之后运行的函数或者窗口
Beispiel #5
0
 def rank_b():
     window.destroy()
     import menu1
     menu1.menu(username, s)
Beispiel #6
0
import os
import header
import mainlogin
import userpw
import menutambahan
import masuk
import tampilanuser
import menu1
os.system('cls')
header.header()
mainlogin.pilog()
x = int(input("Masukkan pilihan : "))
os.system('cls')
if x == 1:
    userpw.akunadmin()
    os.system('cls')
    header.header()
    os.system('cls')
    menutambahan.menu2()
    
elif x == 2 :
    header.header()
    masuk.masukuser()
    os.system('cls')
    menu1.menu()
Beispiel #7
0
 def b():  #返回menu1
     window.destroy()
     import menu1
     menu1.menu(username, s)
Beispiel #8
0
 def quit():
     if messagebox.askokcancel(title='返回主菜单', message='确定退出聊天窗口,并返回主菜单吗?'):
         window.destroy()
         from menu1 import menu
         menu(username,s)