1、创建BIDTinyPixDocument类

 #import <UIKit/UIKit.h>

 //创建文档类
@interface TinyPixDocument : UIDocument
//接收一对行和列索引作为参数
- (BOOL)stateAtRow:(NSUInteger)row column:(NSUInteger)column;
//指定的行和列设置特定的状态
- (void)setState:(BOOL)state atRow:(NSUInteger)row column:(NSUInteger)column;
//负责切换特定位置处的状态
- (void)toggleStateAtRow:(NSUInteger)row column:(NSUInteger)column; @end
 #import "TinyPixDocument.h"

 //类扩展
@interface TinyPixDocument ()
@property (nonatomic,strong) NSMutableData * bitmap;
@end @implementation TinyPixDocument //将每个位图初始化为从一个角延伸到另一个角的对角线图案。
- (id)initWithFileURL:(NSURL *)url
{
self = [super initWithFileURL:url];
if (self) {
unsigned char startPattern[] = {
0x01,
0x02,
0x04,
0x08,
0x10,
0x20,
0x40,
0x80
}; self.bitmap = [NSMutableData dataWithBytes:startPattern length:];
}
return self;
} //实现读取单个位的状态的方法。实现这个方法只要从字节数组中获取相关字节,然后对其进行位移操作和AND操作,检查是否设置了给定位,相应的返回YES或NO。
- (BOOL)stateAtRow:(NSUInteger)row column:(NSUInteger)column
{
const char * bitmapBytes = [self.bitmap bytes];
char rowByte = bitmapBytes[row];
char result = ( << column) & rowByte;
if (result != ) {
return YES;
} else {
return NO;
}
}
//这个方法正好和上一个相反,用于为给定行和列的位置设置值。
- (void)setState:(BOOL)state atRow:(NSUInteger)row column:(NSUInteger)column
{
char *bitmapBytes = [self.bitmap mutableBytes];
char *rowByte = &bitmapBytes[row]; if (state) {
*rowByte = *rowByte | ( << column);
} else {
*rowByte = *rowByte & ~( << column);
}
}
//辅助方法,外部代码使用该方法来切换单个单元的状态。
- (void)toggleStateAtRow:(NSUInteger)row column:(NSUInteger)column
{
BOOL state = [self stateAtRow:row column:column];
[self setState:!state atRow:row column:column];
} //保存文档时调用
- (id)contentsForType:(NSString *)typeName error:(NSError **)outError
{
NSLog(@"saving document to URL %@", self.fileURL);
return [self.bitmap copy];
}
//系统从存储区加载了数据,并且准备将这个数据提供给文档类的一个实例时,调用此方法。
- (BOOL)loadFromContents:(id)contents ofType:(NSString *)typeName
error:(NSError **)outError
{
NSLog(@"loading document from URL %@", self.fileURL);
self.bitmap = [contents mutableCopy];
return true;
}

2、主控制器代码

 #import "BIDMasterViewController.h"
#import "BIDDetailViewController.h"
#import "BIDTinyPixDocument.h" @interface BIDMasterViewController () <UIAlertViewDelegate> @property (weak, nonatomic) IBOutlet UISegmentedControl *colorControl;
@property (strong, nonatomic) NSArray * documentFilenames;
@property (strong, nonatomic) BIDTinyPixDocument * chosenDocument; @property (strong, nonatomic) NSMetadataQuery * query;
@property (strong, nonatomic) NSMutableArray * documentURLs; @end @implementation BIDMasterViewController /* original
//接收一个文件名作为参数,将它和应用的Document目录的文件路径结合起来,然后返回一个指向该文件的URL指针。
- (NSURL *)urlForFilename:(NSString *)filename {
NSFileManager * fm = [NSFileManager defaultManager];
NSArray * urls = [fm URLsForDirectory:NSDocumentDirectory
inDomains:NSUserDomainMask];
NSURL * directoryURL = urls[0];
NSURL * fileURL = [directoryURL URLByAppendingPathComponent:filename];
return fileURL;
}
*/ - (NSURL *)urlForFilename:(NSString *)filename
{
// be sure to insert "Documents" into the path
NSURL * baseURL = [[NSFileManager defaultManager]
URLForUbiquityContainerIdentifier:nil];
NSURL * pathURL = [baseURL URLByAppendingPathComponent:@"Documents"];
NSURL * destinationURL = [pathURL URLByAppendingPathComponent:filename];
return destinationURL;
} /* original //也用到了Document目录,用于查找代表现存文档的文件。该方法获取它所找到的文件,并将它们根据创建的时间来排序,以便用户可以以“博客风格”的顺序来查看文档列表(第一个文档是最新的)。文档文件名被存放在documentFilenames属性中,然后重新加载表视图(我们尚未处理)。
- (void)reloadFiles {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask, YES);
NSString *path = paths[0];
NSFileManager *fm = [NSFileManager defaultManager]; NSError *dirError;
NSArray *files = [fm contentsOfDirectoryAtPath:path error:&dirError];
if (!files) {
NSLog(@"Encountered error while trying to list files in directory %@: %@",
path, dirError);
}
NSLog(@"found files: %@", files); files = [files sortedArrayUsingComparator:
^NSComparisonResult(id filename1, id filename2) {
NSDictionary *attr1 = [fm attributesOfItemAtPath:
[path stringByAppendingPathComponent:filename1]
error:nil];
NSDictionary *attr2 = [fm attributesOfItemAtPath:
[path stringByAppendingPathComponent:filename2]
error:nil];
return [attr2[NSFileCreationDate] compare: attr1[NSFileCreationDate]];
}];
self.documentFilenames = files;
[self.tableView reloadData];
}
*/ - (void)reloadFiles {
NSFileManager * fileManager = [NSFileManager defaultManager];
// passing nil is OK here, matches first entitlement
NSURL * cloudURL = [fileManager URLForUbiquityContainerIdentifier:nil];
NSLog(@"got cloudURL %@", cloudURL); // returns nil in simulator self.query = [[NSMetadataQuery alloc] init];
_query.predicate = [NSPredicate predicateWithFormat:@"%K like '*.tinypix'",
NSMetadataItemFSNameKey];
_query.searchScopes = [NSArray arrayWithObject:
NSMetadataQueryUbiquitousDocumentsScope];
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(updateUbiquitousDocuments:)
name:NSMetadataQueryDidFinishGatheringNotification
object:nil];
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(updateUbiquitousDocuments:)
name:NSMetadataQueryDidUpdateNotification
object:nil];
[_query startQuery];
} - (void)updateUbiquitousDocuments:(NSNotification *)notification {
self.documentURLs = [NSMutableArray array];
self.documentFilenames = [NSMutableArray array]; NSLog(@"updateUbiquitousDocuments, results = %@", self.query.results);
NSArray *results = [self.query.results sortedArrayUsingComparator:
^NSComparisonResult(id obj1, id obj2) {
NSMetadataItem *item1 = obj1;
NSMetadataItem *item2 = obj2;
return [[item2 valueForAttribute:NSMetadataItemFSCreationDateKey] compare:
[item1 valueForAttribute:NSMetadataItemFSCreationDateKey]];
}]; for (NSMetadataItem *item in results) {
NSURL *url = [item valueForAttribute:NSMetadataItemURLKey];
[self.documentURLs addObject:url];
[(NSMutableArray *)_documentFilenames addObject:[url lastPathComponent]];
} [self.tableView reloadData];
} - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return ;
} - (NSInteger)tableView:(UITableView *)tableView
numberOfRowsInSection:(NSInteger)section {
return [self.documentFilenames count];
} - (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"FileCell"]; NSString * path = self.documentFilenames[indexPath.row];
cell.textLabel.text = path.lastPathComponent.stringByDeletingPathExtension;
return cell;
} - (IBAction)chooseColor:(id)sender {
NSInteger selectedColorIndex = [(UISegmentedControl *)sender selectedSegmentIndex];
[self setTintColorForIndex:selectedColorIndex]; // NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
// [prefs setInteger:selectedColorIndex forKey:@"selectedColorIndex"];
// [prefs synchronize]; NSUbiquitousKeyValueStore * prefs = [NSUbiquitousKeyValueStore defaultStore];
[prefs setLongLong:selectedColorIndex forKey:@"selectedColorIndex"];
} - (void)setTintColorForIndex:(NSInteger)selectedColorIndex {
UIColor *tint = nil;
switch (selectedColorIndex) {
case :
tint = [UIColor redColor];
break;
case :
tint = [UIColor colorWithRed: green:0.6 blue: alpha:];
break;
case :
tint = [UIColor blueColor];
break;
default:
break;
}
[UIApplication sharedApplication].keyWindow.tintColor = tint;
} - (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated]; // NSUserDefaults * prefs = [NSUserDefaults standardUserDefaults];
// NSInteger selectedColorIndex = [prefs integerForKey:@"selectedColorIndex"]; NSUbiquitousKeyValueStore * prefs = [NSUbiquitousKeyValueStore defaultStore];
NSInteger selectedColorIndex = (int)[prefs longLongForKey:@"selectedColorIndex"]; [self setTintColorForIndex:selectedColorIndex];
[self.colorControl setSelectedSegmentIndex:selectedColorIndex];
} - (void)viewDidLoad
{
[super viewDidLoad]; UIBarButtonItem * addButton = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemAdd
target:self
action:@selector(insertNewObject)];
self.navigationItem.rightBarButtonItem = addButton;
[self reloadFiles];
} - (void)insertNewObject {
// get the name
UIAlertView *alert =
[[UIAlertView alloc] initWithTitle:@"Filename"
message:@"Enter a name for your new TinyPix document."
delegate:self
cancelButtonTitle:@"Cancel"
otherButtonTitles:@"Create", nil];
alert.alertViewStyle = UIAlertViewStylePlainTextInput;
[alert show];
} - (void)alertView:(UIAlertView *)alertView
didDismissWithButtonIndex:(NSInteger)buttonIndex {
if (buttonIndex == ) {
NSString *filename = [NSString stringWithFormat:@"%@.tinypix",
[alertView textFieldAtIndex:].text];
NSURL *saveUrl = [self urlForFilename:filename];
self.chosenDocument = [[BIDTinyPixDocument alloc] initWithFileURL:saveUrl];
[self.chosenDocument saveToURL:saveUrl
forSaveOperation:UIDocumentSaveForCreating
completionHandler:^(BOOL success) {
if (success) {
NSLog(@"save OK");
[self reloadFiles];
[self performSegueWithIdentifier:@"masterToDetail"
sender:self];
} else {
NSLog(@"failed to save!");
}
}];
}
} - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if (sender == self) {
// if sender == self, a new document has just been created,
// and chosenDocument is already set. UIViewController * destination = segue.destinationViewController;
if ([destination respondsToSelector:@selector(setDetailItem:)]) {
[destination setValue:self.chosenDocument forKey:@"detailItem"];
}
} else {
// find the chosen document from the tableview
NSIndexPath * indexPath = [self.tableView indexPathForSelectedRow];
NSString * filename = self.documentFilenames[indexPath.row];
NSURL * docUrl = [self urlForFilename:filename];
self.chosenDocument = [[BIDTinyPixDocument alloc] initWithFileURL:docUrl];
[self.chosenDocument openWithCompletionHandler:^(BOOL success) {
if (success) {
NSLog(@"load OK");
UIViewController *destination = segue.destinationViewController;
if ([destination respondsToSelector:@selector(setDetailItem:)]) {
[destination setValue:self.chosenDocument forKey:@"detailItem"];
}
} else {
NSLog(@"failed to load!");
}
}];
}
}

3、创建BIDTinyPixView视图类,用于显示用户可编辑的网格。

 #import <UIKit/UIKit.h>
@class BIDTinyPixDocument; @interface BIDTinyPixView : UIView
@property (strong, nonatomic) BIDTinyPixDocument * document;
@end
 #import "BIDTinyPixView.h"
#import "BIDTinyPixDocument.h" typedef struct {
NSUInteger row;
NSUInteger column;
} GridIndex; @interface BIDTinyPixView () @property (assign, nonatomic) CGSize blockSize;
@property (assign, nonatomic) CGSize gapSize;
@property (assign, nonatomic) GridIndex selectedBlockIndex; @end @implementation BIDTinyPixView - (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// Initialization code
[self commonInit];
}
return self;
} - (id)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
if (self) {
[self commonInit];
}
return self;
} - (void)commonInit{
_blockSize = CGSizeMake(, );
_gapSize = CGSizeMake(, );
_selectedBlockIndex.row = NSNotFound;
_selectedBlockIndex.column = NSNotFound;
} // Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
// Drawing code
if (!_document) return; for (NSUInteger row = ; row < ; row++) {
for (NSUInteger column = ; column < ; column++) {
[self drawBlockAtRow:row column:column];
}
}
} - (void)drawBlockAtRow:(NSUInteger)row column:(NSUInteger)column {
CGFloat startX = (_blockSize.width + _gapSize.width) * ( - column) + ;
CGFloat startY = (_blockSize.height + _gapSize.height) * row + ;
CGRect blockFrame = CGRectMake(startX, startY, _blockSize.width, _blockSize.height);
UIColor *color = [_document stateAtRow:row column:column] ?
[UIColor blackColor] : [UIColor whiteColor];
[color setFill];
[self.tintColor setStroke];
UIBezierPath *path = [UIBezierPath bezierPathWithRect:blockFrame];
[path fill];
[path stroke];
} - (GridIndex)touchedGridIndexFromTouches:(NSSet *)touches {
GridIndex result;
UITouch *touch = [touches anyObject];
CGPoint location = [touch locationInView:self];
result.column = - (location.x * 8.0 / self.bounds.size.width);
result.row = location.y * 8.0 / self.bounds.size.height;
return result;
} - (void)toggleSelectedBlock {
[_document toggleStateAtRow:_selectedBlockIndex.row
column:_selectedBlockIndex.column];
[[_document.undoManager prepareWithInvocationTarget:_document]
toggleStateAtRow:_selectedBlockIndex.row column:_selectedBlockIndex.column];
[self setNeedsDisplay];
} - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
self.selectedBlockIndex = [self touchedGridIndexFromTouches:touches];
[self toggleSelectedBlock];
} - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
GridIndex touched = [self touchedGridIndexFromTouches:touches];
if (touched.row != _selectedBlockIndex.row
|| touched.column != _selectedBlockIndex.column) {
_selectedBlockIndex = touched;
[self toggleSelectedBlock];
}
}

4、添加BIDDetailViewController内容

 @interface BIDDetailViewController : UIViewController

 @property (strong, nonatomic) id detailItem;

 @end
 #import "BIDDetailViewController.h"
#import "BIDTinyPixView.h" @interface BIDDetailViewController ()
@property (weak, nonatomic) IBOutlet BIDTinyPixView *pixView;
- (void)configureView;
@end @implementation BIDDetailViewController #pragma mark - Managing the detail item - (void)setDetailItem:(id)newDetailItem
{
if (_detailItem != newDetailItem) {
_detailItem = newDetailItem; // Update the view.
[self configureView];
}
} - (void)configureView
{
// Update the user interface for the detail item. if (self.detailItem) {
self.pixView.document = self.detailItem;
[self.pixView setNeedsDisplay];
}
} - (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
[self configureView];
}
//当用户按下返回按钮回到主列表时,文档实例将在没有进行任何保存操作的情况下被销毁,所以添加如下方法。
  //一旦用户离开详情页面,就关闭文档,关闭文档会导致该文档被自动保存,保存工作发生在后台线程中。
- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
UIDocument * doc = self.detailItem;
[doc closeWithCompletionHandler:nil];
}

5、添加iCloud支持

创建授权文件

6、如何查询

@property (strong, nonatomic) NSMetadataQuery * query;
@property (strong, nonatomic) NSMutableArray * documentURLs; - (void)reloadFiles {
NSFileManager * fileManager = [NSFileManager defaultManager];
// passing nil is OK here, matches first entitlement
NSURL * cloudURL = [fileManager URLForUbiquityContainerIdentifier:nil];
NSLog(@"got cloudURL %@", cloudURL); // returns nil in simulator self.query = [[NSMetadataQuery alloc] init];
_query.predicate = [NSPredicate predicateWithFormat:@"%K like '*.tinypix'",
NSMetadataItemFSNameKey];
_query.searchScopes = [NSArray arrayWithObject:
NSMetadataQueryUbiquitousDocumentsScope];
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(updateUbiquitousDocuments:)
name:NSMetadataQueryDidFinishGatheringNotification
object:nil];
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(updateUbiquitousDocuments:)
name:NSMetadataQueryDidUpdateNotification
object:nil];
[_query startQuery];
} //实现查询完成时的那些通知
//查询的结果包含在一个NSMetadataItem对象的列表,从中我们可以获取文件URL和创建日期等数据项,我们根据创建日期来排列这些项,然后获取所有的URL以供之后使用。
- (void)updateUbiquitousDocuments:(NSNotification *)notification {
self.documentURLs = [NSMutableArray array];
self.documentFilenames = [NSMutableArray array]; NSLog(@"updateUbiquitousDocuments, results = %@", self.query.results);
NSArray *results = [self.query.results sortedArrayUsingComparator:
^NSComparisonResult(id obj1, id obj2) {
NSMetadataItem *item1 = obj1;
NSMetadataItem *item2 = obj2;
return [[item2 valueForAttribute:NSMetadataItemFSCreationDateKey] compare:
[item1 valueForAttribute:NSMetadataItemFSCreationDateKey]];
}]; for (NSMetadataItem *item in results) {
NSURL *url = [item valueForAttribute:NSMetadataItemURLKey];
[self.documentURLs addObject:url];
[(NSMutableArray *)_documentFilenames addObject:[url lastPathComponent]];
} [self.tableView reloadData];
}

7、保存到哪里

 - (NSURL *)urlForFilename:(NSString *)filename
{
// be sure to insert "Documents" into the path
NSURL * baseURL = [[NSFileManager defaultManager]
URLForUbiquityContainerIdentifier:nil];
NSURL * pathURL = [baseURL URLByAppendingPathComponent:@"Documents"];
NSURL * destinationURL = [pathURL URLByAppendingPathComponent:filename];
return destinationURL;
}

8、将首选项保存到iCloud

 - (IBAction)chooseColor:(id)sender {
NSInteger selectedColorIndex = [(UISegmentedControl *)sender selectedSegmentIndex];
[self setTintColorForIndex:selectedColorIndex]; // NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
// [prefs setInteger:selectedColorIndex forKey:@"selectedColorIndex"];
// [prefs synchronize]; NSUbiquitousKeyValueStore * prefs = [NSUbiquitousKeyValueStore defaultStore];
[prefs setLongLong:selectedColorIndex forKey:@"selectedColorIndex"];
}
 - (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated]; // NSUserDefaults * prefs = [NSUserDefaults standardUserDefaults];
// NSInteger selectedColorIndex = [prefs integerForKey:@"selectedColorIndex"]; NSUbiquitousKeyValueStore * prefs = [NSUbiquitousKeyValueStore defaultStore];
NSInteger selectedColorIndex = (int)[prefs longLongForKey:@"selectedColorIndex"];

[self setTintColorForIndex:selectedColorIndex];
[self.colorControl setSelectedSegmentIndex:selectedColorIndex];
}

iCloud之旅的更多相关文章

  1. 精通iOS开发(第5版)

    <精通iOS开发(第5版)> 基本信息 原书名:Beginning ios 6 development:exploring the ios sdk 作者: (美)David Mark   ...

  2. Linq之旅:Linq入门详解(Linq to Objects)

    示例代码下载:Linq之旅:Linq入门详解(Linq to Objects) 本博文详细介绍 .NET 3.5 中引入的重要功能:Language Integrated Query(LINQ,语言集 ...

  3. WCF学习之旅—第三个示例之四(三十)

           上接WCF学习之旅—第三个示例之一(二十七)               WCF学习之旅—第三个示例之二(二十八)              WCF学习之旅—第三个示例之三(二十九)   ...

  4. 【C#代码实战】群蚁算法理论与实践全攻略——旅行商等路径优化问题的新方法

    若干年前读研的时候,学院有一个教授,专门做群蚁算法的,很厉害,偶尔了解了一点点.感觉也是生物智能的一个体现,和遗传算法.神经网络有异曲同工之妙.只不过当时没有实际需求学习,所以没去研究.最近有一个这样 ...

  5. Hadoop学习之旅二:HDFS

    本文基于Hadoop1.X 概述 分布式文件系统主要用来解决如下几个问题: 读写大文件 加速运算 对于某些体积巨大的文件,比如其大小超过了计算机文件系统所能存放的最大限制或者是其大小甚至超过了计算机整 ...

  6. .NET跨平台之旅:在生产环境中上线第一个运行于Linux上的ASP.NET Core站点

    2016年7月10日,我们在生产环境中上线了第一个运行于Linux上的ASP.NET Core站点,这是一个简单的提供后端服务的ASP.NET Core Web API站点. 项目是在Windows上 ...

  7. 【Knockout.js 学习体验之旅】(3)模板绑定

    本文是[Knockout.js 学习体验之旅]系列文章的第3篇,所有demo均基于目前knockout.js的最新版本(3.4.0).小茄才识有限,文中若有不当之处,还望大家指出. 目录: [Knoc ...

  8. 【Knockout.js 学习体验之旅】(2)花式捆绑

    本文是[Knockout.js 学习体验之旅]系列文章的第2篇,所有demo均基于目前knockout.js的最新版本(3.4.0).小茄才识有限,文中若有不当之处,还望大家指出. 目录: [Knoc ...

  9. 【Knockout.js 学习体验之旅】(1)ko初体验

    前言 什么,你现在还在看knockout.js?这货都已经落后主流一千年了!赶紧去学Angular.React啊,再不赶紧的话,他们也要变out了哦.身旁的90后小伙伴,嘴里还塞着山东的狗不理大蒜包, ...

随机推荐

  1. JavaScript中的重载解读

    在JavaScript中有一种特殊的数据类型---Function类型,JavaScript的每个函数都是Function类型的实例.由于函数是对象,因此函数名实际上也是一个指向函数对象的指针,不会与 ...

  2. BestCoder Round #76 解题报告

    DZY Loves Partition [思路] 贪心 [代码] #include <iostream> using namespace std; typedef long long ll ...

  3. 为Android游戏接入第三方登录功能

    1. “游戏客户端”调用“SDK客户端”的登录功能向“SDK服务端”进行身份认证 2. 验证通过后,“游戏客户端”可得到用户信息,根据游戏逻辑可将用户信息传给“游戏服务器”进行验证 3. “游戏服务器 ...

  4. Create a commit using pygit2

    Create a commit using pygit2 Create a commit using pygit2 2015-04-06 10:41 user1479699 imported from ...

  5. 现代程序设计 homework-08

    现代程序设计 homework-08 第八次作业. 理解C++变量的作用域和生命周期 作用域就是一个变量可以被引用的范围,如:全局作用域.文件作用域.局部作用域:而生命周期就是这个变量可以被引用的时间 ...

  6. Spring EL hello world example

    The Spring EL is similar with OGNL and JSF EL, and evaluated or executed during the bean creation ti ...

  7. SMTP邮件服务器配置

    QQ个人邮箱使用: smtp.qq.com端口为25 密码是个人邮箱密码 QQ企业邮箱使用: smtp.exmail.qq.com端口为25 密码是邮箱密码 163邮箱使用 smtp.163.com端 ...

  8. 12个有趣的C语言面试题

    摘要:12个C语言面试题,涉及指针.进程.运算.结构体.函数.内存,看看你能做出几个! 1.gets()函数 问:请找出下面代码里的问题: #include<stdio.h> int ma ...

  9. ASP.NET- 使用NPOI导入导出标准Excel

    尝试过很多Excel导入导出方法,都不太理想,无意中逛到oschina时,发现了NPOI,无需Office COM组件且不依赖Office,顿时惊为天人,怀着无比激动的心情写下此文. 曾使用过的方法 ...

  10. 利用微软Speech SDK 5.1开发语音识别系统主要步骤

    利用微软Speech SDK 5.1开发语音识别系统主要步骤 2009-09-17 10:21:09|  分类: 知识点滴|字号 订阅 微软语音识别分两种模式:文本识别模式和命令识别模式.此两种模式的 ...