【问题标题】:PHP- How to create a text file in network shared folderPHP-如何在网络共享文件夹中创建文本文件
【发布时间】:2017-01-27 04:02:44
【问题描述】:

有人可以帮助我如何在网络共享文件夹中创建文本文件。共享文件夹有用户名和密码。 非常感谢! 这是我的代码

<?php
system('net use \\192.168.*.*\folder$ password/user:username');
$dir = "\\192.168.*.*\folder$";
if (is_dir($dir)) 
{
    if ($dh = opendir($dir))        
        print "able to access directory tree.";       
}
else {   print "not access tree.";}
?>

【问题讨论】:

  • 发现php无法读取folder$(隐藏文件夹)。删除 $(使其可见)并工作。

标签: php file file-io


【解决方案1】:

发现 php 不知何故无法读取 folder$(隐藏文件夹)。删除 $(使其可见)并工作。

<?php
//system('net use \\192.168.*.*\folder$ password/user:username');
$dir = "\\\\192.168.*.*\\folder";
if (is_dir($dir)) 
{
    if ($dh = opendir($dir))        
        print "able to access directory tree.";       
}
else {   print "not access tree.";}
?>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-01-18
    • 1970-01-01
    • 2019-05-01
    • 1970-01-01
    • 1970-01-01
    • 2022-08-11
    • 1970-01-01
    相关资源
    最近更新 更多