QQ登录

第一个简单的IOS程序是实现了一个QQ登陆界面

main:

 1 #import <UIKit/UIKit.h>
 2
 3 #import "DXWAppDelegate.h"
 4
 5 int main(int argc, char *argv[])
 6 {
 7     //消息循环,当程序退出的时候才会y有返回值
 8     @autoreleasepool {
 9         //UIApplication是单粒的,是一个应用程序的象征,一个IOS程序对应一个UIApplication
10         //第三个参数用来指定Application类名(或者为子类),默认为nil(UIApplication类名),第四个参数用来指定代理类
11         return UIApplicationMain(argc, argv, nil, NSStringFromClass([DXWAppDelegate class]));
12         //return UIApplicationMain(argc, argv, NSStringFromClass([UIApplication class]), NSStringFromClass([DXWAppDelegate class]));
13
14     }
15 }

//监听应用程序一些生命周期状态

AppDelegate.h

 1 #import <UIKit/UIKit.h>
 2
 3 @class DXWViewController;
 4
 5 @interface DXWAppDelegate : UIResponder <UIApplicationDelegate>
 6 //string暂时理解成retain,需要释放
 7 @property (strong, nonatomic) UIWindow *window;
 8
 9 @property (strong, nonatomic) DXWViewController *viewController;
10
11 @end

AppDelegate.m

 1 //
 2 //  DXWAppDelegate.m
 3 //  firstDemo
 4 //
 5 //  Created by dingxiaowei on 13-5-20.
 6 //  Copyright (c) 2013年 dingxiaowei. All rights reserved.
 7 //
 8
 9 #import "DXWAppDelegate.h"
10
11 #import "DXWViewController.h"
12
13 @implementation DXWAppDelegate
14
15 - (void)dealloc
16 {
17     [_window release];
18     [_viewController release];
19     [super dealloc];
20 }
21 #pragma mark - 应用程序加载完毕之后调用
22 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
23 {
24     NSLog(@"didFinishLaunchingWithOptions--程序加载完毕");
25     //初始化一个窗口
26     self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
27
28
29     //自己手动创建一个按钮
30 //    CGRect btnFrame=CGRectMake(100, 360, 100, 50);
31 //    UIButton *btn=[[UIButton alloc] initWithFrame:btnFrame];  //也可以这样  //UIButton *btn=[UIButton buttonWithType:UIButtonTypeRoundedRect]; btn.frame=btnFrame;
32 //    [btn setTitle:@"我是按钮" forState:UIControlStateNormal];
33 //    [self.window addSubview:btn];
34
35
36     // Override point for customization after application launch.
37     //传入一个xib文件名来初始化一个控制器
38     self.viewController = [[[DXWViewController alloc] initWithNibName:@"DXWViewController" bundle:nil] autorelease];
39     self.window.rootViewController = self.viewController;
40     //上面的代码内部相当于执行了下面这行代码
41     //[self.window addSubview:self.viewController.view];
42     //设置窗口可见   在众多窗口中keyWindow才能充当主窗口  只有主窗口才能跟用户交互
43     [self.window makeKeyAndVisible];
44     //下面这个方法也能显示主界面,但是不能成为主窗口,也就是说不能跟用户打交到
45     //self.window.hidden=NO;
46     return YES;
47 }
48 #pragma mark - 程序失去焦点时候调用(指不能跟用户进行交互了)
49 - (void)applicationWillResignActive:(UIApplication *)application
50 {
51     NSLog(@"applicationWillResignActive--程序失去焦点了");
52     // 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.
53     // 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.
54 }
55 #pragma mark - 当程序进入后台的时候,就调用这个方法 (比如点击home键)
56 - (void)applicationDidEnterBackground:(UIApplication *)application
57 {
58     NSLog(@"applicationDidEnterBackground--程序进入后台");
59     // 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.
60     // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
61 }
62 #pragma mark - 当程序进入前台的时候,调用该方法
63 - (void)applicationWillEnterForeground:(UIApplication *)application
64 {
65     NSLog(@"applicationWillEnterForeground--程序进入前台");
66     // 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.
67 }
68 #pragma mark - 当应用程序获取焦点的时候调用
69 //获取焦点之后才可以跟用户进行交互
70 - (void)applicationDidBecomeActive:(UIApplication *)application
71 {
72     NSLog(@"applicationDidBecomeActive--获取焦点");
73     // 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.
74 }
75 #pragma mark - 程序在某些情况下被终结是调用
76 - (void)applicationWillTerminate:(UIApplication *)application
77 {
78     NSLog(@"applicationWillTerminate--程序被关闭");
79     // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
80 }
81
82 @end

ViewController.h

 1 #import <UIKit/UIKit.h>
 2
 3 @interface DXWViewController : UIViewController
 4 //UI元素不需要我们去进行内存管理
 5 @property(nonatomic,assign) IBOutlet UITextField *qq;
 6 @property(nonatomic,assign) IBOutlet UITextField *pwd;
 7
 8 //IBActoin其实就是void,但是它能够让方法名显示在xib的右击列表中
 9 -(IBAction) login;
10
11 @end

ViewController.m

 1 #pragma mark - 登陆
 2 -(void)login{
 3     NSString *qqText=_qq.text;  //这里的下划线也就代表xib中的文本框
 4     NSString *pwdText=_pwd.text;
 5     NSLog(@"QQ=%@,密码=%@",qqText,pwdText);
 6     //暂时理解:叫出键盘的那个视图就是第一响应者[FirstResponder]
 7     //resignFirstResponder代表这个视图不想当第一相应者,那不想当以后键盘就退出
 8     //退出键盘
 9     //[_qq resignFirstResponder];
10     //[_pwd resignFirstResponder];
11     //或者这种方法(条件:如果第一响应者存在于当前调用着的view中,则能退出第一相应者)
12     [self.view endEditing:YES];
13 }
14
15 - (void)viewDidLoad
16 {
17     [super viewDidLoad];
18     // Do any additional setup after loading the view, typically from a nib.
19 }
20
21 - (void)didReceiveMemoryWarning
22 {
23     [super didReceiveMemoryWarning];
24     // Dispose of any resources that can be recreated.
25 }
26
27 @end

 

时间: 2024-08-01 09:57:37

QQ登录的相关文章

如何禁止QQ登录

其实QQ的服务器是有限的,你只要花点时间去找就可以了.我们只要禁止掉登录的服务器就可以了.QQ登录过程中间会查询DNS服务器的,你把查询的包抓下来就可以知道它有哪些地址了.找到一个,禁止一个,直道你的QQ再也无法登陆成功. 个人觉得这个办法,似呼成了体力活了.具我了解QQ的服务器实在是不少啊.如果都这样一个一个的找.要找到啥时候?哎--之前对禁用QQ还有一个比较偷懒的办法就是,禁止所有深圳的IP....这个办法似呼又毒了点...

QQ登录窗口里粘贴QQ密码的超简单方法

QQ为了保护用户密码的安全,不允许在登录窗口中粘贴QQ密码.不管是用Ctrl+V,还是点右键粘贴都不行. 可有时我们还是有在QQ登录窗口粘贴密码的需要.那么就告诉你一种在QQ登录窗口粘贴密码的超级简单方法吧: 1.复制QQ密码,让它在内存里存着 2.在QQ登录窗口的密码输入框中点一下 3.按下Shift+F10 4.松开F10(Shift按住不放),再按下P键(或者用鼠标点"粘贴") 成功!密码粘贴进去了.哈哈!简单吧

C#实现的QQ登录器

前几天看到一篇文章说通过DOS命令就可以登陆QQ,在运行里试了一下,真的可以 代码如下: Code [copy to clipboard] CODE: QQ路径 /start QQUIN:QQ号 PWDHASH:经过MD5和BASE64双充加密的QQ密码 /stat:登陆类型 今天就想做个QQ登录器试一下,信息保存尝试使用了序列化,发现功能真的太强大了,刚才整理了一下,现在完工,里面做了大量的注释,放出代码,文章最下面有打包的下载: QQLoginForm.cs窗体 Code [copy to

高仿Windows Phone QQ登录界面实例代码

 这篇文章主要介绍了高仿Windows Phone QQ登录界面实例代码,有需要的朋友可以参考一下 给 TextBox文本框前添加图片   扩展PhoneTextBox:添加一个类"ExtentPhoneTextBox"继承 PhoneTextBox ,在"ExtentPhoneTextBox"类中添加属性项:     代码如下: public class ExtentPhoneTextBox : PhoneTextBox     {         /// <

Win7系统防火墙怎么限制QQ登录

  1.打开qq登录页面,点击右上角红圈圈出的部位; 2.在网络类型的设置里面选择"使用浏览器设置"; 3.在登录服务器的类型里面可自由选择服务器类型试试; 4.点击"开始"--"控制面板; 5.点击"系统和安全"; 6.点击"windows防火墙"; 7.点击"打开或关闭windows防火墙"; 8.可暂时关闭防火墙(之后一定要记得打开).

win7系统防火墙限制QQ登录怎么办

  QQ技巧          防火墙限制QQ登录的解决办法: 1.打开qq登录页面,点击右上角红圈圈出的部位; 2.在网络类型的设置里面选择"使用浏览器设置"; 3.在登录服务器的类型里面可自由选择服务器类型试试; 4.点击"开始"--"控制面板; 5.点击"系统和安全"; 6.点击"windows防火墙"; 7.点击"打开或关闭windows防火墙"; 8.可暂时关闭防火墙(之后一定要记得打开

QQ登录banner再设计

QQ登录banner是与用户沟通情感的小窗口,在一些特殊的日子里我们尝试一些力所能及的表达方式来给用户一种感动,一种记忆. QQ登录banner正力求避免直白的画面呈现,增强画面的趣味性.故事性,唤起用户共鸣,以幽默的方式带给用户愉悦的心情. 下面分类归纳一些节日banner的创作过程,通过记录一些设计过程中的反复与纠结,总结几点与大家共享. 网页设计教程 一. 避免低幼与直白的画面铺陈 [开学日] 九月一日开学,对于在校学生或是毕业许久的社会人士,都是痛并快乐的日子.普遍学子的情感,渡过漫长悠

QQ登录背景闪动效果附效果演示源码下载_基础知识

在前面时间更新的新版本QQ中,登录背景和以前不一样了,是一组闪动的背景,效果非常棒. 效果演示     源码下载 改效果需要引入三个js文件: <script src="js/Jq-19.js" type="text/javascript"></script> <script src="js/cavas.js" type="text/javascript"></script> &

使用java swing实现qq登录界面示例分享_java

用Java Swing做的一个QQ登录界面 复制代码 代码如下: import java.awt.Container;import java.awt.Image;import java.awt.event.ActionEvent;import java.awt.event.ActionListener; import javax.swing.ImageIcon;import javax.swing.JButton;import javax.swing.JCheckBox;import javax

Android实现QQ登录界面遇到问题及解决方法_Android

先给大家炫下效果图: 首先过程中碰到的几个问题: 1.对 EditText 进行自定义背景 2.运行时自动 EditText 自动获得焦点 3.在获得焦点时即清空 hint ,而不是输入后清空 4.清空按钮的出现时机(在得到焦点并且有输入内容时) ......... --- 这些问题都有一一解决 --- 以下是代码: 布局 fragment_main(问题2) <!-- android:focusable="true" android:focusableInTouchMode=&