为什么照这样写后: open   访问电脑的ip   
  user   
  用户名   
  密码   
  get   文件名   
  quit   
    
  再编写一个   getfile.bat   文件,包含如下内容:   
  ftp   -s:test.scr   
执行了那个getfile.bat后 能够在目标上创建文件,当大小为0k?  这个是为什么?如果在cmd环境下照着输入上面的  则又能完整下载文件

解决方案 »

  1.   

    你在cmd中执行bat是否能成功呢
      

  2.   

    我试了下,可以正常运行啊
    你在cmd下运行bat呢,看看有什么提示
      

  3.   

    不能成功  晕这样写对吗?  open 192.168.1.123
    user a a
    bin
    hash
    mget 1.rar c:\1.rar
    quit
      

  4.   

    我试时是这样写的
    open ip port(如果需要)
    user
    password
    get filename
    quit
      

  5.   

    to 不能成功 晕
    这样写对吗? 和我的感觉一样,你的写法不对,至少不能这么写。
    因为在open之后,后面的语句不是纯粹的command了。
      

  6.   

    最后问下 
    Process process = new Process();
    在winform中用process.filename = @"c:\getfile.bat"
    process.start()  为什么执行后没有效果?
      

  7.   

    显示的是这个:C:\Documents and Settings\Administrator\桌面\WindowsApplication1\WindowsApplicat
    ion1\bin\Debug>ftp -s: test.scrTransfers files to and from a computer running an FTP server service
    (sometimes called a daemon). Ftp can be used interactively.FTP [-v] [-d] [-i] [-n] [-g] [-s:filename] [-a] [-w:windowsize] [-A] [host]  -v             Suppresses display of remote server responses.
      -n             Suppresses auto-login upon initial connection.
      -i             Turns off interactive prompting during multiple file
                     transfers.
      -d             Enables debugging.
      -g             Disables filename globbing (see GLOB command).
      -s:filename    Specifies a text file containing FTP commands; the
                     commands will automatically run after FTP starts.
      -a             Use any local interface when binding data connection.
      -A             login as anonymous.
      -w:buffersize  Overrides the default transfer buffer size of 4096.
      host           Specifies the host name or IP address of the remote
                     host to connect to.Notes:
      - mget and mput comm
      

  8.   

    process.filename = @"c:\getfile.bat"这里该是 process.StartInfo.FileName = @"c:\getfile.bat";
      

  9.   

    你试一下运行filename="ftp"
    再加个process.StartInfo.Arguments="-s:test.scr";
      

  10.   

    我想在进程里面调用这个getfile嘛我是这样写的
    Process p = new Process();            p.StartInfo.FileName = @"c:\getfile.bat";
                p.Start();
    会弹出一个cmd的窗体 当显示的内容是C:\Documents and Settings\Administrator\桌面\WindowsApplication1\WindowsApplicat
    ion1\bin\Debug>ftp -s: test.scrTransfers files to and from a computer running an FTP server service
    (sometimes called a daemon). Ftp can be used interactively.FTP [-v] [-d] [-i] [-n] [-g] [-s:filename] [-a] [-w:windowsize] [-A] [host]  -v             Suppresses display of remote server responses.
      -n             Suppresses auto-login upon initial connection.
      -i             Turns off interactive prompting during multiple file
                     transfers.
      -d             Enables debugging.
      -g             Disables filename globbing (see GLOB command).
      -s:filename    Specifies a text file containing FTP commands; the
                     commands will automatically run after FTP starts.
      -a             Use any local interface when binding data connection.
      -A             login as anonymous.
      -w:buffersize  Overrides the default transfer buffer size of 4096.
      host           Specifies the host name or IP address of the remote
                     host to connect to.Notes:
      - mget and mput comm
      

  11.   

    Process p = new Process();            p.StartInfo.FileName = "ftp";
                p.StartInfo.Arguments = "-s:test.scr";
                p.Start();??不行  - -|||
      

  12.   

    好像多了个空格?
    -s: test.scr
      

  13.   

    晕 居然要加路径
    ftp -s:c:\test.scr怎么给分??
      

  14.   

    aby913(aby) ( ) 信誉:100  2006-06-29 15:33:00  得分: 0  
     
     
       Process p = new Process();            p.StartInfo.FileName = "ftp";
                p.StartInfo.Arguments = "-s:test.scr";
                p.Start();??不行  - -|||
      
     
    ???我试下来可以的啊
    你是怎么个不行?
      

  15.   

    ...test.scr不在程序运行的目录下