Action()
{
char *filename =
"D:\\sundar\\From_LR\\cntr_wid_date_112.txt";
long file;
char *groupname;
int id,m,n;
m=rand()%21+20;
n=atoi(lr_eval_string("{VID}"));
lr_output_message("Vuser ID
is: %d",n);
lr_save_datetime("%y%m%d",
DATE_NOW, "FileDate");
lr_save_datetime("%y/%m/%d",
DATE_NOW, "Date");
lr_save_datetime("%H:%M",
TIME_NOW, "Time");
// Create a
new file
file = fopen(filename,
"a+" );
fprintf(file, "Random number is: %d
and Vuser Number is: %d \n and today is:
%s, at %s on %s. \r\n",m,n,
lr_eval_string("{FileDate}"),
lr_eval_string("{Time}"), lr_eval_string("{Date}"));
// Write the
Vuser ID and group to the log file
lr_whoami(&id, &groupname, NULL);
fprintf(file, "log file of virtual
user ID: %d group: %s\n", id, groupname);
/* lr_save_datetime("%y%m%d",
DATE_NOW, "FileDate");
lr_save_datetime("%y/%m/%d",
DATE_NOW, "Date");
lr_save_datetime("%H:%M",
TIME_NOW, "Time");
// Write the
Vuser ID and group to the log file
sprintf(OutputFile,"D:\\sundar\\From_LR\\output_33_2.txt",
lr_eval_string("{FileDate}"),
lr_eval_string("{Iteration}"),
lr_eval_string("{Time}"),
lr_eval_string("{Date}"));
lr_whoami(&id,
&groupname, NULL);
fprintf(file, "log file of virtual
user ID: %d group: %s\n", id, groupname);
*/
fclose(file);
lr_think_time(10);
return 0;
}
Note: Some of the articles are grab from various Websites / Blogs.
No comments:
Post a Comment