一.展示实现

效果

    

客户端:                                      服务器端:

          

二.创建表

  1. create table CourseVideo
  2. (
  3. VideoID int IDENTITY(,) NOT NULL,
  4. CourseID int NOT NULL, VideoName varchar() NULL,
  5. VideoPath [varchar]() NULL,
  6. VideoImage [varchar]() NULL,
  7. VideoDes [varchar]() NULL,
  8. VideoLength int NULL,
  9. primary key(VideoID)
  10. )
  11.  
  12.   

添加数据

  1. INSERT [dbo].[CourseVideo] ([VideoID], [CourseID], [VideoName], [VideoPath], [VideoImage], [VideoDes]) VALUES (, , N'数组1_为什么要使用数组.mp4', N'CourseVideo/1.mp4', N'CourseImage/1.png', NULL)
  2. GO
  3. INSERT [dbo].[CourseVideo] ([VideoID], [CourseID], [VideoName], [VideoPath], [VideoImage], [VideoDes]) VALUES (, , N'数组2_什么是数组', N'CourseVideo/2.mp4', N'CourseImage/2.png', NULL)
  4. GO
  5. INSERT [dbo].[CourseVideo] ([VideoID], [CourseID], [VideoName], [VideoPath], [VideoImage], [VideoDes]) VALUES (, , N'数组3_数组的分类及特点', N'CourseVideo/3.mp4', N'CourseImage/3.png', NULL)
  6. GO
  7. INSERT [dbo].[CourseVideo] ([VideoID], [CourseID], [VideoName], [VideoPath], [VideoImage], [VideoDes]) VALUES (, , N'数组4:一维数组的声明', N'CourseVideo/4.mp4', N'CourseImage/4.png', NULL)
  8. GO
  9. INSERT [dbo].[CourseVideo] ([VideoID], [CourseID], [VideoName], [VideoPath], [VideoImage], [VideoDes]) VALUES (, , N'数组5:一维数组的初始化', N'CourseVideo/5.mp4', N'CourseImage/5.png', NULL)
  10. GO
  11. INSERT [dbo].[CourseVideo] ([VideoID], [CourseID], [VideoName], [VideoPath], [VideoImage], [VideoDes]) VALUES (, , N'数组6:一维数组的访问(引用)', N'CourseVideo/6.mp4', N'CourseImage/6.png', NULL)
  12. GO
  13. INSERT [dbo].[CourseVideo] ([VideoID], [CourseID], [VideoName], [VideoPath], [VideoImage], [VideoDes]) VALUES (, , N'数组7:数组的算法:查找', N'CourseVideo/7.mp4', N'CourseImage/7.png', NULL)
  14. GO
  15. INSERT [dbo].[CourseVideo] ([VideoID], [CourseID], [VideoName], [VideoPath], [VideoImage], [VideoDes]) VALUES (, , N'数组8:数组的算法:排序 (1)', N'CourseVideo/8.mp4', N'CourseImage/8.png', NULL)
  16. GO
  17. INSERT [dbo].[CourseVideo] ([VideoID], [CourseID], [VideoName], [VideoPath], [VideoImage], [VideoDes]) VALUES (, , N'数组09:二维数组的声明', N'CourseVideo/9.mp4', N'CourseImage/9', NULL)
  18. GO
  19. INSERT [dbo].[CourseVideo] ([VideoID], [CourseID], [VideoName], [VideoPath], [VideoImage], [VideoDes]) VALUES (, , N'数组10:二维数组的初始化', N'CourseVideo/10.mp4', N'CourseImage/10.png', NULL)
  20. GO
  21. INSERT [dbo].[CourseVideo] ([VideoID], [CourseID], [VideoName], [VideoPath], [VideoImage], [VideoDes]) VALUES (, , N'数组11:二维数组的访问', N'CourseVideo/11.mp4', N'CourseImage/11.png', NULL)
  22. GO
  23. INSERT [dbo].[CourseVideo] ([VideoID], [CourseID], [VideoName], [VideoPath], [VideoImage], [VideoDes]) VALUES (, , N'数组12:多维数组简介', N'CourseVideo/12.mp4', N'CourseImage/12.png', NULL)
  24. GO
  25. INSERT [dbo].[CourseVideo] ([VideoID], [CourseID], [VideoName], [VideoPath], [VideoImage], [VideoDes]) VALUES (, , N'数组13:C语言中的字符串', N'CourseVideo/13.mp4', N'CourseImage/13.png', NULL)
  26. GO
  27. INSERT [dbo].[CourseVideo] ([VideoID], [CourseID], [VideoName], [VideoPath], [VideoImage], [VideoDes]) VALUES (, , N'数组14:字符数组', N'CourseVideo/14.mp4', N'CourseImage/14.png', NULL)
  28. GO
  29. INSERT [dbo].[CourseVideo] ([VideoID], [CourseID], [VideoName], [VideoPath], [VideoImage], [VideoDes]) VALUES (, , N'数组15:字符串的输入输出', N'CourseVideo/15.mp4', N'CourseImage/15.png', NULL)
  30. GO
  31. INSERT [dbo].[CourseVideo] ([VideoID], [CourseID], [VideoName], [VideoPath], [VideoImage], [VideoDes]) VALUES (, , N'数组16:字符串处理函数', N'CourseVideo/16.mp4', N'CourseImage/16.jpg', NULL)
  32. GO

记得视频路径勿加中文,否则视频播放不出来

三.搭建WebService服务器

1.DatableToList.cs文件用于DataTable转换List<T>

  1. public class DatableToList
  2. {
  3. public static List<T> ConvertToList<T>(DataTable dt) where T : new()
  4. {
  5. //定义集合
  6. List<T> ts = new List<T>();
  7.  
  8. //获得此模型的类型
  9. Type type = typeof(T);
  10.  
  11. //定义一个临时变量
  12. string tempName = string.Empty;
  13.  
  14. //便利DataTable数据行
  15. foreach (DataRow dr in dt.Rows)
  16. {
  17. T t = new T();
  18. //获得此模型的公共属性
  19. PropertyInfo[] propertys = t.GetType().GetProperties();
  20.  
  21. //遍历该对象的所有属性
  22. foreach(PropertyInfo pi in propertys)
  23. {
  24. tempName = pi.Name;//将属性名称赋值给临时变量
  25. //检查DataTable是否包含此列(列名==对象的属性名)
  26. if (dt.Columns.Contains(tempName))
  27. {
  28. // 判断此属性是否有Setter
  29. if (!pi.CanWrite) continue;//该属性不可写,直接跳出
  30. //取值
  31. object value = dr[tempName];
  32. //如果非空,则赋给对象的属性
  33. if (value != DBNull.Value)
  34. pi.SetValue(t, value, null);
  35. }
  36. }
  37. //对象添加到泛型集合中
  38. ts.Add(t);
  39. }
  40. return ts;
  41. }
  42.  
  43. }

2.创建Model类库

CourseVideo.cs类

  1. public class CourseVideo
  2. {
  3. private int videoID;
  4.  
  5. public int VideoID
  6. {
  7. get { return videoID; }
  8. set { videoID = value; }
  9. }
  10. private int courseID;
  11.  
  12. public int CourseID
  13. {
  14. get { return courseID; }
  15. set { courseID = value; }
  16. }
  17. private String videoName;
  18.  
  19. public String VideoName
  20. {
  21. get { return videoName; }
  22. set { videoName = value; }
  23. }
  24. private String videoPath;
  25.  
  26. public String VideoPath
  27. {
  28. get { return videoPath; }
  29. set { videoPath = value; }
  30. }
  31. private String videoImage;
  32.  
  33. public String VideoImage
  34. {
  35. get { return videoImage; }
  36. set { videoImage = value; }
  37. }
  1.     private int videoLength;
  1.      public int VideoLength
  2. {
  3. get { return videoLength; }
  4. set { videoLength = value; }
  5. }
  1. }

3.创建Dal类库

CourseVideoDal.cs类

查询CourseVideo表信息

这是比较简单容易理解的方式,但是字段多的话就很不实用。

  1. //查询视频资源
  2. public List<CourseVideo> Select()
  3. {
  4. List<CourseVideo> list = new List<CourseVideo>();
  5. DataTable dt = new DataTable();
  6. CourseVideo model = null;
  7. DataBase db = new DataBase();
  8. String comstr = "select VideoID,CourseID,VideoName,VideoPath,VideoImage,VideoLength from CourseVideo";
  9. dt = db.GetDataTable(comstr);
  10. for (int i = ; i < dt.Rows.Count;i++ )
  11. {
  12. model = new CourseVideo();
  13. model.VideoID = Convert.ToInt32(dt.Rows[i][]);
  14. model.CourseID = Convert.ToInt32(dt.Rows[i][]);
  15. model.VideoName = dt.Rows[i][].ToString();
  16. model.VideoPath = dt.Rows[i][].ToString();
  17. model.VideoImage = dt.Rows[i][].ToString();
               model.VideoLength = Convert.ToInt32(dt.Rows[i][5]);
              list.Add(model);
           }
            return list;
         }

之前新建的DatableToList.cs类文件就可以用到了,使用泛型将DataTable数据转换为List<T>

泛型之前一直没机会用到,于是自己百度学习了一下,封装好DatableToList文件后,很好的提高代码

了质量,更方便使用。

  1. //使用泛型 查询视频资源
  2. public List<CourseVideo> Select2()
  3. {
  4. List<CourseVideo> list = new List<CourseVideo>();
  5. DataTable dt = new DataTable();
  6. DataBase db = new DataBase();
  7. String comstr = "select VideoID,CourseID,VideoName,VideoPath,VideoImage,VideoLength from CourseVideo";
  8. dt = db.GetDataTable(comstr);
  9. list = DatableToList.ConvertToList<CourseVideo>(dt);
  10. return list;
  11.  
  12. }

4.新建Web 服务

 只需要在App_Code文件夹下找到Service.cs添加

4.1返回json格式

添加命名空间:

using System.Web.Script.Services;
using System.Web.Script.Serialization;

还有在方法前面声明

[WebMethod(Description = "json查询视频资源")]

  1. [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
  1. [WebMethod(Description = "json查询视频资源")]
  2. [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
  3. public String VideoSelect()
  4. {
  5. return new JavaScriptSerializer().Serialize(courseVideoDal.Select());
  6. // return dal.Select();
  7.  
  8. }

4.1返回xml格式

  1. [WebMethod(Description = "xml查询视频资源")]
  2.  
  3. public List<CourseVideo> xmlVideoSelect()
  4. {
  5. return courseVideoDal.Select();
  6. }

设置外部访问需要在Web.config添加节点:

  1. <webServices>
  2. <protocols>
  3. <add name="HttpSoap" />
  4. <add name="HttpPost" />
  5. <add name="HttpGet" />
  6. <add name="Documentation" />
  7. </protocols>
  8. </webServices>

看下结果

接下来把项目部署在IIS服务器上即可使用,如何部署我这就不多说了,可以查一下百度

附件:忘记保存了,这里用到一个工具

WSDL2ObjC-0.6.zip

Parse WSDL后稍等15秒左右出现Finish!查看导入目录

将生成的所有文件放置在wsdl2objc文件夹导入项目中

尝试编译出现错误如下:1."libxml/tree.h" file not found

解决办法:

链接libxml2.2dylib库

TARGETS -> Build Phases -> Linking Binary With Libraries-> libxml2.2dylib

TARGETS -> Build Settings -> Search Paths-> Header Search Paths,设置“/usr/include/libxml2”

TARGETS -> Build Phases -> Compile Sources  将Service.m,USAddition.m,NSDate+ISO8601Unparsing.m,NSDate+ISO8601Parsing.m

文件 设置不使用ARC   -fno-objc-arc

手动ARC设置方法如下:

1.在Compiler Flags一列加上-fno-objc-arc就表示禁止这个.m文件的ARC

2.在Compiler Flags一列加上-fobjc-arc就表示开启这个.m文件的ARC

5.创建数据模型

lmjVideo.h文件

  1. //视频ID
  2. @property (assign,nonatomic) int ID;
  3.  
  4. //视频名称
  5. @property (copy,nonatomic) NSString *name;
  6.  
  7. //视频长度
  8. @property (assign,nonatomic) int length;
  9.  
  10. //视频图片
  11. @property (copy,nonatomic) NSString *image;
  12.  
  13. //视频链接
  14. @property (copy,nonatomic) NSString *url;
  15.  
  16. + (instancetype)videoWithDict:(NSDictionary *)dict;

lmjVideo.m文件

  1. +(instancetype)videoWithDict:(NSDictionary *)dict
  2. {
  3. lmjVideo *video = [[self alloc] init];
  4. video.name = dict[@"VideoName"];
  5. video.image = dict[@"VideoImage"];
  6. video.url = dict[@"VideoPath"];
  7. video.length = [dict[@"VideoLength"] intValue];
  8. video.ID = [dict[@"VideoID"] intValue];
  9. return video;
  10.  
  11. // [video setValuesForKeysWithDictionary:dict]; // KVC方法使用前提: 字典中的所有key 都能在 模型属性 中找到
  12.  
  13. }

自定义cell,对cell内部数据处理的封装

lmjVideoCell.h文件

文件

  1. @class lmjVideo;
  2. @interface lmjVideoCell : UITableViewCell
  3.  
  4. @property (nonatomic,strong) lmjVideo *video;
  5. + (instancetype)cellWithTableView:(UITableView *)tableView;

lmjVideoCell.m文件

  1. #import "lmjVideoCell.h"
  2. #import "lmjVideo.h"
  3. #import "UIImageView+WebCache.h"
  4. #import "UIView+Extension.h"
  5. @interface lmjVideoCell()
  6. @property (nonatomic,weak) UIView *driver;
  7.  
  8. @end
  9.  
  10. @implementation lmjVideoCell
  11.  
  12. + (instancetype)cellWithTableView:(UITableView *)tableView
  13. {
  14. static NSString *ID = @"video";
  15. lmjVideoCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
  16. if (!cell)
  17. {
  18. cell = [[lmjVideoCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID];
  19. }
  20. return cell;
  21. }
  22.  
  23. - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
  24. {
  25. self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
  26.  
  27. if (self) {
  28. UIView *driver = [[UIView alloc] init];
  29. driver.backgroundColor = [UIColor lightGrayColor];
  30. driver.alpha = 0.2;
  31. [self.contentView addSubview:driver];
  32. self.driver = driver;
  33.  
  34. }
  35.  
  36. return self;
  37. }
  38.  
  39. - (void)setVideo:(lmjVideo *)video
  40. {
  41. _video = video;
  42.  
  43. self.textLabel.text = video.name;
  44. self.detailTextLabel.text = [NSString stringWithFormat:@"时长:%d分钟",video.length];
  45.  
  46. NSString *imageUrl = [NSString stringWithFormat:@"http://180.84.33.156:8882/%@",video.image];
  47. [self.imageView setImageWithURL:[NSURL URLWithString:imageUrl] placeholderImage:[UIImage imageNamed:@"placeholder"]];
  48. }
  49.  
  50. - (void)layoutSubviews
  51. {
  52. [super layoutSubviews];
  53.  
  54. //调整子控件的frame
  55. CGFloat imageX = ;
  56. CGFloat imageY = ;
  57. CGFloat imageH = self.height - * imageY;
  58. CGFloat imageW = imageH * / ;
  59. self.imageView.frame = CGRectMake(imageX, imageY, imageW, imageH);
  60.  
  61. self.textLabel.x = CGRectGetMaxX(self.imageView.frame) + ;
  62.  
  63. self.detailTextLabel.x = self.textLabel.x;
  64.  
  65. CGFloat driverH = ;
  66. CGFloat driverY = self.height - driverH;
  67. CGFloat driverW = self.width;
  68. self.driver.frame = CGRectMake(, driverY, driverW, driverH);
  69.  
  70. }

分类

UIView+Extension.h文件

添加一个UIView的分类,直接修改UI控件的x值

  1. @property (nonatomic,assign) CGFloat x;
  2. @property (nonatomic,assign) CGFloat y;
  3. @property (nonatomic,assign) CGFloat width;
  4. @property (nonatomic,assign) CGFloat height;

UIView+Extension.m文件

  1. #import "UIView+Extension.h"
  2.  
  3. @implementation UIView (Extension)
  4.  
  5. - (void)setX:(CGFloat)x
  6. {
  7. CGRect frame = self.frame;
  8. frame.origin.x = x;
  9. self.frame = frame;
  10. }
  11.  
  12. - (CGFloat)x
  13. {
  14. return self.frame.origin.x;
  15. }
  16.  
  17. - (void)setY:(CGFloat)y
  18. {
  19. CGRect frame = self.frame;
  20. frame.origin.y = y;
  21. self.frame = frame;
  22. }
  23.  
  24. - (CGFloat)y
  25. {
  26. return self.frame.origin.y;
  27. }
  28.  
  29. - (void)setWidth:(CGFloat)width
  30. {
  31. CGRect frame = self.frame;
  32. frame.size.width = width;
  33. self.frame = frame;
  34.  
  35. }
  36.  
  37. - (CGFloat)width
  38. {
  39. return self.frame.size.width;
  40. }
  41.  
  42. - (void)setHeight:(CGFloat)height
  43. {
  44. CGRect frame = self.frame;
  45. frame.size.height = height;
  46. self.frame = frame;
  47. }
  48. - (CGFloat)height
  49. {
  50. return self.frame.size.height;
  51. }
  52. @end

实现“视屏列表界面只支持竖屏方向

自定义lmjNavigationController控制器,其继承自UINavigationController

  1. UIInterfaceOrientationMaskPortrait:竖屏(正常)
  2. UIInterfaceOrientationMaskPortraitUpsideDown:竖屏(上下颠倒)
  3. UIInterfaceOrientationMaskLandscapeLeft:横屏向左
  4. UIInterfaceOrientationMaskLandscapeRight:横屏向右
  5. UIInterfaceOrientationMaskLandscape:横屏(左右都支持)
  6. UIInterfaceOrientationMaskAll:所有都支持

lmjNavigationViewController.m

  1. #import "lmjNavigationViewController.h"
  2.  
  3. @interface lmjNavigationViewController ()
  4.  
  5. @end
  6.  
  7. @implementation lmjNavigationViewController
  8.  
  9. //控制当前控制器支持那些方向
  10.  
  11. -(NSUInteger)supportedInterfaceOrientations
  12. {
      //竖屏 
  13. return UIInterfaceOrientationMaskPortrait;
  14. }
  15.  
  16. @end

自定义lmjMoviePlayerViewController控制器,继承MPMoviePlayerViewController

导入MediaPlayer.framework框架,lmjMoviePlayerViewController.h在添加头文件

#import <MediaPlayer/MediaPlayer.h>

lmjMoviePlayerViewController.m

  1. #import "lmjMoviePlayerViewController.h"
  2.  
  3. @interface lmjMoviePlayerViewController ()
  4.  
  5. @end
  6.  
  7. @implementation lmjMoviePlayerViewController
  8.  
  9. - (void)viewDidLoad
  10. {
  11. [super viewDidLoad];
  12.  
  13. // 移除程序进入后台的通知
  14. [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidEnterBackgroundNotification object:nil];
  15. }
  16.  
  17. #pragma mark - 实现这个方法来控制屏幕方向
  18. /**
  19. * 控制当前控制器支持哪些方向
  20. * 返回值是UIInterfaceOrientationMask*
  21. */
  22. - (NSUInteger)supportedInterfaceOrientations
  23. {
  24. return UIInterfaceOrientationMaskLandscape;
  25. }

@end

6.主控制器文件代码:

需要注意的是,视频播放的文件路径勿加中文,否则视频不能播放

  1. //
  2. // lmjViewController.m
  3. // 橙子视频客户端
  4. //
  5. // Created by lmj on 15-6-24.
  6. // Copyright (c) 2015年 lmj. All rights reserved.
  7. //
  8.  
  9. #import "lmjViewController.h"
  10. #import "MBProgressHUD+MJ.h"
  11. #import "lmjVideo.h"
  12. #import "UIImageView+WebCache.h"
  13. #import "lmjMoviePlayerViewController.h"
  14. #import "lmjVideoCell.h"
  15. #import "Service.h"
  16. #define strUrl @"http://180.84.33.156:8882"
  17. @interface lmjViewController ()
  18. //所有视频的集合
  19. @property (nonatomic,strong) NSArray *videos;
  20. @end
  21.  
  22. @implementation lmjViewController
  23.  
  24. - (void)viewDidLoad
  25. {
  26. [super viewDidLoad];
  27. [MBProgressHUD showMessage:@"正在加载视频信息..."];
  28. NSString *result;
  29. NSData *data;
  30. ServiceSoap *binding = [Service ServiceSoap];
  31. Service_VideoSelect *request = [[Service_VideoSelect alloc] init];
  32. ServiceSoap12Response *response = [binding VideoSelectUsingParameters:request];
  33. for(id mine in response.bodyParts){
  34. if([mine isKindOfClass:[Service_VideoSelectResponse class]])
  35. {
  36. // [request release];
  37. [MBProgressHUD hideHUD];
  38.  
  39. result = [mine VideoSelectResult];
  40. data = [result dataUsingEncoding:NSUTF8StringEncoding];
  41. if(data)
  42. {
  43. // NSLog(@"data----%@",data);
  44. NSArray *array =[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
  45. NSMutableArray *videos = [NSMutableArray array];
  46. for (NSDictionary *dict in array) {
  47. lmjVideo *video = [lmjVideo videoWithDict:dict];
  48. [videos addObject:video];
  49. NSLog(@"%@",video.url);
  50. }
  51. self.videos = videos;
  52. [self.tableView reloadData];
  53. }
  54. else{
  55. [MBProgressHUD showError:@"网络繁忙"];
  56. }
  57.  
  58. // NSLog(@"ns----%@",ns);
  59. // NSDictionary *dict= [NSJSONSerialization JSONbjectWithData:data options:NSJSONReadingAllowFragmentS error:nil];
  60.  
  61. }
  62. }
  63.  
  64. }
  65. #pragma mark -数据源
  66. -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  67. {
  68. return self.videos.count;
  69. }
  70.  
  71. -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  72. {
  73. lmjVideoCell *cell = [lmjVideoCell cellWithTableView:tableView];
  74. cell.video = self.videos[indexPath.row];
  75. return cell;
  76. }
  77.  
  78. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
  79. {
  80. return ;
  81. }
  82.  
  83. -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  84. {
  85. lmjVideo *video = self.videos[indexPath.row];
  86.  
  87. //播放视频
  88. NSLog(@"%@",video.url);
  89. NSString *videoUrl = [NSString stringWithFormat:@"http://180.84.33.156:8882/%@",video.url];
  90. lmjMoviePlayerViewController *playerVc = [[lmjMoviePlayerViewController alloc] initWithContentURL:[NSURL URLWithString:videoUrl]];
  91.  
  92. [self presentMoviePlayerViewControllerAnimated:playerVc] ; //全拼播放
  93. }
  94.  
  95. @end

iOS网络开发-打造自己的视频客户端的更多相关文章

  1. iOS视频流开发(1)—视频基本概念

    iOS视频流开发(1)-视频基本概念 手机比PC的优势除了便携外,她最重要特点就是可以快速方便的创作多媒体作品.照片分享,语音输入,视频录制,地理位置.一个成功的手机APP从产品形态上都有这其中的一项 ...

  2. IOS网络开发概述

    概览 大部分应用程序都或多或少会牵扯到网络开发,例如说新浪微博.微信等,这些应用本身可能采用iOS开发,但是所有的数据支撑都是基于后台网络服务器的.如今,网络编程越来越普遍,孤立的应用通常是没有生命力 ...

  3. IOS网络开发(三)

    1 飞机航班查询软件 1.1 问题 NSURLConnection是IOS提供的用于处理Http协议的网络请求的类,可以实现同步请求也可以实现异步请求,本案例使用NSURLConnection类实现一 ...

  4. IOS网络开发(二)

    1 局域网群聊软件 1.1 问题 UDP协议将独立的数据包从一台计算机传输到另外一台计算机,但是并不保证接受方能够接收到该数据包,也不保证接收方所接收到的数据和发送方所发送的数据在内容和顺序上是完全一 ...

  5. IOS网络开发实战(二)

      1 飞机航班查询软件 1.1 问题 NSURLConnection是IOS提供的用于处理Http协议的网络请求的类,可以实现同步请求也可以实现异步请求,本案例使用NSURLConnection类实 ...

  6. IOS网络开发实战(一)

      1 局域网群聊软件 1.1 问题 UDP协议将独立的数据包从一台计算机传输到另外一台计算机,但是并不保证接受方能够接收到该数据包,也不保证接收方所接收到的数据和发送方所发送的数据在内容和顺序上是完 ...

  7. 初探iOS网络开发,数据解析。

    通过大众点评平台开发来简单了解一下,oc的网络编程和数据解析(json) 首先我们需要到大大众点评开发者平台申请一个key.http://developer.dianping.com/app/tech ...

  8. IOS网络开发(一)

    1 简易的聊天工具 1.1 问题 Socket的英文原义是孔或者插座的意思,通常也称作套接字,用于描述IP地址和端口,是一个通信链的句柄,本案例使用第三方Socket编程框架AsyncSocket框架 ...

  9. ios网络开发 网络状态检查

    http://www.cnblogs.com/hanjun/archive/2012/12/01/2797622.html 网络连接中用到的类: 一.Reachability 1.添加 Reachab ...

随机推荐

  1. MVC4,MVC3,VS2012+ entity framework Migration from Sqlserver to Mysql

    在开发的初期个人认为因VS与Sqlserver的配合很默契,即可以方便的实现Code First,又可以使用SqlServer Manager很漂亮的进行建模与变更,也许是个人的使用习惯MS的界面做的 ...

  2. libvirt C-API

    1,warming-up Specifying URIs to libVirt;name parameter to virConnectOpen or          virConnectOpenR ...

  3. 兔子--Android中的五大布局

    LinearLayout:被称为线性布局,分为水平和垂直,设置的垂直或水平的属性值,来排列全部的子元素.全部的子元素都被堆放在其他元素之后,因此一个垂直列表的每一行仅仅会有一个元素,而无论他们有多宽, ...

  4. SP2-0618: Cannot find the Session Identifier. Check PLUSTRACE role is enabled

    SP2-0618: Cannot find the Session Identifier. Check PLUSTRACE role is enabled 今天是2013-09-17,在今天学习sql ...

  5. sql server 2005中没有等于等于,高手自行跳过。。

    set ANSI_NULLS ONset QUOTED_IDENTIFIER ONgo ALTER TRIGGER [qiandaoTrigger] ON [dbo].[bbsQianDao] AFT ...

  6. html基础标签-2-textarea文本域

    textarea文本域 <!doctype html> <html lang='zh-cn'> <head> <meta charset='utf-8'> ...

  7. .cs文件与aspx.cs文件之间的区别是什么???他们的作用是什么???ASPX文件的作用是什么?

    一般在vs里面新建一个页面会产生两种文件:一种是后缀名为.cs的,一种是.aspx. 简单的说,.cs文件一般是在里面实现功能的,而.aspx就是实现界面效果的. 区别:.cs文件里面写的是.net的 ...

  8. 大数据之scala基本语法学习

    package edu.snnu.test object list2 { //把字符串转化成一个char类型的list "99 Red Balloons".toList //> ...

  9. IO库 8.5

    题目:重写8.4中的函数,将每一个单词作为一个独立的元素进行存储. #include <iostream> #include <fstream> #include <st ...

  10. BZOJ 3230: 相似子串( RMQ + 后缀数组 + 二分 )

    二分查找求出k大串, 然后正反做后缀数组, RMQ求LCP, 时间复杂度O(NlogN+logN) -------------------------------------------------- ...