#include <WindowsConstants.au3>
GUICreate("Form1", 280, 250)
GUICtrlCreateLabel("文本路径", 20, 24, 73, 17)
$Input1 = GUICtrlCreateInput("", 85, 20, 121, 21)
GUICtrlCreateLabel("要修改的内容", 4, 48, 76, 17)
$Input2 = GUICtrlCreateInput("", 85, 45, 121, 21)
GUICtrlCreateLabel("修改为:", 24, 72, 52, 17)
$Input3 = GUICtrlCreateInput("", 85, 70, 121, 21)
$But1 = GUICtrlCreateButton("浏览", 210, 18, 50, 25, $WS_GROUP)
$Button1 = GUICtrlCreateButton("替换", 60, 120, 50, 25, $WS_GROUP)
$Button2 = GUICtrlCreateButton("关闭", 120, 120, 50, 25, $WS_GROUP)
GUISetState()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case - 3, $Button2
Exit
Case $Button1
FileWrite(StringTrimRight(StringRegExpReplace(GUICtrlRead($Input1), '.+\\', ''), 4) & '~.TXT', StringRegExpReplace(FileRead(GUICtrlRead($Input1)), GUICtrlRead($Input2), GUICtrlRead($Input3)))
MsgBox(0, '', '完成')
Case $But1
$folder = FileOpenDialog("查找", '', "可执行文件(*.txt)")
If Not @error Then GUICtrlSetData($Input1, $folder)
EndSwitch
WEnd
、===========================
以上代码有缺陷..............还是感谢你
给你一个 我 的 代码 你瞧瞧
==================
$OpenFilename = FileOpenDialog("选择您要转换的文件", -1, "所有文件(*.*)")
;FileDelete($OpenFilename)
FileWriteLine($OpenFilename,ControlGetText("精科电脑算命 V2.7","","Edit4"))
$BianLiang2 = FileRead($OpenFilename)
$BianLiang3 = StringReplace($BianLiang2, "aaaaaaaaaaaaaaaasssssssssssssssssssssss", "INSERT INTO emlog_blog VALUES('")
;FileDelete($OpenFilename)
FileWriteLine($OpenFilename, $BianLiang3 )
$BianLiang = FileRead($OpenFilename)
$BianLiang1 = StringReplace($BianLiang ,"cccccccccccccccccccccccccddddddddddddddddaaaaaaaaaaaaa---------------------------sssssssssssssssssssssggggggghhhhhhhhhhh", "','")
;FileDelete($OpenFilename)
FileWriteLine($OpenFilename, $BianLiang1 )
$BianLiang = FileRead($OpenFilename)
$BianLiang1 = StringReplace($BianLiang ,"aaaaaaaaaaaaa---------------------------sssssssssssssssssssssllllllllmmmmmmmmmmmm", "','1308056742','<iframe height=\"&'"'&"900\"&'"'&" src=\"&'"')
;FileDelete($OpenFilename)
FileWriteLine($OpenFilename, $BianLiang1 )
$BianLiang = FileRead($OpenFilename)
$BianLiang1 = StringReplace($BianLiang ,"aaaaaaaaaaaaaa---------------------------sssssssssssssssssssss", "\"&'"'&" width=\"&'"'&"1440\"&'"'&"></iframe>','','','1','- 1','blog','1','0','0','0','n','n','y','y','');")
;FileDelete($OpenFilename)
FileWriteLine($OpenFilename, $BianLiang1 )
Run ("NOTEPAD.EXE" &" "& $OpenFilename) |