如何生成和自身文件名相同的配置文本
如何生成和自身文件名相同的 ini 配置文本例如 系统工具.au3 生成后总是系统工具.au3.ini #include <file.au3>
#include <array.au3>
Dim $szDrive, $szDir, $szFName, $szExt
$TestPath = _PathSplit(@ScriptFullPath, $szDrive, $szDir, $szFName, $szExt)
;_ArrayDisplay($TestPath,"Demo _PathSplit()")
MsgBox(0,0,$testpath&$testpath&$testpath&$testpath&".ini") $inifullpath=StringRegExpReplace ( @ScriptFullPath, "\.[^\.]*$", ".ini")
MsgBox(0,$inifullpath,$inifullpath) 楼上正解,还是正则方便哈 谢谢 已解决 $name = StringSplit(@ScriptName,".")
MsgBox(0,"",$name&".ini") 本帖最后由 lanfengc 于 2010-4-18 18:55 编辑
风行者 发表于 2010-4-17 21:08 http://autoitx.com/images/common/back.gif
这个代码也可以。 哈哈。
这样就更完美了。$name = StringSplit(@ScriptName,".")
MsgBox(0,"",@ScriptDir&"\"&$name&".ini") 楼上代码完美! $name = StringSplit(@ScriptFullPath,".")
MsgBox(0,"",$name&".ini")
这样就更加完美了。 $name = StringSplit(@ScriptFullPath,".")
MsgBox(0,"",$name&".ini")
这样就更加完美了。
dajun 发表于 2010-5-8 18:06 http://www.autoitx.com/images/common/back.gif
这样显然会容易出错。如果文件名含有“.”就嗝屁了 呵呵,,收藏学习下。
页:
[1]