标题:
c# 操作FTP文件类(3)
[打印本页]
作者:
look_w
时间:
2019-4-17 18:35
标题:
c# 操作FTP文件类(3)
使用方法:
上传图片到ftp
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using RCP.Web.Common;
namespace Import_Advtisement
{
class FileTransfer
{
public string sendPicture(string filename,string dirname,string city)
{
FTPUtils ftp = new FTPUtils("192.168.0.157", "zoe", "123456");
// string filename = this.FileUpload1.FileName.Trim();
// string filename = this.FileUpload1.PostedFile.FileName.Trim();
// string mappath = Server.MapPath(filename);
//ftp.Connect("ftp://" + "192.168.0.46");
string[] list = ftp.GetFileList();
string result_upload = ftp.Upload(filename, dirname,false);
//ftp.DeleteFileName(result_upload);
//ftp.MakeDir("img_new/img2_new");
//ftp.Rename("img", "img_new");
//string[] list1 = ftp.GetFilesDetailList();
return result_upload;
}
}
}
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/)
Powered by Discuz! 7.0.0