回复:wincc用户登录后怎样识别?

oicu2002

  • 帖子

    24
  • 精华

    0
  • 被关注

    0

论坛等级:新手

注册时间:2003-06-06

普通 普通 如何晋级?

发布于 2003-05-15 10:07:33

0楼

这是记录用户登陆和登出时间的源码,用户信息放在C:\Wincclog.txt文件当中:
#include "apdefap.h"

int gscAction( void )
{
char* username, buf[128];
static char preuser[128];
FILE *fp;


username = GetTagChar("@CurrentUser");
if (strcmp(username,preuser) != 0)
{
fp= fopen("c:\wincclog.txt", "a+");
if(strcmp(username, "") != 0)
{
if(strcmp(preuser, "") != 0)
{
SetTagChar("previous",preuser);
SetTagChar("timelogout1",GetLocalTimeString());
sprintf(buf, "%s Logout at %s\n", preuser, GetLocalTimeString());
fputs(buf, fp);

}

SetTagChar("user1",username);
SetTagChar("timelogin1",GetLocalTimeString());
sprintf(buf, "%s Login at %s\n", username, GetLocalTimeString());
fputs(buf, fp);
}else
{
SetTagChar("user1",username);
SetTagChar("previous",preuser);

SetTagChar("timelogout1",GetLocalTimeString());
sprintf(buf, "%s Logout at %s\n", preuser, GetLocalTimeString());
fputs(buf, fp);

}
strcpy(preuser, username);
fclose(fp);
}

return 0;
}
评论
编辑推荐: 关闭

请填写推广理由:

本版热门话题

SIMATIC WinCC / Panel

共有32574条技术帖

相关推荐

热门标签

相关帖子推荐

guzhang

恭喜,你发布的帖子

评为精华帖!

快扫描右侧二维码晒一晒吧!

再发帖或跟帖交流2条,就能晋升VIP啦!开启更多专属权限!

  • 分享

  • 只看
    楼主

top
您收到0封站内信:
×
×
信息提示
很抱歉!您所访问的页面不存在,或网址发生了变化,请稍后再试。