用戶登錄注冊
A. 用java編程實現用戶注冊並進行登錄操作
String username = "",password = "",passwordagain = ""; // 定義用戶名和密碼
將該變數等於為全局變數 或局部變數即可
B. 用JAVA編寫一個用戶或注冊登錄界面。請哪位高手能夠寫下具體的代碼,謝謝
效果圖
<!DOCTYPEhtml>
<html>
<head>
<metacharset="UTF-8">
<title>先鋒圖書館管理系統-登錄</title>
<style>
*{
margin:0;
padding:0;
list-style:none;
}
#top{
width:1000px;
height:95px;
margin:0auto;
margin-top:25px;
}
#top_top{
width:1000px;
height:65px;
background:deepskyblue;
}
#top_top_left{
width:300px;
height:65px;
float:left;
}
#top_top_left>label{
width:200px;
height:65px;
color:white;
float:right;
}
#top_top_left>#a2{
padding-left:10px;
padding-top:20px;
font-size:16px;
}
#top_bottom{
width:1000px;
height:30px;
}
#top_bottom_left{
width:340px;
height:30px;
line-height:30px;
font-size:12px;
background:skyblue;
color:white;
text-indent:2em;
float:left;
}
#top_bottom_right{
width:660px;
height:30px;
line-height:30px;
font-size:12px;
color:blueviolet;
text-align:center;
float:right;
background:lightskyblue;
}
#content{
width:1000px;
height:600px;
margin:0auto;
background:#587FBA;
}
#content>#text{
width:1000px;
height:50px;
line-height:50px;
padding-top:100px;
font-size:36px;
font-family:"楷體";
font-weight:bold;
text-align:center;
}
#content>#login{
width:480px;
height:210px;
margin-top:20px;
margin-left:260px;
background:#85A0CB;
}
#content>#login>img{
float:left;
}
#content>#login>#select{
width:305px;
height:210px;
float:right;
}
#content>#login>#select>div{
width:230;
height:30px;
margin-left:30px;
}
#content>#login>#select>#d1{
margin-top:30px;
margin-bottom:3px;
}
#content>#login>#select>p{
font-size:14px;
margin-left:95px;
}
#bottom{
width:1000px;
height:35px;
line-height:35px;
margin:0auto;
background:deepskyblue;
text-align:center;
color:white;
}
</style>
</head>
<body>
<divid="top">
<divid="top_top">
<divid="top_top_left">
<imgsrc="img/test/a13.png"width="78px"height="65px"><labelid="a2">先鋒圖書館系統管理平台</label>
</div>
</div>
<divid="top_bottom">
<divid="top_bottom_left">當前位置:首頁>系統管理>登錄</div>
<divid="top_bottom_right">當前時間:<labelid="lable"></label></div>
</div>
</div>
<divid="content">
<divid="text">歡迎登錄先鋒圖書館管理系統</div>
<divid="login">
<imgsrc="img/test/a14.png"width="175px"height="210px"/>
<formid="select">
<divid="d1">用戶名: <inputtype="text"/></div>
<div>密 碼: <inputtype="password"/></div>
<p>
<inputtype="radio"name="user"value="read"/>讀者
<inputtype="radio"name="user"value="admin"/>管理員
</p><br/>
<p>
<inputtype="button"value="確定"style="width:50px;"onclick="put()"/>
<inputtype="reset"value="重置"style="width:50px;"/>
</p>
</form>
</div>
</div>
<divid="bottom">欣欣科技有限公司版權所有</div>
</body>
<scripttype="text/javascript"src="JQuery/jquery.js"></script>
<scripttype="text/javascript"src="js/GetCurrentTime.js"></script>
<script>
//驗證用戶名和密碼
functionput(){
vard=$("#select>div>input");//獲取用戶名和密碼
varname=d[0].value;
varpass=d[1].value;
varuser=null;
varr=document.getElementsByName("user");//獲取用戶類型
for(i=0;i<r.length;i++){
if(r[i].checked){
user=r[i].value;
}
}
//console.log(name+","+pass+","+user);//輸出測試
if(user==null){
window.alert("請選擇用戶類型!");
}elseif(user=="admin"&&name!="admin"){
window.alter("用戶名錯誤!");
}elseif(user=="admin"&&name=="admin"&&pass!="123456"){
window.alert("密碼錯誤!");
}elseif(name=="admin"&&pass=="123456"&&user=="admin"){
window.location.href="work_02_welcome.html";//在js中在本頁面中打開新鏈接
}else{
window.alert("用戶名錯誤");
}
}
</script>
</html>
C. 在自己製作的網頁中,如何實現「新用戶注冊」與「登錄」功能
這個不能分別叫做某一功能,而是一個系統的功能。首先在「新用戶注冊」應明確需要那些必要的注冊信息,然後,在「登錄」後又應該給予該用戶什麼樣的許可權,這兩個應該是相互關系和作用的一系統工程。具體到網頁上來實現,首先你需要設計相關的頁面以及編寫程序代碼和資料庫等。
D. html 如何做到用戶登錄夠把這個界面改成用戶登錄的用戶名,就是把原來的登錄注冊給隱藏
我這邊寫項目都是是後台寫的jsp代碼,但是前端也是可以實現的,用戶登錄之後,將用戶名localStorage.setItem在本地保存一下,然後localStorage.getItem判斷本地的用戶名是不是存在的,存在顯示登錄後頁面,不存在的話就顯示登錄注冊。退出登錄的時候可以讓用戶名位空或者是用localStorage.removeItem清除本地用戶名的緩存。希望有用。不到之處務噴
E. C語言編程:實現用戶的注冊和登錄
模擬用戶注冊和登陸可以用文件來保存用戶名和密碼。注冊就是向文件里寫,用if判斷兩次密碼是否一致。連續三次,可以有一個變數,每次輸入加一,變數大於三就提示登陸不成功。用戶名不對,那你就把你輸入的用戶名和文件里的用戶名是否一致。
F. java語言實現用戶注冊和登錄
//這個是我寫的,裡面有連接資料庫的部分。你可以拿去參考一下
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.sql.*;
class LoginFrm extends JFrame implements ActionListener// throws Exception
{
JLabel lbl1 = new JLabel("用戶名:");
JLabel lbl2 = new JLabel("密碼:");
JTextField txt = new JTextField(5);
JPasswordField pf = new JPasswordField();
JButton btn1 = new JButton("確定");
JButton btn2 = new JButton("取消");
public LoginFrm() {
this.setTitle("登陸");
JPanel jp = (JPanel) this.getContentPane();
jp.setLayout(new GridLayout(3, 2, 5, 5));
jp.add(lbl1);
jp.add(txt);
jp.add(lbl2);
jp.add(pf);
jp.add(btn1);
jp.add(btn2);
btn1.addActionListener(this);
btn2.addActionListener(this);
}
public void actionPerformed(ActionEvent ae) {
if (ae.getSource() == btn1) {
try {
Class.forName("com.mysql.jdbc.Driver");// mysql資料庫
Connection con = DriverManager.getConnection(
"jdbc:mysql://localhost/Car_zl", "root", "1");// 資料庫名為Car_zl,密碼為1
System.out.println("com : "+ con);
Statement cmd = con.createStatement();
String sql = "select * from user where User_ID='"
+ txt.getText() + "' and User_ps='"
+ pf.getText() + "'" ;
ResultSet rs = cmd
.executeQuery(sql);// 表名為user,user_ID和User_ps是存放用戶名和密碼的欄位名
if (rs.next()) {
JOptionPane.showMessageDialog(null, "登陸成功!");
} else
JOptionPane.showMessageDialog(null, "用戶名或密碼錯誤!");
} catch (Exception ex) {
}
if (ae.getSource() == btn2) {
System.out.println("1111111111111");
//txt.setText("");
//pf.setText("");
System.exit(0);
}
}
}
public static void main(String arg[]) {
JFrame.(true);
LoginFrm frm = new LoginFrm();
frm.setSize(400, 200);
frm.setVisible(true);
}
}
G. 如何為網頁製作一個有用戶登陸和注冊的功能網頁
這應該不是僅僅高手知道的吧?
原理是這樣的:
如果是明文保存密碼的話就簡單版了,入門也都教這樣的權,我也說這樣的例子。
注冊就是設置(最基本)兩個input,一個用戶名,一個密碼。然後一個submit按鈕。提交到本頁,加一個參數。
比如
thispage.asp?action=reg
這里的參數是action,值是reg。
在頁的另一部分進行獲取
p = request.querystring("aciton");
if(p=="reg")
{
//這里進行注冊
以剛才傳過來的表單里的username為關鍵字進行SQL查找,看庫里有無這個用戶。如果沒有,則寫入資料庫:剛才的用戶名和密碼。
如果有這個用戶,返回信息,告知用戶該名已被使用。
}
登陸也類似
只不過是先以用戶名作為關鍵字進行查找,然後找不到該用戶名報錯,如果找到,則將其密碼從資料庫中提出,和用戶從表單提交的值進行比較,如果不一致,報錯。如果一致,則通過,登陸成功。
如果是以密文進行保存的密碼,則需要更多處理,你現在根本弄不明白,還是先弄清楚明文密碼吧。
H. 工商局網上登記怎麼新用戶注冊
以北京市為例,登錄網站 wsdj.saic.gov.cn,遵照網站提示,注冊即可。
注冊步驟:
1.登錄wsdj.saic.gov.cn,出現如下頁面。點擊「用戶注冊」;
(8)用戶登錄注冊擴展閱讀:
設立公司須依法向公司登記機關申請設立登記,公司憑營業執照刻制印章,開立銀行賬戶,申請納稅登記。當前,我國公司登記機關是工商行政管理機關。自2014年3月1日起,注冊成立公司的門檻將降低。十二屆全國人大常委會第六次會議2013年12月28日決定,對《中華人民共和國公司法》作出修改,公司注冊資本實繳登記制改為認繳登記制,並取消注冊資本最低限額。
十二屆全國人大常委會第六次會議28日決定,對《公司法[1]》作出修改,並自2014年3月1日起施行。
注冊公司須知:實繳制已改為認繳制
將公司注冊資本實繳制改為注冊資本認繳制是新修改的公司法最突出的亮點。根據新修改的公司法規定,除法律、行政法規以及國務院決定對公司注冊資本實繳另有規定的外,取消了關於公司股東(發起人)應當自公司成立之日起兩年內繳足出資,投資公司可以在5年內繳足出資的規定;取消了一人有限責任公司股東應當一次足額繳納出資的規定。
公司股東(發起人)自主約定認繳出資額、出資方式、出資期限等,並記載於公司章程。這一改革有利於個體創業、可以促進我國建立信用體系、有利於推動資源配置方式轉變。
I. java編寫一個用戶注冊及登錄界面
mportjava.awt.HeadlessException;
importjava.awt.event.ActionEvent;
importjava.awt.event.ActionListener;
importjavax.swing.ImageIcon;
importjavax.swing.JButton;
importjavax.swing.JFrame;
importjavax.swing.JLabel;
importjavax.swing.JOptionPane;
importjavax.swing.JPanel;
importjavax.swing.JPasswordField;
importjavax.swing.JTextField;
@SuppressWarnings("serial")
{
JLabellbl1=newJLabel("用戶名:");
JLabellbl2=newJLabel("密碼:");
JTextFieldtxt=newJTextField("admin",20);
JPasswordFieldpwd=newJPasswordField(20);
JButtonbtn=newJButton("登錄");
JPanelpnl=newJPanel();
privateinterror=0;
publicMainFrame(Stringtitle)throwsHeadlessException{
super(title);
init();
}
privatevoidinit(){
this.setResizable(false);
pwd.setEchoChar('*');
pnl.add(lbl1);
pnl.add(txt);
pnl.add(lbl2);
pnl.add(pwd);
pnl.add(btn);
this.getContentPane().add(pnl);
btn.addActionListener(newActionListener(){
@Override
publicvoidactionPerformed(ActionEvente){
if("admin".equals(newString(pwd.getPassword()))){
pnl.removeAll();
JLabellbl3=newJLabel();
ImageIconicon=newImageIcon(this.getClass().getResource("pic.jpg"));
lbl3.setIcon(icon);
pnl.add(lbl3);
}
else{
if(error<3){
JOptionPane.showMessageDialog(null,"密碼輸入錯誤,請再試一次");
error++;
}
else{
JOptionPane.showMessageDialog(null,"對不起,您不是合法用戶");
txt.setEnabled(false);
pwd.setEnabled(false);
btn.setEnabled(false);
}
}
}
});
}
publicstaticvoidmain(String[]args){
MainFramefrm=newMainFrame("測試");
frm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frm.setBounds(100,100,300,120);
frm.setVisible(true);
}
}
J. 網站的用戶注冊與登陸是怎樣實現的
注冊:
Input流:輸入反饋的注冊信息
Javascript的Validate檢測用戶信息是否正確 》 true:繼續?false:Output流警告用戶輸入錯誤信息
PHP的錄入反饋資料庫》true:繼續?false:Output流警告用戶輸入錯誤信息
Output流:反饋用戶
登錄
Input流:輸入反饋的登錄信息
Javascript的Validate檢測用戶信息是否正確 》 true:繼續?false:Output流警告用戶輸入錯誤信息
PHP的檢測反饋資料庫》true:繼續?false:Output流警告用戶輸入錯誤信息
Output流:反饋用戶
(10)用戶登錄注冊擴展閱讀
登陸 與 登錄
登陸(Land) :這個詞是網上最泛濫的錯別用詞,幾乎一半以上的網站(特別是草根網站)都把這個詞放在登錄界面上,其實這是錯的。這個詞里的「陸」字,就是陸地的意思,其基本含義只是登上陸地而已,引申出來才會有「登陸市場」這些意思,但絕不應該說「登陸網站」。
登錄(login):有「登記記錄」的意思,輸入帳號密碼登錄網站正是為了登記記錄用戶資料。
登入(login):港台對Login的譯法,同登錄,可理解為「登記進入」的意思。
資料來源:網路:用戶登錄