博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
autoit3 ie.au3 函数之——_FileWriteLog日志
阅读量:4051 次
发布时间:2019-05-25

本文共 958 字,大约阅读时间需要 3 分钟。

例子:将日志添加到日志文件中,如果日志文件不存在,则自动生成日志文件。

#include <file.au3>

_FileWriteLog("日志文件.log", "日志内容", -1)

第一个参数为:日志文件的路径

   最好的格式为路径+文件名、@ScriptDir & "\my.log"

第二个参数为:日志内容

第三个参数为:标识符

   默认情况下,日志显示在文件的最后一行,即标识符为:-1

详细介绍:

Writes current date,time and the specified text to a log file.

#Include <File.au3>

_FileWriteLog($sLogPath, $sLogMsg [, $iFlag = -1])

 

Parameters

$sLogPath Path and filename of the file to be written to
$sLogMsg Message to be written to the log file
$iFlag [optional] Flag that defines if $sLogMsg will be written to the end of file, or to the begining.
If $iFlag = -1 (default) $sLogMsg will be written to the end of file.
If $iFlag <> -1 $sLogMsg will be written to begining of file.

 

Return Value

Success: 1
Failure: 0 and set @error
@Error: 1 = Error opening specified file
  2 = File could not be written to

 

Remarks

None.

 

Related

 

Example

#include <file.au3>
;
_FileWriteLog(@ScriptDir & "\my.log","Text 1")
;
_FileWriteLog(@ScriptDir & "\my.log","Text 2")

转载地址:http://qkjci.baihongyu.com/

你可能感兴趣的文章
佛教三宝-三皈依
查看>>
杂阿含经喻世间有四等马
查看>>
考研前夜涂笔
查看>>
英语复试自我介绍
查看>>
什么是熵?
查看>>
拼凑、摘抄-评李代平的软件工程第二版
查看>>
误传了数千年的几个名句
查看>>
韩复榘经典语录
查看>>
厅、部、局、司区分大小
查看>>
VS2005中使用C#编写MDI窗口根据子窗口个数控制菜单项的enabled属性
查看>>
北川邓家“刘汉小学”无一死亡奇迹背后的真相
查看>>
救灾,从来没有胜利
查看>>
.net 2.0中ConfigurationManager替代了原来的ConfigurationSettings
查看>>
Asp.net 2.0中使用Datawindow.net2.0
查看>>
常用命名法:骆驼命名法,匈牙利命名法和帕斯卡命名法
查看>>
Server.MapPath方法测试结果
查看>>
Asp.net 默认配置下,Session莫名丢失的原因及解决办法
查看>>
Datawindow.net中如何使用Calendar控件
查看>>
如何在Datawindow.net中实现让当前行选中,并且当前行以其他颜色显示
查看>>
Datawindow.net如何使用导航栏
查看>>