loadrunner——写
函数:fwriter(写内容,内容长度,个数,写入的文件);
前提条件:打开文件,打开文件失败返回:NULL
fopen(文件路径,打开文件格式)
long filedes;
char file[256]="F:\\test.txt";
if ((filedes = fopen(file, "wb")) == NULL) { //判断文件是否成功打开,“wb+”创建或打开文件
lr_output_message("Unable to create %s",file);
return -1;
}
fwrite(lr_eval_string("test"),4,1, filedes); //向文件中写入内容
fclose(filedes); //关闭文件
loadrunner ——txt读
函数:fread(读取结果保存,保存大小,读取内容大小,读取的文件);