zoukankan      html  css  js  c++  java
  • UISB 登陆

    ViewController.h

    #import <UIKit/UIKit.h>
    
    @interface ViewController : UIViewController
    {
        //登录页面的组成
        //登陆名提示 输入框
        //密码提示
        //登录按钮
        //注册按钮
        //作为私有 
        UILabel* _lbUserName;
        UILabel* _lbPassword;
        
        UITextField* _tfUserName;
        UITextField* _tfPassWord;
        
        UIButton* _btLogin;
        UIButton* _btRegister;
        
    }
    
    
    
    @end

    viewController.m

    #import "ViewController.h"
    
    @interface ViewController ()
    
    @end
    
    @implementation ViewController
    
    - (void)viewDidLoad {
        [super viewDidLoad];
        // Do any additional setup after loading the view.
        _lbUserName=[[UILabel alloc]init];
        _lbUserName.frame=CGRectMake(20, 60, 80, 40);
        _lbUserName.text=@"用户名";
        _lbUserName.font=[UIFont systemFontOfSize:20];
        _lbUserName.textAlignment=NSTextAlignmentLeft;
        
        _lbPassword=[[UILabel alloc]init];
        _lbPassword.frame=CGRectMake(20, 140, 80, 40);
        _lbPassword.text=@"密码";
        _lbPassword.font=[UIFont systemFontOfSize:20];
        _lbPassword.textAlignment=NSTextAlignmentLeft;
    
        
        _tfUserName=[[UITextField alloc]init];
        _tfUserName.frame=CGRectMake(120, 60, 180, 40);
        _tfUserName.placeholder=@"亲输入用户名";
        _tfUserName.borderStyle=UITextBorderStyleRoundedRect;
        
        _tfPassWord=[[UITextField alloc]init];
        _tfPassWord.frame=CGRectMake(120, 140, 180, 40);
        _tfPassWord.placeholder=@"请输入密码";
        _tfPassWord.borderStyle=UITextBorderStyleRoundedRect;
        _tfPassWord.secureTextEntry=YES;
        
        _btLogin=[UIButton buttonWithType:UIButtonTypeRoundedRect];
        _btLogin.frame=CGRectMake(120, 300, 80, 40);
        [_btLogin setTitle:@"登陆" forState:UIControlStateNormal];
        [_btLogin addTarget:self action:@selector(pressLogin) forControlEvents:UIControlEventTouchUpInside];
        
        
        _btRegister=[UIButton buttonWithType:UIButtonTypeRoundedRect];
        _btRegister.frame=CGRectMake(120, 360, 80, 40);
        [_btRegister setTitle:@"注册" forState:UIControlStateNormal];
        [_btRegister addTarget:self action:@selector(pressRegister) forControlEvents:UIControlEventTouchUpInside];
        
        [self.view addSubview:_lbUserName];
        [self.view addSubview:_lbPassword];
        [self.view addSubview:_tfUserName];
        [self.view addSubview:_tfPassWord];
        [self.view addSubview:_btLogin];
        [self.view addSubview:_btRegister];
        
        
        
    }
    //登陆
    
    -(void)pressLogin
    {
        NSString* strName=@"michael";
        NSString* strPass=@"123456";
        //获取输入框中的用户名
        NSString* strTextName=_tfUserName.text;
        NSString* strTextPass=_tfPassWord.text;
        
        if ([strName isEqualToString:strTextName] && [strPass isEqualToString:strTextPass])
        {
            
            NSLog(@"用户名密码正确");
    //        UIAlertView* alView =[[UIAlertView alloc] initWithTitle:@"提示" message:@"验证成功,登陆成功" delegate:nil cancelButtonTitle:@"确认" otherButtonTitles:nil];
    //        [alView show];
            
        }else
        {
            NSLog(@"用户名密码错误");
    //        UIAlertView* alView=[[UIAlertView alloc] initWithTitle:@"提示" message:@"验证失败 用户名或密码错误" delegate:nil cancelButtonTitle:@"确认" otherButtonTitles:nil];
    //        [alView show];
            
        }
        
        
        
        
        
        
    }
    //注册
    -(void)pressRegister
    {
        
        
        
    }
    
    -(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
    {
        //回收键盘
        [_tfUserName resignFirstResponder];
        [_tfPassWord resignFirstResponder];
        
    }
    
    
    @end
  • 相关阅读:
    活期存款利息的计算方法
    Arachni web扫描工具
    python 多进程——使用进程池,多进程消费的数据)是一个队列的时候,他会自动去队列里依次取数据
    TCP报文格式和三次握手——三次握手三个tcp包(header+data),此外,TCP 报文段中的数据部分是可选的,在一个连接建立和一个连接终止时,双方交换的报文段仅有 TCP 首部。
    https ddos检测——研究现状
    https ddos攻击——由于有了认证和加解密 后果更严重 看绿盟的产品目前对于https的ddos cc攻击需要基于内容做检测
    识别TLS加密恶意流量
    CC工具列表
    MAP 最大后验——利用经验数据获得对未观测量的点态估计
    MAPE 平均绝对百分误差
  • 原文地址:https://www.cnblogs.com/zhangqing979797/p/13681651.html
Copyright © 2011-2022 走看看