我将图像存储在public_ftp
中。现在如何访问public_ftp
文件。我有链接,也有username
和password
。但是如何在public_ftp
中使用server mappath
链接。
string[] filePaths = Directory.GetFiles(Server.MapPath("~\\screenshots\\" +eventID));
IEnumerable<string> filess = Enumerable.Empty<string>();
// Get all the files in the sourceDir
foreach (string name in myList)
{
string fname = name;
path = Server.MapPath("~\\screenshots\\" +eventID+"\\" + fname);
if (System.IO.File.Exists(path))
{
var attachment = new system.web.Mail.MailAttachment(path);
myMail.Attachments.Add(attachment);
}
}
我如何使用Server.MapPath('FTP LINK')
中的ftp链接,如果有人将文件存储在服务器上并且他提供了我的凭据并且我想访问图像并在应用程序中使用,我还应该如何访问服务器文件。由于隐私原因,我不想将图像存储在托管服务器中。