protected void Page_Load(object sender, EventArgs e)
{
Image1.ImageUrl = GetImageBase64("ftp://192.168.1.212:2020/1.jpg");
}
public string GetImageBase64(string ftpPath)
{
FtpWebRequest reqFTP;
try
{
// 根据uri创建FtpWebRequest对象
reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(ftpPath));
// 指定执行什么命令
reqFTP.Method = WebRequestMethods.Ftp.DownloadFile;
// 指定数据传输类型
reqFTP.UseBinary = true;
reqFTP.UsePassive = false;
FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse()