error al copiar imágenes de la carpeta compartida local a la red

I am trying to copy images from a external device to a folder which is on network but the problem with my code is its creating a folder in local drive(c:) and coping the images. but I have this folder on network. It should just create a folder with today's date ans copy the images on the network.

string _ftpURL = @"00.000.00.0";  //Host URL or address of the SFTP server
//string _ftpURL = @"0.0.0.0"; 
string _UserName = "root"; //User Name of the SFTP server
string _Password = "3p1"; //Password of the SFTP server
int _Port = 2222; //Port No of the SFTP server (if any)
string _ftpDirectory = "/opt/prassel/data/snap/*.jpg"; //The directory in SFTP server where the files will be uploaded
var LocalDirectory = string.Format("\\ws4.lboro.ac.uk\\SY0-1ticketPhotofolder\\TICKET PHOTO'S\\{0:yyyy-MM-dd}", DateTime.Now);
System.IO.Directory.CreateDirectory(LocalDirectory);

Sftp Connection = new Sftp(_ftpURL, _UserName, _Password);
Connection.Connect(_Port);
Connection.Get(_ftpDirectory, LocalDirectory);
Connection.Close();

preguntado el 28 de mayo de 14 a las 14:05

1 Respuestas

Remote UNC pats start with dos slashes. Assuming ws4.lboro.ac.uk is the server name:

var LocalDirectory = string.Format("\\\\ws4.lboro.ac.uk\\SY0-1ticketPhotofolder\\TICKET PHOTO'S\\{0:yyyy-MM-dd}", DateTime.Now);

o solo

var LocalDirectory = string.Format(@"\\ws4.lboro.ac.uk\SY0-1ticketPhotofolder\TICKET PHOTO'S\{0:yyyy-MM-dd}", DateTime.Now);

contestado el 28 de mayo de 14 a las 14:05

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.