Friday, 15 March 2013

How to capture all dynamic value in a text file

Place below code in vuser_init() section:

long InvoiceRequestID_file;
char *InvoiceRequestID="c:\\InvoiceRequestId.dat";



Place below code in Action part:

Here InvoiceRequestId is the variable name that in web_reg_save_param();

if ((InvoiceRequestID_file = fopen(InvoiceRequestID, "a+")) == NULL )
 {
  lr_error_message("Cannot open %s", InvoiceRequestID);

  return -1;
 }

 fprintf(InvoiceRequestID_file, "%s\n",lr_eval_string("{InvoiceRequestId}"));
 fclose(InvoiceRequestID_file);


Output: All value of InvoiceRequestId will be captured in InvoiceRequestId.dat file and new value will be append at the end of file.
Note : No need to declare a+ anywhere as it takes as the string.

No comments:

Post a Comment

How to Change Password of IUSR_METRO Account

Sometime we need to change the password of IUSR_METRO Account. This may be required due to compliance issue. Below are the steps to chang...