LCleaner 与 Lua

本文介绍LCleaner这款清理工具及其脚本编写方法。LCleaner支持通过Lua脚本扩展清理功能,示例包括清除Google工具栏搜索记录及最近打开的文档等。

http://www.585soft.com/LCleaner.asp#

LCleaner是一款用于清除临时文件以及各种操作历史纪录的清理工具, 本来现在这种工具很多, 不足为奇.
但是LCleaner的查找引擎是基于lua scripts, 用户可以很容易地写新的脚本进行功能扩展。

脚本中必须定义以下4个函数, 以便LCleaner回调。

GetPluginNameThis function must return script name to display in list.
GetPluginIconThis function must return system icon index for item in list.
GetSizeApplication call this function to determine size and number of objects (for example files or registry keys).
ClearApplication call this function to clean (delete) objects.

 

处理google ToolBar搜索纪录的例子:

function this.GetPluginName()

return "Google Tool Bar Search History";

end


function this.GetPluginIcon()

icon = this:GetIconIndex("%windir%//regedit.exe");

return icon;

end


function this.GetSize()

local size = 0;

count = this:RegKeyGetNumberOfValues("HKEY_CURRENT_USER//Software//Google//NavClient//1.1//History");

return size, count;

end


function this.Clear()

this:RegKeyDeleteValues("HKEY_CURRENT_USER//Software//Google//NavClient//1.1//History");

end

Script for Recent Documents:


 

function this.GetPluginName()

return "Recent Documents";

end


function this.GetPluginIcon()

icon = this:icon = this:GetIconIndex("%RECENT%");

return icon;

end


function this.GetSize()

local size = 0;

count = this:GetFolderSize("%RECENT%", "", true);

return size, count;

end


function this.Clear()

this:DeleteFolderContent("%RECENT%", "", true);

end

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值