请教 关于文件打开 fopen不支持:\B\DATA\File.dat 这种microsoft自己的连接地址方式 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 请问 unixdotnet 具体实现的方法,谢谢! 如果不用“fopen”,用什么可以读“\B\DATA\File.dat 这种microsoft自己的连接地址方式”? 如果目标机器没有提供http或者ftp服务,那应该不行了。 我将目标机器的(B机)共享文件夹映射成网络驱动器,还是不能打开文件。为什么asp可以呐? fopen -- 打开文件或者 URL$handle = fopen ("/home/rasmus/file.txt", "r");$handle = fopen ("/home/rasmus/file.gif", "wb");$handle = fopen ("http://www.example.com/", "r");$handle = fopen ("ftp://user:[email protected]/somefile.txt", "w");如果要访问网络上其它电脑的文件,应该要开通http或ftp服务才行。 将目标机器的(B机)共享文件夹映射成网络驱动器,还是不能打开文件。为什么asp可以? if(!($myFile = fopen("\\B\DATA\File.dat", "r")))if(!($myFile = fopen("\\\\B\\DATA\\File.dat", "r"))) 我错了,我再重新看了php manual,原来这样是可以打开的:<?php $target = '\\\ken\kindergarten\speed.log'; $content = file_get_contents( $target ); $handle = fopen( 'other.log', 'wb' ); fwrite( $handle, $content ); fclose( $handle );?> 能否解释一下,或把下面的代码改成能用的?我非常菜,看不懂啊。<? print("<H3>通过http协议打开文件</H3>\n"); // 通过 http 协议打开文件 if(!($myFile = fopen("\\B\DATA\File.dat", "r"))) { print("文件不能打开"); exit; } while(!feof($myFile)) //循环 { // 按行读取文件中的内容 $myLine = fgetss($myFile, 255); print("$myLine <BR>\n"); } // 关闭文件的句柄 fclose($myFile);?> <?php //需要打开的目标文件完整路径 $target = '\\\机器名\目录\文件名'; //调用file_get_contents获取文件内容 $content = file_get_contents( $target ); //建立一个新文件 $handle = fopen( 'other.log', 'wb' ); //把之前获取目标文件的内容入到新建的文件中 fwrite( $handle, $content ); //关闭新文件释放资源 fclose( $handle );?> 谢谢unixdotnet() !不过,我用的是“PHP Version 4.0.6”没有file_get_contents能用别的方法解决么? 天啊:file_get_contents 的作用等于 fopen() 加 fread() 怎么做网站推广?搜索引擎怎么弄的? 文件上传问题 求Rewrite Rule php中变量前加&、@等符号是什么意思? php 批量修改文件问题 最后的30分了 在同一个表我想做一个下拉联动菜单? -----这样过滤后,SQL还注入的了么? (请注入高手指正) ----- 聊天室踢人怎么实现的,谢谢! 各位大侠,帮个忙一个很菜的问题! session 的SID常量不能获取到值 这段代码错在哪,为什么总提示无法查询? 急。文本操作:怎样插入数据?
$handle = fopen ("/home/rasmus/file.txt", "r");
$handle = fopen ("/home/rasmus/file.gif", "wb");
$handle = fopen ("http://www.example.com/", "r");
$handle = fopen ("ftp://user:[email protected]/somefile.txt", "w");
如果要访问网络上其它电脑的文件,应该要开通http或ftp服务才行。
$content = file_get_contents( $target );
$handle = fopen( 'other.log', 'wb' );
fwrite( $handle, $content );
fclose( $handle );?>
我非常菜,看不懂啊。<?
print("<H3>通过http协议打开文件</H3>\n");
// 通过 http 协议打开文件
if(!($myFile = fopen("\\B\DATA\File.dat", "r")))
{
print("文件不能打开");
exit;
}
while(!feof($myFile)) //循环
{
// 按行读取文件中的内容
$myLine = fgetss($myFile, 255);
print("$myLine <BR>\n");
}
// 关闭文件的句柄
fclose($myFile);
?>
//需要打开的目标文件完整路径
$target = '\\\机器名\目录\文件名'; //调用file_get_contents获取文件内容
$content = file_get_contents( $target );
//建立一个新文件
$handle = fopen( 'other.log', 'wb' ); //把之前获取目标文件的内容入到新建的文件中
fwrite( $handle, $content ); //关闭新文件释放资源
fclose( $handle );?>
不过,我用的是“PHP Version 4.0.6”没有file_get_contents
能用别的方法解决么?