标题:需要实现用FTP把文件上传到FTP的服务器上
取消只看楼主
itsky8
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2008-2-19
 问题点数:0 回复次数:0 
需要实现用FTP把文件上传到FTP的服务器上
需要实现用FTP把文件上传到FTP的服务器上,试了以下的方式都不行,请问在C#该如何写呢?  代码如下:

private void MainForm_Load(object sender, System.EventArgs e)
        {
            
            System.Diagnostics.Process proc = new System.Diagnostics.Process();
            proc.EnableRaisingEvents=false;
            proc.StartInfo.UseShellExecute = true;
            proc.StartInfo.RedirectStandardOutput = true;
            proc.StartInfo.FileName="ftp.exe";
            proc.StartInfo.Arguments="open ftpserver";
            proc.StartInfo.Arguments="username";
            proc.StartInfo.Arguments="password";
            proc.StartInfo.Arguments="prompt off";
            proc.StartInfo.Arguments="cd folder-in-ftp-server";
            proc.StartInfo.Arguments="lcd folder-in-local";
            proc.StartInfo.Arguments="mput *.jpg";
            proc.StartInfo.Arguments="bye";
            proc.StartInfo.CreateNoWindow = true;
            proc.Start();
            proc.WaitForExit();
            Close();
}
搜索更多相关主题的帖子: 服务器 FTP proc StartInfo 文件 
2008-02-21 11:49



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-200511-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.624134 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved