iOS UI03_登陆+注册 UI1~3系统归纳

完成登陆系统(登陆、注册、找回密码),使用容器视图控制器实现。
定义容器视图控制器ContainerViewController,指定为window的根视图控制器。
定义LoginViewController、RegistViewController、PasswordViewController,三个视图控制器的根视图添加到容器视图控制器的根视图。
//
//  AppDelegate.m
//  UI作业03
//
//  Created by dllo on 15/7/31.
//  Copyright (c) 2015年 zhozhicheng. All rights reserved.
//

#import "AppDelegate.h"
#import "LoginViewController.h"
#import "RegistViewController.h"
#import "PasswordViewController.h"
@interface AppDelegate ()

@end

@implementation AppDelegate
-(void)dealloc
{
    [_window self];
    [super dealloc];
}

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    // Override point for customization after application launch.
    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];
    [_window release];

    //windows设置的根视图是LoginViewController
    LoginViewController *loginVC = [[LoginViewController alloc] init];
    self.window.rootViewController=loginVC;
    [loginVC release];

    return YES;
}

- (void)applicationWillResignActive:(UIApplication *)application {
    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

- (void)applicationDidEnterBackground:(UIApplication *)application {
    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

- (void)applicationWillEnterForeground:(UIApplication *)application {
    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

- (void)applicationDidBecomeActive:(UIApplication *)application {
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

- (void)applicationWillTerminate:(UIApplication *)application {
    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

@end
//
//  LTView.h
//  UI作业03
//
//  Created by dllo on 15/7/31.
//  Copyright (c) 2015年 zhozhicheng. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface LTView : UIView<UITextFieldDelegate>
//两个对应的输入框
@property(nonatomic,retain)UILabel *loadLabel1;
@property(nonatomic,retain)UILabel *loadLabel2;
@property(nonatomic,retain)UITextField *loadTextField1;
@property(nonatomic,retain)UITextField *loadTextField2;

@property(nonatomic,retain)UILabel *confirmLabel;
@property(nonatomic,retain)UILabel *numLabel;
@property(nonatomic,retain)UILabel *emailLabel;
@property(nonatomic,retain)UITextField *confirmTextField;
@property(nonatomic,retain)UITextField *numTextField;
@property(nonatomic,retain)UITextField *emailTextField;
@end
//
//  LTView.m
//  UI作业03
//
//  Created by dllo on 15/7/31.
//  Copyright (c) 2015年 zhozhicheng. All rights reserved.
//

#import "LTView.h"

@implementation LTView

//重写init方法,模块化
-(instancetype)initWithFrame:(CGRect)frame
{
    self=[super initWithFrame:frame];
    if (self) {
        [self createView];
    }
    return self;
}

-(void)createView
{
    //建立两个登陆页面的label视图
    self.loadLabel1=[[UILabel alloc] initWithFrame:CGRectMake(80, 150, 100, 40)];
    [self addSubview:self.loadLabel1];
    [_loadLabel1 release];

    self.loadLabel2=[[UILabel alloc] initWithFrame:CGRectMake(80, 200, 100, 40)];
    [self addSubview:self.loadLabel2];
    [_loadLabel2 release];
    //建立两个登陆页面的textfield
    self.loadTextField1=[[UITextField alloc] initWithFrame:CGRectMake(150, 150, 150, 40)];
    self.loadTextField1.layer.borderWidth=1;
    self.loadTextField1.layer.cornerRadius=10;
    [self addSubview:self.loadTextField1];
     //代理人
    self.loadTextField1.delegate=self;
    [_loadTextField1 release];

    self.loadTextField2=[[UITextField alloc] initWithFrame:CGRectMake(150, 200, 150, 40)];
    self.loadTextField2.layer.borderWidth=1;
    self.loadTextField2.layer.cornerRadius=10;
    [self addSubview:self.loadTextField2];
    //代理人
    self.loadTextField2.delegate=self;
    [_loadTextField2 release];

}

@end
//
//  LoginViewController.m
//  UI作业03
//
//  Created by dllo on 15/7/31.
//  Copyright (c) 2015年 zhozhicheng. All rights reserved.
//

#import "LoginViewController.h"
#import "LTView.h"
#import "RegistViewController.h"
#import "PasswordViewController.h"

@interface LoginViewController ()<UITextFieldDelegate,UIAlertViewDelegate>
@property(nonatomic,retain)UILabel *textlabel;
@property(nonatomic,retain)UIAlertView *alertView;
@property(nonatomic,assign)BOOL isSelected;

@end

@implementation LoginViewController
-(void)dealloc
{

    [_alertView release];
    [_textlabel release];
    [super dealloc];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor=[UIColor yellowColor];
    //铺设登陆页面的魔化块
    //建立一个LTView视图
    LTView *view1=[[LTView alloc] initWithFrame:CGRectMake(0, 0, 350, 500)];
    [self.view addSubview:view1];
    [view1 release];
    //显示相应的文字
    view1.loadLabel1.text[email protected]"用户名";
    view1.loadLabel2.text[email protected]"密码";
    view1.loadTextField1.placeholder[email protected]"请输入账号";
    view1.loadTextField2.placeholder[email protected]"请输入密码";
    view1.tag = 1000;
    //密码隐藏
    view1.loadTextField2.secureTextEntry=YES;
    //全部清除按钮
    view1.loadTextField1.clearButtonMode=UITextFieldViewModeAlways;
    view1.loadTextField2.clearButtonMode=UITextFieldViewModeAlways;
    //回收键盘的代理人
    view1.loadTextField1.delegate=self;
    view1.loadTextField2.delegate=self;
    //铺设三个button
    UIButton *loadButton=[UIButton buttonWithType:UIButtonTypeSystem];
    //BUTTON位置
    loadButton.frame=CGRectMake(70, 300, 50, 25);
    //button文字
    [loadButton setTitle:@"登陆" forState:UIControlStateNormal];
    [self.view addSubview:loadButton];
    //设置button框,圆角
    loadButton.layer.borderWidth=1;
    loadButton.layer.cornerRadius=10;
    //设置button方法
    [loadButton addTarget:self action:@selector(loadClick:) forControlEvents:UIControlEventTouchUpInside];

    UIButton *findButton=[UIButton buttonWithType:UIButtonTypeSystem];
    findButton.frame=CGRectMake(150, 300, 70, 25);
    [findButton setTitle:@"找回密码" forState:UIControlStateNormal];
    [self.view addSubview:findButton];
    findButton.layer.borderWidth=1;
    findButton.layer.cornerRadius=10;
    [findButton addTarget:self action:@selector(findClick:) forControlEvents:UIControlEventTouchUpInside];

    UIButton *registerButton=[UIButton buttonWithType:UIButtonTypeSystem];
    registerButton.frame=CGRectMake(250, 300, 50, 25);
    [registerButton setTitle:@"注册" forState:UIControlStateNormal];
    [self.view addSubview:registerButton];
    registerButton.layer.borderWidth=1;
    registerButton.layer.cornerRadius=10;
    [registerButton addTarget:self action:@selector(registerClick:) forControlEvents:UIControlEventTouchUpInside];

    //设置显示密码按钮图片的更换
    UIButton *picButton=[UIButton buttonWithType:UIButtonTypeCustom];
    picButton.frame=CGRectMake(130,250, 30, 30);
    [picButton setImage:[UIImage imageNamed:@"check.png" ] forState:UIControlStateNormal];
    [self.view addSubview:picButton];
    [picButton addTarget:self action:@selector(changeImage:) forControlEvents:UIControlEventTouchUpInside];
    //文字 显示内容
    self.textlabel=[[UILabel alloc] initWithFrame:CGRectMake(180, 250, 150, 30)];
    self.textlabel.text[email protected]"显示内容";
    [self.view addSubview:self.textlabel];
    [self.textlabel release];
    // 报错
    self.alertView=[[UIAlertView alloc] initWithTitle:@"报错" message:@"账号密码有误"  delegate:self cancelButtonTitle:@"重新输入" otherButtonTitles:@"找回密码", nil];

}
//回收键盘的实现,之前需要签订协议
-(BOOL)textFieldShouldReturn:(UITextField *)textField
{
    [textField resignFirstResponder];
    return YES;
}
//图片显示内容切换,
-(void)changeImage:(UIButton *)picButton{
    if (picButton.selected) {
        //切换点击之后的两种图片状态
        [picButton setImage:[UIImage imageNamed:@"check.png"]  forState:UIControlStateNormal];
    }else{
        [picButton setImage:[UIImage imageNamed:@"checked.png"]  forState:UIControlStateNormal];
    }

    picButton.selected =!picButton.selected;
    ((LTView *)[self.view viewWithTag:1000]).loadTextField2.secureTextEntry ^= 1;
    self.isSelected = !self.isSelected;
}

//判断账号密码的实现
-(void)loadClick:(UIButton *)loadButton
{
    if ( ![((LTView *)[self.view viewWithTag:1000]).loadTextField1.text isEqualToString:@"1104010303"] || ![((LTView *)[self.view viewWithTag:1000]).loadTextField2.text isEqualToString:@"920928"]) {
        [self.alertView show];

    }
}

-(void)findClick:(UIButton *)findButton
{
    RegistViewController *registVC=[[RegistViewController alloc] init];
    [registVC setModalTransitionStyle:UIModalTransitionStyleCoverVertical];
    [self presentViewController:registVC animated:YES completion:^{
    }];
    [registVC release];
}

-(void)registerClick:(UIButton *)registerButton
{
    PasswordViewController *passWordVC=[[PasswordViewController alloc] init];
    [passWordVC setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
    [self presentViewController:passWordVC animated:YES completion:^{
    }];
//    [passWordVC release];
}

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
    if (buttonIndex == 1) {
        RegistViewController *registVC = [[RegistViewController alloc] init];
        [registVC setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
        [self presentViewController:registVC animated:YES completion:^{

        }];

    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
//
//  RegistViewController.m
//  UI作业03
//
//  Created by dllo on 15/7/31.
//  Copyright (c) 2015年 zhozhicheng. All rights reserved.
//

#import "RegistViewController.h"

@interface RegistViewController ()<UITextFieldDelegate>
@property(nonatomic,retain)UITextField *emailTextField;

@end

@implementation RegistViewController
-(void)dealloc
{
    [_emailTextField release];
    [super dealloc];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    //当前页面背景
    self.view.backgroundColor=[UIColor cyanColor];
    //建立email输入框
    self.emailTextField=[[UITextField alloc] initWithFrame:CGRectMake(100, 200, 200, 40)];
    [self.view addSubview:self.emailTextField];
    self.emailTextField.layer.borderWidth=1;
    self.emailTextField.layer.cornerRadius=10;
    self.emailTextField.placeholder[email protected]"电子邮箱";
    //建立此页面的两个button
    UIButton *findButton=[UIButton buttonWithType:UIButtonTypeSystem];
    findButton.frame=CGRectMake(120, 280, 40, 25);
    [findButton setTitle:@"找回" forState:UIControlStateNormal];
    [self.view addSubview:findButton];
    findButton.layer.borderWidth=1;
    findButton.layer.cornerRadius=10;
    [findButton addTarget:self action:@selector(findClick:) forControlEvents:UIControlEventTouchUpInside];

    UIButton *abolishButton=[UIButton buttonWithType:UIButtonTypeSystem];
    abolishButton.frame=CGRectMake(200, 280, 40, 25);
    [abolishButton setTitle:@"取消" forState:UIControlStateNormal];
    [self.view addSubview:abolishButton];
    abolishButton.layer.borderWidth=1;
    abolishButton.layer.cornerRadius=10;
    [abolishButton addTarget:self action:@selector(abolishClick:) forControlEvents:UIControlEventTouchUpInside];

}

-(void)abolishClick:(UIButton *)button
{
    [self dismissViewControllerAnimated:YES completion:^{

    }];
}
-(void)findClick:(UIButton *)findButton
{

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
//
//  PasswordViewController.m
//  UI作业03
//
//  Created by dllo on 15/7/31.
//  Copyright (c) 2015年 zhozhicheng. All rights reserved.
//

#import "PasswordViewController.h"
#import "LTView.h"
#import "LoginViewController.h"
#define HEIGHT self.view.frame.size.height
@interface PasswordViewController ()<UITextFieldDelegate,UIAlertViewDelegate>
@property(nonatomic,retain)UILabel *loadLabel1;
@property(nonatomic,retain)UILabel *loadLabel2;
@property(nonatomic,retain)UILabel *confirmLabel;
@property(nonatomic,retain)UILabel *numLabel;
@property(nonatomic,retain)UILabel *emailLabel;
@property(nonatomic,retain)UITextField *loadTextField1;
@property(nonatomic,retain)UITextField *loadTextField2;
@property(nonatomic,retain)UITextField *confirmTextField;
@property(nonatomic,retain)UITextField *numTextField;
@property(nonatomic,retain)UITextField *emailTextField;
@property(nonatomic,retain)UIAlertView *alertView;

@end

@implementation PasswordViewController
-(void)dealloc
{
    [_loadLabel1 release];
    [_loadLabel2 release];
    [_confirmLabel release];
    [_numLabel release];
    [_emailLabel release];
    [_loadTextField1 release];
    [_loadTextField2 release];
    [_confirmTextField release];
    [_numTextField release];
    [_emailTextField release];
    [_alertView release];
    [super dealloc];

}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.

    self.view.backgroundColor=[UIColor redColor];

    self.loadLabel1=[[UILabel alloc] initWithFrame:CGRectMake(60, 150, 70, 40)];
    [self.view addSubview:self.loadLabel1];
    self.loadLabel1.layer.borderWidth = 1;
    self.loadLabel1.layer.cornerRadius =10;
    self.loadLabel1.text[email protected]"用户名";
    [_loadLabel1 release];

    self.loadLabel2=[[UILabel alloc] initWithFrame:CGRectMake(60, 200, 70, 40)];
    [self.view addSubview:self.loadLabel2];
    self.loadLabel2.layer.borderWidth = 1;
    self.loadLabel2.layer.cornerRadius =10;
    self.loadLabel2.text[email protected]"密码";
    [_loadLabel2 release];

    self.confirmLabel=[[UILabel alloc] initWithFrame:CGRectMake(60, 250, 70, 40)];
    [self.view addSubview:self.confirmLabel];
    self.confirmLabel.layer.borderWidth = 1;
    self.confirmLabel.layer.cornerRadius =10;
    self.confirmLabel.text[email protected]"确认密码";
    [_confirmLabel release];

    self.numLabel=[[UILabel alloc] initWithFrame:CGRectMake(60, 300, 70, 40)];
    [self.view addSubview:self.numLabel];
    self.numLabel.layer.borderWidth = 1;
    self.numLabel.layer.cornerRadius =10;
    self.numLabel.text[email protected]"手机号";
    [_numLabel release];

    self.emailLabel=[[UILabel alloc] initWithFrame:CGRectMake(60, 350, 70, 40)];
    [self.view addSubview:self.emailLabel];
    self.emailLabel.layer.borderWidth = 1;
    self.emailLabel.layer.cornerRadius =10;
    self.emailLabel.text[email protected]"邮箱";
    [_emailLabel release];

 // TEXTFIELD

    self.loadTextField1=[[UITextField alloc] initWithFrame:CGRectMake(150, 150, 150, 40)];
    self.loadTextField1.layer.borderWidth=1;
    self.loadTextField1.layer.cornerRadius=10;
    self.loadTextField1.placeholder[email protected]"请输入用户名";
    self.loadTextField1.clearButtonMode=UITextFieldViewModeAlways;
    [self.view addSubview:self.loadTextField1];
    //代理人
    self.loadTextField1.delegate=self;
    [_loadTextField1 release];

    self.loadTextField2=[[UITextField alloc] initWithFrame:CGRectMake(150, 200, 150, 40)];
    self.loadTextField2.layer.borderWidth=1;
    self.loadTextField2.layer.cornerRadius=10;
    self.loadTextField2.placeholder[email protected]"请输入密码";
    self.loadTextField2.secureTextEntry=YES;
    self.loadTextField2.clearButtonMode=UITextFieldViewModeAlways;
    [self.view addSubview:self.loadTextField2];
    self.loadTextField2.delegate=self;
    [_loadTextField2 release];

    self.confirmTextField=[[UITextField alloc] initWithFrame:CGRectMake(150, 250, 150, 40)];
    self.confirmTextField.layer.borderWidth=1;
    self.confirmTextField.layer.cornerRadius=10;
    self.confirmTextField.placeholder[email protected]"再次输入密码";
    self.confirmTextField.secureTextEntry=YES;
    self.confirmTextField.clearButtonMode=UITextFieldViewModeAlways;
    [self.view addSubview:self.confirmTextField];
    self.confirmTextField.delegate=self;
    [_confirmLabel release];

    self.numTextField=[[UITextField alloc] initWithFrame:CGRectMake(150, 300, 150, 40)];
    self.numTextField.layer.borderWidth=1;
    self.numTextField.layer.cornerRadius=10;
    self.numTextField.placeholder[email protected]"请输入联系方式";
    self.numTextField.clearButtonMode=UITextFieldViewModeAlways;
    [self.view addSubview:self.numTextField];
    self.confirmTextField.delegate=self;
    [_numTextField release];

    self.emailTextField=[[UITextField alloc] initWithFrame:CGRectMake(150, 350, 150, 40)];
    self.emailTextField.layer.borderWidth=1;
    self.emailTextField.layer.cornerRadius=10;
    self.emailTextField.placeholder[email protected]"请输入邮箱";
    self.emailTextField.clearButtonMode=UITextFieldViewModeAlways;
    [self.view addSubview:self.emailTextField];
    self.emailTextField.delegate=self;
    [_emailTextField release];

    //注册按钮
    UIButton *registerButton=[UIButton buttonWithType:UIButtonTypeSystem];
    registerButton.frame=CGRectMake(110, 460, 50, 25);
    [registerButton setTitle:@"注册" forState:UIControlStateNormal];
    [self.view addSubview:registerButton];
    registerButton.layer.borderWidth=1;
    registerButton.layer.cornerRadius=10;
    [registerButton addTarget:self action:@selector(registerClick:) forControlEvents:UIControlEventTouchUpInside];

    //取消按钮
    UIButton *cancelButton=[UIButton buttonWithType:UIButtonTypeSystem];
    cancelButton.frame=CGRectMake(200, 460, 50, 25);
    [cancelButton setTitle:@"取消" forState:UIControlStateNormal];
    [self.view addSubview:cancelButton];
    cancelButton.layer.borderWidth=1;
    cancelButton.layer.cornerRadius=10;
    [cancelButton addTarget:self action:@selector(cancelClick:) forControlEvents:UIControlEventTouchUpInside];

    self.alertView=[[UIAlertView alloc] initWithTitle:@"恭喜" message:@"注册成功" delegate:self cancelButtonTitle:@"返回登陆页面" otherButtonTitles:@"取消", nil];

}
-(BOOL)textFieldShouldBeginEditing:(UITextField *)textField
{
    if (textField.frame.origin.y > HEIGHT / 2) {
        //先做一个差值
        CGFloat height =textField.frame.origin.y- HEIGHT / 2;
        self.view.center=CGPointMake(self.view.center.x, self.view.center.y - height);
    }
    return YES;
}
// 等到编译结束的时候,再让他回到原位
-(BOOL)textFieldShouldEndEditing:(UITextField *)textField
{
    if (textField.frame.origin.y > HEIGHT / 2) {
        CGFloat height =textField.frame.origin.y- HEIGHT / 2;
        self.view.center=CGPointMake(self.view.center.x, self.view.center.y + height);
    }
    return YES;
}

- (BOOL)textFieldShouldReturn:(UITextField *)textField{
    [textField resignFirstResponder];
    return YES;
}

-(void)cancelClick:(UIButton *)cancelButton
{
    [self dismissViewControllerAnimated:YES completion:^{

    }];
}

-(void)registerClick:(UIButton *)button
{
    [self.alertView show];

}

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
    if (buttonIndex == 0) {
        LoginViewController *loginVC = [[LoginViewController alloc] init];
        [loginVC setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
        [self presentViewController:loginVC animated:YES completion:^{

        }];
        [loginVC release];
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end

版权声明:本文为博主原创文章,未经博主允许不得转载。

时间: 2024-08-08 01:42:25

iOS UI03_登陆+注册 UI1~3系统归纳的相关文章

微信小程序 使用HMACSHA1和md5为登陆注册报文添加指纹验证签名

对接口请求报文作指纹验证签名相信在开发中经常碰到, 这次在与java后端一起开发小程序时,就碰到需求对登陆注册请求报文添加指纹验证签名来防止信息被修改 先来看下我们与后端定制签名规则 2.4. 签名规则 原文规则:采用标准的JSON格式,null值字段舍去,按照key值字符串升序排列 例如:{"appId":"1100310061380986","outTradeNo":"1515120685073","timest

tkinter 创建登陆注册界面

import tkinter as tk from tkinter import messagebox #设置窗口居中 def window_info(): ws = window.winfo_screenwidth() hs = window.winfo_screenheight() x = (ws / 2) - 200 y = (hs / 2) - 200 print("%d,%d" % (ws, hs)) return x,y #设置登陆窗口属性 window = tk.Tk()

页面点击Button按钮弹出登陆注册框(含短信验证功能)

1 <div class="login-hidd"></div> 2 <div class="login-wrap"> 3 <div class="login-cont"> 4 <img id="login-img-close" src="/views/image/close08.png" alt="登陆" title="&

教你使用JavaWeb实现无处不在的登陆注册

登陆注册,基本上是打开所有app都需要做的事情了,在这个大数据时代,登陆注册是最基础但也是最重要的用户数据.今天就手把手教你制作:用户登录在各大信息管理系统中,登录功能是必不可少的,他的作用就是验证用户的身份,判断用户是否是本站的会员,只有会员才能访问当前系统登录的实现步骤:1.用户填写账号和密码,提交到后台2.后台获取到账号和密码后,将其发送到数据库中进行查询3.查询结果如果为null,说明用户填写的账号或者密码有误,应该回到登录页面并提示用户重新输入4.查询结果如果不为null,说明用户填写

iOS开发之保存照片到系统相册(Photo Album)

iOS开发之保存照片到系统相册(Photo Album) 保存照片到系统相册这个功能很多社交类的APP都有的,今天我们简单讲解一下,如何将图片保存到系统相册(Photo Album). 创建UIImageView 创建UIImageView是为了将照片展示出来,我们是要把UIImage保存到系统相册(Photo Album): #define SCREEN [UIScreen mainScreen].bounds.size self.image = [UIImage imageNamed:@"i

javaweb 登陆注册页面

视图的数据修改,表中也修改引用工具类用<%@ page import=""%> <%@ page import="java.util.Date" %> <%@ page import="java.text.SimpleDateFormat" %> 引入包可以一条一条分着写,也可以在一条内直接用逗号隔开写 <%@ page import="java.util.Date,java.text.Simp

用ajax的同步请求解决登陆注册需要根据服务器返回数据判断是否能提交的问题

最近在写www.doubilaile.com的登陆注册.需要用ajax请求服务器判断用户名是否存在,用户名和密码是否匹配,进而提交数据.碰到的问题是异步请求都能成功返回数据,但是该数据不能作为紧接着的判断的依据.我现在的理解是:异步请求去了服务器端,而本地代码仍在往下执行.服务器数据最终的确会回来,但是本地判断已经执行完毕.所以才会出现密码框单独blur后能提交,而直接submit按钮却要按两次才能提交的问题.将同步改成异步问题解决了.理解是:同步操作会等待服务器数据返回来之后才继续往下执行,所

前端开发---登陆注册页面优化

1.本次用到错误提示文字的颜色 http://v3.bootcss.com/css/#forms jquery 教程: http://www.w3school.com.cn/jquery/index.asp 2.工程地址:https://github.com/digitalClass/web_page 网站发布地址: http://115.28.30.25:8029/ 3. 主要工作 优化登陆注册页面显示 因为业务需要, 登陆注册页面被后端给改了, 显示效果如下: 可以看到表单全部乱掉了.打开后

Nodejs连接MySQL&amp;&amp;实现unity中的登陆注册功能

MySQL是一款常用的开源数据库产品,通常也是免费数据库的首选.查了一下NPM列表,发现Nodejs有13库可以访问MySQL,felixge/node-mysql似乎是最受关注项目,我也决定尝试用一下. 要注意名字,"felixge/node-mysql"非"node-mysql",安装目录 1. node-mysql介绍 felixge/node-mysql是一个纯nodejs的用javascript实现的一个MySQL客户端程序.felixge/node-my