hi there,
i have a question in coping a file to machine in the network
i use the below code
public string UploadFile(string ID,string Phase,string source,string fileName)
{
string path = @"\Server-003\F\Details\Reports\" + ID + @"\Phase" + Phase + @"\Proposal";
Directory.CreateDirectory(path);
//string folderPath = path.Substring(0,slashIndexLast);
string[] files = Directory.GetFiles(path);
for (int r = 0; r < files.Length; r++)
{
int dotIndexLast = files[r].LastIndexOf(".");
int slashIndexLast = files[r].LastIndexOf("\\");
string fileWithName = files[r].Substring((slashIndexLast+1), ((dotIndexLast-1) - slashIndexLast));
if (fileWithName.Equals(fileName))
File.Delete(files[r]);
}
int sdot = source.LastIndexOf(".");
string sourceExt = source.Substring(sdot,(source.Length-sdot));
string copyFile = path +@"\"+fileName+""+ sourceExt;
File.Copy(source, copyFile);
return copyFile;
}
but when i run the code
it copies the fiel in the c drive creating the folder path as " \Server-003\F\Details\Reports\" + ID + @"\Phase" + Phase + @"\Proposal "
how do i give the path to the machine i want to copy the files
please can some one give me some guidence
thanxxxxx