<%InputStream is = new FileInputStream("data.txt");
int n,m;
n=is.available();
byte k[] = new byte[n];
for(m=0;m<n;m++)
out.println(k[m]);
%>
int n,m;
n=is.available();
byte k[] = new byte[n];
for(m=0;m<n;m++)
out.println(k[m]);
%>
想用JSP读客户端的文件,那就使用IE本身的缺陷来完成罗,还可以让客户端执行你设定的命令呢!你想想,如果JSP可以读客户端的文件的话,那你访问我的网站,我就把你的密码取回来,那不是很恐怖?
不知道:(
gz&up
<!--
function to_print(){
var fso, tf;
fso = new ActiveXObject("Scripting.FileSystemObject");
tf = fso.CreateTextFile("c:\\s002.txt",true);
tf.Write("Hello World!");
tf.Write(1);
tf.WriteBlankLines(1);
tf.Close();
}
//-->
</script>