CODE: [Copy to clipboard]
dim jintian
Set ws=CreateObject("wscript.shell")
Set fso=CreateObject("scripting.filesystemobject")
Set fle=fso.opentextfile(dateadd("d",-1,date) & ".txt")
Do While fle.atendofstream<>true
m=fle.readline
ff=replace(m,glhz(m),"")
s=s & chae(ff,glhz(m)) & vbcrlf
loop
fle.close
Set file=fso.createtextfile(date & ".txt")
file.write jintian
file.close
Set file=fso.createtextfile("今天和昨天的差额.txt")
file.write s
file.close
ws.run "notepad.exe 今天和昨天的差额.txt",,true
msgbox "请查看【" & date & ".txt】文件,看看输入是否正确。",4096+48,"操作完成"
Function chae(xm,je)
do until a=1
sdf=inputbox("请输入【" & xm & "】的金额:",xm)
if sdf="" then
wscript.quit
elseif IsNumeric(sdf)<>true then
msgbox "输入错误,请重新输入。",16+4096,"错误"
else
a=1
end if
loop
chae=xm & sdf-je
jintian=jintian & xm & sdf &vbcrlf
a=0
End Function
Function glhz(zhifu)
a=Len(zhifu)
For i=1 To a
b=Mid(zhifu,i,1)
If IsNumeric(b)=True or b="." then
glhz=glhz&Mid(zhifu,i,1)
End if
next
end Function
[