ie下读写文件
<html>??
<head>??
<title>ipdevice</title>?
<script type="text/javascript" language="javascript">
function createAndReadFile()
{
var fso = new ActiveXObject("Scripting.FileSystemObject");
var url = ("C:\\Users\\mining\\Desktop\\xmlcom\\ipdevice\\delegated-apnic-latest.txt");
var urlsss = ("C:\\Users\\mining\\Desktop\\xmlcom\\ipdevice\\delegated-apnic-latest1.txt");
alert(url);
var file = fso.OpenTextFile(url,1,false);
var files = fso.OpenTextFile(urlsss,2,true);
while(!file.atendofstream)
{
var content =file.ReadLine();
var strarray=content.split("|");
if(strarray[2]=="ipv4")
{
files.WriteLine(strarray[1]+" "+strarray[3]+" "+strarray[4]+" "+strarray[2]);
}
}
files.close();
file.close();
alert(content);
}
</script>
</head>?
<body onload="createAndReadFile()">
</body>
</html>