符合中小企业对网站设计、功能常规化式的企业展示型网站建设
本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...
商城网站建设因基本功能的需求不同费用上面也有很大的差别...
手机微信网站开发、微信官网、微信商城网站...
效果图
十载的宁晋网站建设经验,针对设计、前端、开发、售后、文案、推广等六对一服务,响应快,48小时及时工作处理。全网营销推广的优势是能够根据用户设备显示端的尺寸不同,自动调整宁晋建站的显示方式,使网站能够适用不同显示终端,在浏览器中调整网站的宽度,无论在任何一种浏览器上浏览网站,都能展现优雅布局与设计,从而大程度地提升浏览体验。成都创新互联公司从事“宁晋网站设计”,“宁晋网站推广”以来,每个客户项目都认真落实执行。
代码
!DOCTYPE html
html
head
meta charset="UTF-8"
title先锋图书馆管理系统-登录/title
style
*{
margin: 0;
padding: 0;
list-style: none;
}
#top{
width: 1000px;
height: 95px;
margin: 0 auto;
margin-top: 25px;
}
#top_top{
width: 1000px;
height: 65px;
background: deepskyblue;
}
#top_top_left{
width: 300px;
height: 65px;
float: left;
}
#top_top_leftlabel{
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: 0 auto;
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#loginimg{
float: left;
}
#content#login#select{
width: 305px;
height: 210px;
float: right;
}
#content#login#selectdiv{
width: 230;
height: 30px;
margin-left: 30px;
}
#content#login#select#d1{
margin-top:30px;
margin-bottom: 3px;
}
#content#login#selectp{
font-size: 14px;
margin-left: 95px;
}
#bottom{
width: 1000px;
height: 35px;
line-height: 35px;
margin: 0 auto;
background: deepskyblue;
text-align: center;
color: white;
}
/style
/head
body
div id="top"
div id="top_top"
div id="top_top_left"
img src="img/test/a13.png" width="78px" height="65px"label id="a2"先锋图书馆系统管理平台/label
/div
/div
div id="top_bottom"
div id="top_bottom_left"当前位置 : 首页 系统管理 登录/div
div id="top_bottom_right"当前时间 : label id="lable"/label/div
/div
/div
div id="content"
div id="text"欢迎登录先锋图书馆管理系统/div
div id="login"
img src="img/test/a14.png" width="175px" height="210px"/
form id="select"
div id="d1"用户名: nbsp;nbsp;input type="text" //div
div密 nbsp; 码: nbsp;nbsp;input type="password" //div
p
input type="radio" name="user" value="read"/读者nbsp;nbsp;nbsp;nbsp;
input type="radio" name="user" value="admin"/管理员
/pbr/
p
input type="button" value="确定" style="width: 50px;" onclick="put()"/nbsp;nbsp;nbsp;nbsp;
input type="reset" value="重置" style="width: 50px;"/
/p
/form
/div
/div
div id="bottom"欣欣科技有限公司版权所有/div
/body
script type="text/javascript" src="JQuery/jquery.js"/script
script type="text/javascript" src="js/GetCurrentTime.js"/script
script
//验证用户名和密码
function put(){
var d = $("#selectdivinput");//获取用户名和密码
var name = d[0].value;
var pass = d[1].value;
var user = null;
var r = document.getElementsByName("user");//获取用户类型
for(i=0;ir.length;i++){
if(r[i].checked){
user=r[i].value;
}
}
//console.log(name + "," +pass + "," +user);//输出测试
if(user==null){
window.alert("请选择用户类型!");
}else if(user=="admin" name!="admin"){
window.alter("用户名错误!");
}else if(user=="admin" name=="admin" pass!="123456"){
window.alert("密码错误!");
}else if(name=="admin" pass=="123456" user=="admin"){
window.location.href="work_02_welcome.html";//在js中在本页面中打开新链接
}else{
window.alert("用户名错误");
}
}
/script
/html
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.sql.*;
class LoginFrm extends JFrame implements ActionListener
{
JLabel lbl1=new JLabel("用户名");
JLabel lbl2=new JLabel("密码");
JTextField txt=new JTextField(15);
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,10,10));
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("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:MyDB","","");
Statement cmd=con.createStatement();
ResultSet rs=cmd.executeQuery("select * from loginAndpassword where login='"+txt.getText()+"' and password='"+pf.getText()+"'");
if(rs.next())
{
JOptionPane.showMessageDialog(null,"登陆成功!");
}
else
JOptionPane.showMessageDialog(null,"用户名或密码错误!");
} catch(Exception ex){}
if(ae.getSource()==btn2)
{
txt.setText("");
pf.setText("");
}
}
}
public static void main(String arg[])
{
JFrame.setDefaultLookAndFeelDecorated(true);
LoginFrm frm=new LoginFrm();
frm.setSize(400,200);
frm.setVisible(true);
}
}
你要先学会截图哦,你发的看不清楚,重新写了一个你参考参考!
import java.awt.GridLayout;
import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class Day30A extends JFrame {
private static final long serialVersionUID = 1L;
private JLabel labelName,labelId,labelPass,labelMoney,labelSelect,labelCar;
private JComboBoxString jcb;
private JPanel jp1,jp2,jp3,jp4,jp5,jp6,jp7;
private ButtonGroup btg;
private JRadioButton jr1,jr2;
Day30A(){
this.setTitle("注册账户");
this.setLayout(new GridLayout(7,1));
this.setSize(300,280);
this.setLocationRelativeTo(null);
this.setDefaultCloseOperation(EXIT_ON_CLOSE);
init();
this.setVisible(true);
}
private void init() {
String str="卡片类型1,卡片类型2,卡片类型3,卡片类型4,卡片类型5";
jcb=new JComboBox(str.split(","));
labelId=new JLabel("账号: ");
labelName=new JLabel("姓名: ");
labelPass=new JLabel("密码: ");
labelMoney=new JLabel("开户金额:");
labelSelect=new JLabel("存款类型:");
labelCar=new JLabel("卡片类型:");
addFun1();
addFun2();
}
private void addFun2() {
this.add(jp1);
this.add(jp2);
this.add(jp3);
this.add(jp4);
this.add(jp5);
this.add(jp6);
this.add(jp7);
}
private void addFun1() {
jp1=new JPanel();
jp1.add(labelId);
jp1.add(new JTextField(15));
jp2=new JPanel();
jp2.add(labelName);
jp2.add(new JTextField(15));
jp3=new JPanel();
jp3.add(labelPass);
jp3.add(new JTextField(15));
jp4=new JPanel();
jp4.add(labelMoney);
jp4.add(new JTextField(13));
jp5=new JPanel();
jp5.add(labelSelect);
btg=new ButtonGroup();
jr1=new JRadioButton("定期");
jr2=new JRadioButton("活期",true);
btg.add(jr1);
btg.add(jr2);
jp5.add(jr1);
jp5.add(jr2);
jp6=new JPanel();
jp6.add(labelCar);
jp6.add(jcb);
jp7=new JPanel();
jp7.add(new JButton("确定"));
jp7.add(new JButton("取消"));
}
public static void main(String[] args) {
new Day30A();
}
}
import java.awt.Container;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;import javax.swing.*;public class Login extends JFrame{
JLabel user,passwd;
JTextField userput;
JPasswordField passput;
JButton denglu,tuichu;
public Login(){
super("用户登录");
Container c=getContentPane();
c.setLayout(null);
Font f=new Font("宋体",Font.PLAIN,12);
user=new JLabel("账号");
passwd=new JLabel("密码");
userput=new JTextField();
passput=new JPasswordField();
denglu=new JButton("登录");
denglu.setFont(f);
denglu.addActionListener(new NewAction());
tuichu=new JButton("退出");
tuichu.setFont(f);
tuichu.addActionListener(new NewAction());
user.setBounds(50,50,60,20);
userput.setBounds(110,50,150,20);
passwd.setBounds(50,80,60,20);
passput.setBounds(110,80,150,20);
denglu.setBounds(50,160,60,30);
tuichu.setBounds(200,160,60,30);
c.add(user);
c.add(userput);
c.add(passwd);
c.add(passput);
c.add(denglu);
c.add(tuichu);
setSize(350, 300);
setVisible(true);
}
class NewAction implements ActionListener{
String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=CDM";
String user="sa";
String passwd="394513265";
java.sql.Connection con;
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
try{
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
con= DriverManager.getConnection(url,user,passwd);
}catch(Exception ep){
JOptionPane.showMessageDialog(null, "加载驱动失败!");
}
if(e.getSource()==denglu){
Find();
}
if(e.getSource()==tuichu){
dispose();
}
} public void Find(){
String lk="select * from login";
try{
Statement sql=con.createStatement();
ResultSet rs=sql.executeQuery(lk);
while(rs.next()){
if(rs.getString(1).equals(userput.getText()) rs.getString(2).equals(passput.getText()))
new MainClient();
else
JOptionPane.showMessageDialog(null, "用户名或密码错误");
}
rs.close();
}catch(SQLException p){
JOptionPane.showMessageDialog(null, p.getMessage());
}
}
}
public static void main(String[] args) {
Login l=new Login();
l.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
步骤就是建个工程 然后建个class