找回密码
 加入
搜索
查看: 1612|回复: 4

[AU3基础] 谁帮改下这个脚本(已解决)

[复制链接]
发表于 2011-6-15 17:36:08 | 显示全部楼层 |阅读模式
本帖最后由 p5200151 于 2011-11-19 19:58 编辑
$tb1= IniRead("tb.ini","需要删除的图标", "图标1", "配置文件不存在")
$tb2= IniRead("tb.ini","需要删除的图标", "图标2", "配置文件不存在")
$tb3= IniRead("tb.ini","需要删除的图标", "图标3", "配置文件不存在")
$tb4= IniRead("tb.ini","需要删除的图标", "图标1", "配置文件不存在")
$tb5= IniRead("tb.ini","需要删除的图标", "图标2", "配置文件不存在")
$tb6= IniRead("tb.ini","需要删除的图标", "图标3", "配置文件不存在")
$tb7= IniRead("tb.ini","需要删除的图标", "图标1", "配置文件不存在")
$tb8= IniRead("tb.ini","需要删除的图标", "图标2", "配置文件不存在")
$tb9= IniRead("tb.ini","需要删除的图标", "图标3", "配置文件不存在")
$tb10= IniRead("tb.ini","需要删除的图标", "图标1", "配置文件不存在")
$tb11= IniRead("tb.ini","需要删除的图标", "图标2", "配置文件不存在")
$tb12= IniRead("tb.ini","需要删除的图标", "图标3", "配置文件不存在")
$tb13= IniRead("tb.ini","需要删除的图标", "图标1", "配置文件不存在")
$tb14= IniRead("tb.ini","需要删除的图标", "图标2", "配置文件不存在")
$tb15= IniRead("tb.ini","需要删除的图标", "图标3", "配置文件不存在")
$tb16= IniRead("tb.ini","需要删除的图标", "图标1", "配置文件不存在")
$tb17= IniRead("tb.ini","需要删除的图标", "图标2", "配置文件不存在")
$tb18= IniRead("tb.ini","需要删除的图标", "图标3", "配置文件不存在")
$tb19= IniRead("tb.ini","需要删除的图标", "图标4", "配置文件不存在")
$tb20= IniRead("tb.ini","需要删除的图标", "图标5", "配置文件不存在")

Do
FileDelete( @DesktopDir & $tb1)
FileDelete( @DesktopDir & $tb2)
FileDelete( @DesktopDir & $tb3)
FileDelete( @DesktopDir & $tb4)
FileDelete( @DesktopDir & $tb5)
FileDelete( @DesktopDir & $tb6)
FileDelete( @DesktopDir & $tb7)
FileDelete( @DesktopDir & $tb8)
FileDelete( @DesktopDir & $tb9)
FileDelete( @DesktopDir & $tb10)
FileDelete( @DesktopDir & $tb11)
FileDelete( @DesktopDir & $tb12)
FileDelete( @DesktopDir & $tb13)
FileDelete( @DesktopDir & $tb14)
FileDelete( @DesktopDir & $tb15)
FileDelete( @DesktopDir & $tb16)
FileDelete( @DesktopDir & $tb17)
FileDelete( @DesktopDir & $tb18)
FileDelete( @DesktopDir & $tb19)
FileDelete( @DesktopDir & $tb20)
可以简化写吗?
发表于 2011-6-15 17:58:16 | 显示全部楼层
读取配置文件可以考虑用 IniReadSection

$var = IniReadSection("C:\Temp\myfile.ini", "section2")
If @error Then
    MsgBox(4096, "", "错误, 不是 INI 文静.")
Else
    For $i = 1 To $var[0][0]
        MsgBox(4096, "", "关键字: " & $var[$i][0] & @CRLF & "值: " & $var[$i][1])
    Next
EndIf
发表于 2011-6-15 18:02:36 | 显示全部楼层
$var = IniReadSection("tb.ini", "需要删除的图标")
For $i = 1 To $var[0][0]
       FileDelete( @DesktopDir & $var[$i][1])
    Next
=================================
ini的内容
[需要删除的图标]
图标1=xxxx.ico
图标2=xxxx1.ico
图标3=xxxx2.ico
.....
发表于 2011-6-15 18:05:01 | 显示全部楼层
哪个写的,太有耐心了........
 楼主| 发表于 2011-6-15 22:56:34 | 显示全部楼层
谢谢。。。。。。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-10-2 01:29 , Processed in 0.082936 second(s), 22 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表