Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - What function should loadrunner use to output relevant data to a file in the specified directory? Detailed description, thank you.
What function should loadrunner use to output relevant data to a file in the specified directory? Detailed description, thank you.
You can only write c code to complete it. The following code is for reference. If you think it's complicated, you don't have to write it so perfectly.

If ((file _ stream = fopen (filename, "a+")= = null)// Open the file.

Fprintf(file_stream, lr _ eval _ string ("{your relevance}");

The following is the complete code

Int id, scid// define two plastic variables that hold vuser information.

Char * group// define and save the groupname.

char * filename = " c:\ \ work . log "; //Create the storage log file manually.

Long file _ stream;

If ((file _ stream = fopen (filename, "a+")= = null)// Open the file.

{

Lr_error_message ("Cannot open %s", file name);

return- 1;

}

lr _ whoami(& amp; id & amp; Group & scid); //Get variables

lr_save_datetime("%H:%M:%S ",DATE_NOW + TIME_NOW," times "); //Get the current time and judge the user login time.

if(id & gt; 0)

{

Fprintf(file_stream, "vuser user information: time =% s, ID =% d, group =% s, SCID =% d, Uname =% s \ n", LR _ eval _ string ("{times} "), ID, group, SCID, LR _.

}

fclose(file _ stream);