本帖最后由 hlzxcjx 于 2011-11-20 14:32 编辑 $htm= "百度_excel吧_七绝招?在Excel中将文本转换为数字.htm"
if FileExists($htm) Then MsgBox(0, 1, "文件存在!")
;---------------------------------------------
$file = FileOpen($htm, 16)
If $file = -1 Then
MsgBox(0, "错误!", "不能打开文件!")
EndIf
FileClose($file)
;---------------------------------------------
$htm2=StringReplace($htm,"?","")
MsgBox(0,"替换?号后",$htm2)
$copy=FileCopy($htm,$htm2,1)
if $copy=0 Then MsgBox(0,"复制失败!","原文件:" & $htm & @CRLF & @CRLF & "替换?号后:" & $htm2)
;---------------------------------------------
$file = FileOpen($htm2, 16)
If $file = -1 Then
MsgBox(0, "错误!",$htm2 & @CRLF & @CRLF & "文件不能打开!")
EndIf
While 1
$chars = FileRead($file, 1024)
If @error = -1 or $chars="" Then ExitLoop
MsgBox(0, "Char read:", $chars)
Wend
FileClose($file)
|