找回密码
 加入
搜索
查看: 2393|回复: 9

[AU3基础] [已解决]读取INI文件键值问题

[复制链接]
发表于 2018-7-30 08:50:36 | 显示全部楼层 |阅读模式
本帖最后由 天天笑 于 2018-8-2 08:16 编辑

大神们,
有啥办法可以读取INI文件键值中含有"="的内容。

如下面
[G74002]
Content=ABCRestore = USB Reset
现在用 IniReadSection读取的结果是:
G74002     Content   ABC
G74002      Restore   USB Reset  

我期望的结果是:
G74002     Content   ABCRestore = USB Reset

不知道能不能实现
发表于 2018-7-30 09:08:28 | 显示全部楼层
http://www.autoit3.cn/thread-12319-1-1.html

_IniRead('xxx', 'G74002', 'Content=ABCRestore')
发表于 2018-7-30 10:15:52 | 显示全部楼层
提个思路,先读整行,然后从第一个=截取两段...
 楼主| 发表于 2018-7-30 11:29:41 | 显示全部楼层
afan 发表于 2018-7-30 09:08
http://www.autoit3.cn/thread-12319-1-1.html

_IniRead('xxx', 'G74002', 'Content=ABCRestore')


Hi Afan,
我的附件是这样的,可以麻烦你帮忙看一下吗?感谢


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2018-7-30 12:24:40 | 显示全部楼层
天天笑 发表于 2018-7-30 11:29
Hi Afan,
我的附件是这样的,可以麻烦你帮忙看一下吗?感谢

你试试下载看看能不能解压…
 楼主| 发表于 2018-7-30 13:18:30 | 显示全部楼层
afan 发表于 2018-7-30 12:24
你试试下载看看能不能解压…

可以的。我再用ZIP试一下

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2018-7-30 13:36:36 | 显示全部楼层
天天笑 发表于 2018-7-30 13:18
可以的。我再用ZIP试一下

这个可以解压。

测试没问题,只是你的数据里面含有很多@LF换行符,需要组织成字符串

#include '_Ini.au3'
Local $fIni = @ScriptDir & '\INI多个=.ini'
Local $str = _IniRead($fIni, 'A10006', 'Content=Use NAPPHDD/Lan Download method to load your image into test SKU.(NAPPHDD/Lan Download should meet NAPP SPEC definition)      ' & @LF & _
                                                                                '*** Partition Ratio should be follow DT HDD Partition Spec (the latest version)' & @LF & _
                                                                                '** You can downloadDT HDD Partition Spec from :ftp://ftp.kgqt00.tw/Testscript/Tools' & @LF & _
                                                                                '                                                                              account/password : ODM/ODM_Login' & @LF & @LF & _
                                                                                ' * Make sure the brand display on UI was correct' & @LF & _
                                                                                ' * System drive (HDD/SSD) size <', '')
MsgBox(0, '', $str)
 楼主| 发表于 2018-7-30 13:58:37 | 显示全部楼层
afan 发表于 2018-7-30 13:36
这个可以解压。

测试没问题,只是你的数据里面含有很多@LF换行符,需要组织成字符串

不好意思,Afan,应该是我没有表达清楚。
我想要的结果是:
A10006         Content             Use NAPPHDD/Lan Download method to load your image into test SKU.(NAPPHDD/Lan Download should meet NAPP SPEC definition)      
*** Partition Ratio should be follow DT HDD Partition Spec (the latest version)
** You can downloadDT HDD Partition Spec from :ftp://ftp.kgqt00.tw/Testscript/Tools
                                                                              account/password : ODM/ODM_Login

* Make sure the brand display on UI was correct
* System drive (HDD/SSD) size <= 256GB, should apply “single partition” for all brands except Veriton China and Founder.
    (For China Commercial HPA projects , always create partitions into C:\ 50% & D:\ 50%)

[A10007]           Content            Alaunch process
   After reboot , the system will start Alaunch process automatically. Make sure there are no error messages on Windows boot or Alaunch process such as a failed Windows boot on previous start-up.
      -  Make sure Alaunch process(bar UI)

*During the Alaunch process, please don't use mouse and keyboard. Besides, make sure the system not getting into S3 mode.

[G76001]       Content         Only for LPCD ENUS
Not for disk size is <= 16GB
- You must do this test case whatever the hidden partition is exist or not
- Put SCD in the ODD and press F12 to select boot from ODD when turning on the PC
- And then follow the instruction to insert RCD  , Language Package CD in order.
- Make sure you can restore to factory default.
- After D2D via SCD & RCD, W10 OOBE settings should be the same as NAPP process.
- The OOBE process, please connect Internet and step by step PASS OOBE
- Make sure you can into end user desktop without error message.
- Please execute #B25015 test item
  - Please into WinPE environment.(Alt+F10) & WinRE(press Shift + system reboot) environment , make sure all USB3.0 ports workable
[H100001]         Content          Issue that release notice listed "Fixed Issue" have been fixed.
               
发表于 2018-7-30 14:41:30 | 显示全部楼层
#include '_Ini.au3'
Local $fIni = @ScriptDir & '\INI多个=.ini'
Local $sD = 'A10006'
Local $sAD = _IniReadSection_str($fIni, $sD)
MsgBox(0, '', $sD & @TAB & StringReplace($sAD, '=', @TAB, 1))
 楼主| 发表于 2018-8-2 08:16:17 | 显示全部楼层
afan 发表于 2018-7-30 14:41
[au3]#include '_Ini.au3'
Local $fIni = @ScriptDir & '\INI多个=.ini'
Local $sD = 'A10006'

感谢afan,问题已解决
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-4-25 14:22 , Processed in 0.078909 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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