<a href="#" onclick="addhits()">add</a>
<script>
function addhits() {
var fso,f,r,hits;
var ForReading=1, ForWriting=2;
fso=new ActiveXObject("Scripting.FileSystemObject");
f=fso.OpenTextFile("c:\\count.txt",ForReading);
alert(f.ReadAll());
}
</script>//有安全提示的..
<script>
function addhits() {
var fso,f,r,hits;
var ForReading=1, ForWriting=2;
fso=new ActiveXObject("Scripting.FileSystemObject");
f=fso.OpenTextFile("c:\\count.txt",ForReading);
alert(f.ReadAll());
}
</script>//有安全提示的..
function read()
{
var fso,f,;
fso=server.createobject("Scripting.FileSystemObject");
f=fso.OpenTextFile("c:\\count.txt",ForReading);
alert(f.ReadAll());
}
</script>
谢谢!!
var marqueewidth="100%"
var marqueeheight=115
var speed=1
var marqueecontents='从txt文件读取的数据'
if (document.all)
document.write('<marquee direction="up" scrollAmount='+speed+' style="width:'+marqueewidth+';height:'+marqueeheight+'">'+marqueecontents+'</marquee>')
function regenerate(){
window.location.reload()
}
function regenerate2(){
if (document.layers){
setTimeout("window.onresize=regenerate",450)
intializemarquee()
}
}
function intializemarquee(){
document.cmarquee01.document.cmarquee02.document.write(marqueecontents)
document.cmarquee01.document.cmarquee02.document.close()
thelength=document.cmarquee01.document.cmarquee02.document.height
scrollit()
}
function scrollit(){
if (document.cmarquee01.document.cmarquee02.top>=thelength*(-1)){
document.cmarquee01.document.cmarquee02.top-=speed
setTimeout("scrollit()",100)
}
else{
document.cmarquee01.document.cmarquee02.top=marqueeheight
scrollit()
}
}
window.onload=regenerate2</script>
function read()
{
var fso,f;
fso = new ActiveXObject("Scripting.FileSystemObject");f=fso.OpenTextFile("c:\\count.txt",1);
alert(f.ReadAll());
}
marqueewidth =read();
</script>