这两天敲一个小例子——学生信息管理系统,其中需要用到对学习信息的保存和读取操作,这些有关文件操作如下:
1、将文件的信息读取到变量中
//从文件d:/student.bin读取信息到变量中
void readfile( FILE *fp, int &StuAmount, Stu Student[] )
{
if((fp=fopen("d:/student.bin","r"))==NUL...
分类:
其他好文 时间:
2015-05-27 17:29:32
阅读次数:
119
var fs = require(‘fs‘);
var async = require(‘../lib/async.js‘)
var db=require(‘../lib/mysql.js‘);
!function main(){
async.waterfall([function(call){
fs.readFile(‘./aaa.html‘,‘utf-8‘,call...
分类:
其他好文 时间:
2015-05-26 21:39:09
阅读次数:
143
在cygwin中安装配置composer需要以下步骤: 1、创建一个存放composer的目录; 2、在该目录下运行: php?-r?"readfile(‘https://getcomposer.org/installer‘);"?|?php 3、下载完毕之后: alias?composer="php...
分类:
Windows程序 时间:
2015-05-22 00:42:22
阅读次数:
1124
源代码如下:父页面:window.showModalDialog("../readfile/readFile.jsp","","dialogWidth=1000px;dialogHeight=500px;status=no;help=no;resizable:yes");子页面:readFile.j...
分类:
其他好文 时间:
2015-05-21 10:42:04
阅读次数:
145
说明:在apache服务器中提供一个文件下载,一般使用一个url指向服务器中的文件即可提供下载。缺点:不能进行统计,权限检测等操作。1,一般使用php提供下载,例如:复制代码代码示例:2,处理中文文件名:复制代码代码示例:使用php readfile,需要经过php这层。如果可以直接通过apache...
分类:
Web程序 时间:
2015-05-18 18:30:16
阅读次数:
523
Similar with
the linux version , this article would demonstrate how to write a simple windows .
I divide the 2 operations : write and read into 2 threads. Of course, one could call ReadFile a...
node中提供了异步和同步的方式,下面只使用异步的方式去操作文件,同步会堵塞线程,不建议使用
//引入 fs
var fs=require("fs");
//读取文件
fs.readFile("D:\\bianjiqi\\web.config",function(err,data){
console.log(data.toS...
分类:
其他好文 时间:
2015-05-05 19:35:37
阅读次数:
153
以ReadFile为例ntdll.dll导出了ZwReadFile和NtReadFile在用户态不管你调用ZwReadFile还是NtReadFile都是一样的因为他们是同一个函数的两个不同名称而已....而且他们最终都会调用到ntoskrnl中的NtReadFile中去在内核态ntoskrnl.e...
分类:
其他好文 时间:
2015-05-03 01:57:35
阅读次数:
162
也就是在CreateFile的时候打开文件名指定: “\\.\Device”就可以了. 因为代码比较短, 所以我不做注释, 相信大家看代码就能明白意思了. 另外这里读写的都是软盘A盘第0扇区, 如果想读写其他的扇区, 那么可以使用API SetFilePointer. 读扇区的方法(下面的代码演示从A盘的第0扇区读出数据, 写入到文件BOOT.BIN中): #include #incl...