arctan1 x:PHP -> ASP 追加100分~~

来源:百度文库 编辑:中科新闻网 时间:2024/05/03 01:10:38
_ 帮我把下面代码转换成ASP

php百变图制作方法[刷新变图]

====================================
使用方法:
1.将此文件放在某目录下,然后在该目录下创建目录pic,将所有图片放在目录pic下即可.
2.然后取得.PHP文件的链接像图片链接一样放在[ img]代码中即可显示
格式如下[去空格]
[ img]http://www.xxx.com/.../pic.php[/img]
====================================

<?php
$url='pic';
$files=array();
if ($handle=opendir("$url")) {
while(false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
if(substr($file,-3)=='gif' || substr($file,-3)=='jpg') $files[count($files)] = $file;
}
}
}
closedir($handle);
$random=rand(0,count($files)-1);
readfile("$url/$files[$random]");

?>

<%
Response.Redirect "Pic/" & Int(Rnd()*PhotoNumber+1) & ".jpg"
%>