AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Datenbanken Delphi Mysql passing Login data to another form

Delphi Mysql passing Login data to another form

Ein Thema von drama22 · begonnen am 9. Sep 2014 · letzter Beitrag vom 9. Sep 2014
Antwort Antwort
Seite 1 von 2  1 2   
drama22

Registriert seit: 12. Jan 2013
88 Beiträge
 
#1

Delphi Mysql passing Login data to another form

  Alt 9. Sep 2014, 00:00
Datenbank: Mysql • Version: 5 • Zugriff über: Delphi xe5
i have created 2 forms A login form & A main form i successfully logged in To the main form
here is the code that i use to login

Delphi-Quellcode:
 SQL := Tloginclass.Create;
  try
    SQL.Login:= trim(Usrnm.Text);
    SQL.passwd := trim(passwd.Text);
    if SQl.logins then
     begin
      LoginSuccess := True;
     end
i retrieve and validate logins from a unit class wich is Tloginclass ,,

but now how to i set the data for each user logged in to the main form ?

i try somthing like this after login
Mainform.listusers.Items.Add(SQL.Login); but this is not logical because this showing only text how the application know the differents between user who loggedin like there is bob and martin and james ,etc are online now and read there user names ? any idea about this iam trying to understand the logic of this concept.


i ask this question on here : http://stackoverflow.com/questions/2...o-another-form

Geändert von drama22 ( 9. Sep 2014 um 00:14 Uhr)
  Mit Zitat antworten Zitat
Benutzerbild von Sir Rufo
Sir Rufo

Registriert seit: 5. Jan 2005
Ort: Stadthagen
9.454 Beiträge
 
Delphi 10 Seattle Enterprise
 
#2

AW: Delphi Mysql passing Login data to another form

  Alt 9. Sep 2014, 00:03
Crosspost http://stackoverflow.com/questions/2...o-another-form
Kaum macht man's richtig - schon funktioniert's
Zertifikat: Sir Rufo (Fingerprint: ‎ea 0a 4c 14 0d b6 3a a4 c1 c5 b9 dc 90 9d f0 e9 de 13 da 60)
  Mit Zitat antworten Zitat
drama22

Registriert seit: 12. Jan 2013
88 Beiträge
 
#3

AW: Delphi Mysql passing Login data to another form

  Alt 9. Sep 2014, 00:07
getting no answer there so i thought posting here will help me more .

Geändert von drama22 ( 9. Sep 2014 um 00:11 Uhr)
  Mit Zitat antworten Zitat
Benutzerbild von Sir Rufo
Sir Rufo

Registriert seit: 5. Jan 2005
Ort: Stadthagen
9.454 Beiträge
 
Delphi 10 Seattle Enterprise
 
#4

AW: Delphi Mysql passing Login data to another form

  Alt 9. Sep 2014, 00:11
getting no answer there so i thought posting here will help me more .
It is no problem to post the question here too but next time you should add the crosspost link by yourself
Kaum macht man's richtig - schon funktioniert's
Zertifikat: Sir Rufo (Fingerprint: ‎ea 0a 4c 14 0d b6 3a a4 c1 c5 b9 dc 90 9d f0 e9 de 13 da 60)
  Mit Zitat antworten Zitat
drama22

Registriert seit: 12. Jan 2013
88 Beiträge
 
#5

AW: Delphi Mysql passing Login data to another form

  Alt 9. Sep 2014, 00:15
getting no answer there so i thought posting here will help me more .
It is no problem to post the question here too but next time you should add the crosspost link by yourself
question updated , any help with it ? ..
  Mit Zitat antworten Zitat
mkinzler
(Moderator)

Registriert seit: 9. Dez 2005
Ort: Heilbronn
39.851 Beiträge
 
Delphi 11 Alexandria
 
#6

AW: Delphi Mysql passing Login data to another form

  Alt 9. Sep 2014, 05:19
You could store a reference to the corresponding login intance into the object field of the list element
Markus Kinzler
  Mit Zitat antworten Zitat
Dejan Vu
(Gast)

n/a Beiträge
 
#7

AW: Delphi Mysql passing Login data to another form

  Alt 9. Sep 2014, 07:12
Maybe this helps:
Mainform.listusers.Items.AddObject(SQL.Login, SQL); Now you see the name in the list and have access to the login instance.

BTW: 'SQL' is not a good name for an instance of your TLoginClass. You should not name neither a class nor an instance after its implementation details. It is unimportant how your login class verifies the user.
  Mit Zitat antworten Zitat
drama22

Registriert seit: 12. Jan 2013
88 Beiträge
 
#8

AW: Delphi Mysql passing Login data to another form

  Alt 9. Sep 2014, 15:16
Maybe this helps:
Mainform.listusers.Items.AddObject(SQL.Login, SQL); Now you see the name in the list and have access to the login instance.

BTW: 'SQL' is not a good name for an instance of your TLoginClass. You should not name neither a class nor an instance after its implementation details. It is unimportant how your login class verifies the user.
this will only show the text input , thats will not implement the tracking of online users i think i have to use indy udp to allow the users see who is joind to the chat but i have no idea about how to store those user names who logged in

plus also i dont get the point on how to enable/disable some functionality of the application based on the specific user
  Mit Zitat antworten Zitat
drama22

Registriert seit: 12. Jan 2013
88 Beiträge
 
#9

AW: Delphi Mysql passing Login data to another form

  Alt 9. Sep 2014, 15:18
You could store a reference to the corresponding login intance into the object field of the list element
is there any example about how that can be done ?
  Mit Zitat antworten Zitat
Benutzerbild von baumina
baumina

Registriert seit: 5. Mai 2008
Ort: Oberschwaben
1.275 Beiträge
 
Delphi 11 Alexandria
 
#10

AW: Delphi Mysql passing Login data to another form

  Alt 9. Sep 2014, 15:28
mysql can show you all actually logged-in-users with

SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
Hinter dir gehts abwärts und vor dir steil bergauf ! (Wolfgang Ambros)
  Mit Zitat antworten Zitat
Antwort Antwort
Seite 1 von 2  1 2   

Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 23:47 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz