高人能将下面PHP改写成ASP吗?
本人不懂PHP,谢谢了,在线等....<?php
/**
* Name: rssproxy.php
* Version: 1.0
* Author: hopesoft
* Modifier: Niko ([email protected])
* Copyright: 2007 www.51Ajax.com
*/ //检测函数file_put_contents
if( !function_exists("file_put_contents") ) {
function file_put_contents($filename,$somecontent) {
$handle = fopen($filename, 'w');
fwrite($handle, $somecontent);
fclose($handle);
}
}
//更新间隔(分钟)
$updatetime=60*6;
$timestamp=time();
$rootdir="./feeds";
//获取种子地址,种子ID,网站ID
$feed = $_REQUEST['feed'];
$feedid = $_REQUEST['feedid'];
$webid = $_REQUEST['webid'];
//检测目录,如果没有则创建
//chkdir("$rootdir/");//此行代码在第一次运行后可去除,以提高速度
chkdir("$rootdir/$webid/");
//种子对应本地文件路径
$file = "$rootdir/$webid/$feedid.xml";
//如果不存在,则创建
if (file_exists($file) == false) {
writefile();
} else {
if(@filemtime($file)+ ($updatetime * 60) < $timestamp ){
writefile();
}
}
header('Content-Type: text/xml');
header("location:".$file); //检测目录函数
function chkdir($directory) {
if (is_dir($directory) == false) {
mkdir($directory, 0777);
}
}
//创建文件函数
function writefile() {
global $feed,$file;
$handle = fopen($feed, "r");
$contents = "";
do {
$data = fread($handle, 8192);
if (strlen($data) == 0) {
break;
}
$contents .= $data;
} while(true);
fclose($handle);
if(strlen($contents)>=1000) {
file_put_contents($file,$contents);
}
}
?>
本人不懂PHP,谢谢了,在线等....<?php
/**
* Name: rssproxy.php
* Version: 1.0
* Author: hopesoft
* Modifier: Niko ([email protected])
* Copyright: 2007 www.51Ajax.com
*/ //检测函数file_put_contents
if( !function_exists("file_put_contents") ) {
function file_put_contents($filename,$somecontent) {
$handle = fopen($filename, 'w');
fwrite($handle, $somecontent);
fclose($handle);
}
}
//更新间隔(分钟)
$updatetime=60*6;
$timestamp=time();
$rootdir="./feeds";
//获取种子地址,种子ID,网站ID
$feed = $_REQUEST['feed'];
$feedid = $_REQUEST['feedid'];
$webid = $_REQUEST['webid'];
//检测目录,如果没有则创建
//chkdir("$rootdir/");//此行代码在第一次运行后可去除,以提高速度
chkdir("$rootdir/$webid/");
//种子对应本地文件路径
$file = "$rootdir/$webid/$feedid.xml";
//如果不存在,则创建
if (file_exists($file) == false) {
writefile();
} else {
if(@filemtime($file)+ ($updatetime * 60) < $timestamp ){
writefile();
}
}
header('Content-Type: text/xml');
header("location:".$file); //检测目录函数
function chkdir($directory) {
if (is_dir($directory) == false) {
mkdir($directory, 0777);
}
}
//创建文件函数
function writefile() {
global $feed,$file;
$handle = fopen($feed, "r");
$contents = "";
do {
$data = fread($handle, 8192);
if (strlen($data) == 0) {
break;
}
$contents .= $data;
} while(true);
fclose($handle);
if(strlen($contents)>=1000) {
file_put_contents($file,$contents);
}
}
?>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货