我正在使用 Tamir SharpSSH 将文件从远程传输到本地,反之亦然,没有问题。
但是,当尝试通过 SFTP 上传多个 XML 文件时,我收到一个错误:
路径中的非法字符。
如果我尝试使用确切的文件名上传,它会毫无问题地传输文件。
每次我尝试上传两个 XML 文件时:
KDO_E2D_A21_AA769_20170124_143123.xml
KDO_E2D_A21_AA776_20170130_143010.xml
string ftpURL = "11.11.11.1";
string userName = "Aaaaaa"; //User Name of the SFTP server
string password = "hah4444"; //Password of the SFTP server
int port = 22; //Port No of the SFTP server (if any)
//The directory in SFTP server where the files will be uploaded
string ftpDirectory = "/home/A21sftp/kadoe/";
//Local directory from where the files will be uploaded
string localDirectory = "E:\\Zatpark\\*.xml";
Sftp Connection = new Sftp(ftpURL, userName, password);
Connection.Connect(port);
Connection.Put(localDirectory, ftpDirectory);
Connection.Close();