using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
namespace ConsoleApplication1
{
class Program
{
public static void Main()
{
string sourcepath = @"c:\MyTest.txt";
string path2 = @"\\10.2.55.184\Share\Team\Jitinder\MyTest.txt";
try
{
// Create the file and clean up handles.
// Ensure that the target does not exist.
//File.Delete(path2);
// Copy the file.
File.Copy(sourcepath, path2,true);
Console.WriteLine("{0} copied to {1}", sourcepath, path2);
// // Try to copy the same file again, which should succeed.
// File.Copy(sourcepath, path2, true);
// Console.WriteLine("The second Copy operation succeeded, which was expected.");
//
}
catch
{
Console.WriteLine("Double copy is not allowed, which was not expected.");
}
}
}
}
make sure u can access \\10.2.55.184\Share\Team\Jitinder\
u can directly do from explorer also