Copy and paste the code into a text document, save it, and change the suffix name of the file to: hta, and double-click to run.
The code is as follows:
<!--//////////////////=====
Program name: Consumption record Ver1.1 (20070808-20070811).hta
Instructions for use: Copy and paste the code into a text document, save it, and change the suffix name of the file to: hta, and double-click to run.
Author's description: youxi01,,,No copyright, welcome to pirated version!!////////////-->
<!--/////////////////->
<TITLE>Consumption Recording Program</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>
<!--//////////hta logo/////-->
<HTA:APPLICATION
SCROLL="no"
CAPTION="yes"
SYSMENU="yes"/>
<!--//////////////->
<script language="vbscript">
totalMoney=0 'Total consumption
index=-1 'Initialize the checkbox control ID number;
flag=0 'The flag that defines whether the file is changed
set fso=createobject("scripting.filesystemobject")
'//////////////////////// Read the configuration file and define its own size and location ////////
Sub Window_onLoad
if not (fso.fileexists("consume.ini")) then 'Create if there is no configuration file;
fso.createtextfile("consume.ini").close
end if
window.resizeTo 638,495 'Set its own size and position;
window.moveTo 200,100
addRow 0,"hoho","2007-1-1","Tuesday" 'Add a row first. I can't even understand it myself, but I'm using it to deal with bugs anyway;
document.all.namedItem("mytable").rows(1).style.display="none" 'Set this line is invisible;
addRow 0,"hoho","2007-1-1","Tuesday" 'Add another row. I can't even understand it myself, but I'm using it to deal with bugs anyway;
document.all.namedItem("mytable").rows(2).style.display="none" 'Set this line is invisible;
readFile("consume.ini")
End Sub
'/////////////////////////////////////////
Function readFile(filename)
set file=fso.opentextfile(filename,1,1)
do while file.atendofline<>true 'Read the file until the end of the file
str=split(file.readline,"#") 'Split no rows by # flag (there are a total of four such flags)
addRow str(1), str(2), str(3), str(4) 'Add five cells, the contents are...
loop
End Function
'////////////////////////////
Function addRow(cnum,ctype,cdate,cday)
index=index+1 'Serial number adds 1
set objTable=document.all.namedItem("mytable") 'Get object table based on ID
set newrow = objTable.insertRow() 'Insert a line
newrow.className="row_add" 'Set the style of the line;
newrow.onmouseover=getRef("change_bgcolor")
newrow.onmouseout=getRef("back_bgcolor")
newrow.onclick=getRef("chooseOBJ")
var="#"&cnum&"#"&ctype&"#"&cdate&"#"&cday
str=split(var,"#")
str(0)="<input type=checkbox id='delcheck'&index>"
for i=0 to 4
set newcell=newrow.insertCell() 'Insert the cell and set the value of the cell;
newcell.innerhtml=str(i)
next
totalMoney=totalMoney+clng(cnum) 'Set the value of the total consumption and define the display;
consumption.innerHTML="Total Consumption:"&totalMoney&"yuan"