尊敬的大侠们:      在下急需做一个新闻组(NewsGroup)的附件下载系统,由于是嵌入B/S应用,而且客户要求 必须使用PHP,于是在网上搜寻一气,结果……太失望了!     http://blog.csdn.net/feel8/archive/2004/10/27/155368.aspx     照着上面地址所附例子做了一个,然而浏览器中的结果却是:    Connection succeed.   200 news.yaako.com InterNetNews NNRP server INN 2.3.2 ready (posting ok).   First :   Last :   好失败噢,各位大侠,帮帮忙来。感激不尽!       MyEmail: [email protected]    [email protected] 

解决方案 »

  1.   

    ASP养成了  搜代码改代码的习惯了.
      

  2.   

    “必须使用PHP,于是在网上搜寻一气,结果……太失望了! ”这个什么意思?
      

  3.   

    在下的意思是:按照网上提供的示例,达不到要求
    主要功能是从新闻组下载文件(邮件或附件),使用的是NNTP协议我写的php代码是:
    <?php  
    $cfgServer = "news.yaako.com";  $cfgPort = 119;  
    $cfgTimeOut = 10;  //open a socket  
    if(!$cfgTimeOut)  
    // without timeout  
    $usenet_handle = fsockopen($cfgServer, $cfgPort);  
    else  
    // with timeout  
    $usenet_handle = fsockopen($cfgServer, $cfgPort, &$errno, &$errstr, $cfgTimeOut);  if(!$usenet_handle) {  
    echo "Connection failed.";  
    exit();  
    }  
    else {  
    echo "Connection succeed.";  
    //$tmp = fgets($usenet_handle, 1024);  

    //将脚本执行时间设置为无限制(默认为30秒)
    set_time_limit(0);//$cfgUser = "0000000803"; 
    //$cfgPasswd = "0000000803"; $cfgNewsGroup = "alt.12hr";// identification required on private server // select newsgroup 
    fputs($usenet_handle, "GROUP ".$cfgNewsGroup."\n"); 
    $tmp = fgets($usenet_handle, 1024); if($tmp == "480 Authentication required for commandrn") { 
    echo $tmp; 
    exit();
    }else{
    echo $tmp; 
    }fputs($usenet_handle,"LIST");
    $temp = fgets($usenet_handle,1024);
    echo $temp;
    $info = split(" ", $temp); 
    $first = $info[2]; 
    $last = $info[3];
    printf("<br>First : %s", $first); 
    printf("<br>Last : %s<br>", $last); 
         
            
                
      ?>