bool CDownLoad_LocalData::WriteToConfigFile( DownLoadLocalData* downdata ){

CCDictionary* pDict = CCDictionary::create(); 

unsigned int lessonid = downdata->lession_id;

char s_lessonid[10];

sprintf(s_lessonid,"%d",lessonid);





CCString* pValue1 = CCString::create(s_lessonid);

CCString* pValue2 = CCString::create(downdata->fileLocal_path);  

CCString* pValue3 = CCString::create(downdata->downUrl);  

pDict->setObject(pValue1, "lessonid");  

pDict->setObject(pValue2, "fileLocal_path");  

pDict->setObject(pValue3, "downUrl"); 





m_total_dict->setObject(pDict,pValue1->getCString());





if(m_total_dict->writeToFile(m_fileapth.c_str()))//m_fileapth为写文件的路径

CCLog("Write to file success!");

return true;

}

cocos2d-x3.0 用CCDictionary写文件的更多相关文章

  1. ASCII与Unicode编码消息写文件浅析

    [文章摘要] ASCII与Unicode是两种常见的字符编码. 它们的表示方法不一样,因而在程序中就要差别处理. 本文基于作者的实际开发经验,对ASCII与Unicode两种字符编码消息的写文件过程进 ...

  2. node基础07:写文件

    1.writeFile //server.js var http = require("http"); var writefile = require("./writef ...

  3. java写文件

                                  randomAccessFile.close();              }                  e.printStack ...

  4. Java基础之写文件——将素数写入文件中(PrimesToFile)

    控制台程序,计算素数.创建文件路径.写文件. import static java.lang.Math.ceil; import static java.lang.Math.sqrt; import ...

  5. IAR MSP430如何生成烧写文件

    IAR生成430烧写方法有2种, 第一种是:将工程的debug模式切换成release模式,看图片操作.    那个.d43文件就是仿真调试模式的文件. 这里的test.txt文件就是烧写文件了,不要 ...

  6. HDFS dfsclient写文件过程 源码分析

    HDFS写入文件的重要概念 HDFS一个文件由多个block构成.HDFS在进行block读写的时候是以packet(默认每个packet为64K)为单位进行的.每一个packet由若干个chunk( ...

  7. 嵌入式:使用dd命令制作烧写文件

    1. 使用dd命令制作烧写文件 环境: bootargs=mem=64M console=ttyAMA0,115200 root=/dev/mtdblock2 rootfstype=jffs2 mtd ...

  8. Java:逐行读、写文件、文件目录过滤的用法

    import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.I ...

  9. 如何在Cocos2D 1.0 中掩饰一个精灵(六)

    大熊猫猪·侯佩原创或翻译作品.欢迎转载,转载请注明出处. 如果觉得写的不好请告诉我,如果觉得不错请多多支持点赞.谢谢! hopy ;) 掩饰一个精灵:实现代码 打开HelloWorldLayer.m并 ...

随机推荐

  1. SQL Server 中位数、标准差、平均数

    create table examines ( ,) NOT NULL, ) NULL, [ph_score] [int] NULL ) SELECT dept_name, AVG(sp) as '中 ...

  2. 关于MyEclipse2017Ci10版本的破解和Tomcat9.0的安装搭配使用

    昨天和今天就忙这两件事情了.废话不多说直接上干货! 首先是关于Myeclipse2017的破解,关于这个破解,网上的资源和文件很多,可以自行下载,我就不贴链接了. 我要说的是破解的问题,在这里我们要注 ...

  3. Difference between scipy.fftpack and numpy.fft

    scipy.fftpack 和 numpy.fft 的区别 When applying scipy.fftpack.rfft and numpy.fft.rfft I get the followin ...

  4. 横向开关(switch)

    横向开关(switch) 一:属性 1.Activity //横向开关 public class SwitchActivity extends Activity { private Switch sw ...

  5. Linux运维体系

  6. [翻译] SlideInView

    SlideInView This is a quick and lightweight example of how to present a notification like view from ...

  7. POP3、SMTP端口(SSL、TSL)

    POP3服务器地址: 110           995 支持SSLSMTP服务器地址: 25            465 或者 587 支持SSL(TSL) 465端口是SSL/TLS通讯协议的 ...

  8. Java学习---Pinyin4j使用手册

    一般用法 pinyin4j的使用很方便,一般转换只需要使用PinyinHelper类的静态工具方法即可: String[] pinyin = PinyinHelper.toHanyuPinyinStr ...

  9. Eclipse导出可运行的jar包并运行

    https://blog.csdn.net/kpchen_0508/article/details/49275407 程序运行的第二种方式:

  10. VS 2012 在 windows 8 中无法使用 Deubgger.Lunch() 对服务进行调试

    找到了外文资料:   Debugger.Launch() not displaying JIT debugger selection popup on Windows 8/8.1   If execu ...