Read-only archive. Login and posting are unavailable.
Reply
 
Thread Tools
  #1  
Old 10-11-2010, 22:42
nguoimoidenratga's Avatar
Senior Member
Join Date: 01-2010
Posts: 1,283
Bắt dữ liệu sau khi login trong java

Mình đang làm eproject về quản lý quảng cáo.Mình tạo 1 form login,sau khi login thành công nếu nó username đó là admin thì mình sẽ hiển thị form Admin và ngược lại.Vậy cho mình hỏi,sau khi login rồi làm sao để mình biết username nào đang thao tác trên form đó?
Nói dể hiểu là làm sao sau khi đăng nhập thì hiển thị trên 1 góc hàng chử:You are.....
Code của mình(mình viết đại khái ý mình thôi nha)
if(xuly.validate.checkusername()==true&&xuly.valid ate.checkpassword()==true){
if(xuly.validate.checkRolewithUsername().equal("A0 1")){
this.dispose();
Adminhome a=new Adminhome();
a.setvisible(true);
}
else if(xuly.validate.checkRolewithUsername().equal("A0 2")){
this.dispose();
Employeehome e=new Employeehome();
e.setvisible(true);
}
}

Hiện tại mình chỉ biết gọi form khác bằng cách này.Bây giờ khi form mới hiện ra rồi,làm sao lấy được cái user lúc nãy mình login để áp dụng cho các form sau.
Cám ơn các bạn đã đọc bài.Mong được các bạn giúp đỡ
Reply With Quote
Reply

« Previous Thread | Next Thread »

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT +7. The time now is 01:34.