实例一:
Action()
{
char * abort="aborting...";
char * my_host;
char *ip;
ip = lr_get_vuser_ip();
if (ip)
lr_output_message("The IP address is %s", ip);
else
lr_output_message("IP spoofing disabled");
lr_message ("login failed: %s", abort);
lr_save_datetime("Tomorrow is %B %d %Y", DATE_NOW +ONE_DAY, "next");
lr_output_message(lr_eval_string("{next}"));
my_host = lr_get_host_name( );
lr_output_message("您的机器名称:%s", my_host);
return 0;
}
实例二:
#include "web_api.h"
Action()
{
int totalprice;
int price[3]={3,4,5};
int nummber[3]={6,7,8};
int i;
for (i=0;i<3;i++)
{
totalprice=totalprice + price[i]*nummber[i];
}
lr_output_message("total price is %d",totalprice);
return 0;
}