Urgent Help Required
-
how can i copy files and folders from a specific location on my computer to a remote pc on my network using c# code and a window form based application
Have you looked at the File class[^] in the System.IO namespace?? Are you familiar with the way Windows networking works in Workgroup and Domain modes? If not, you're going to find this a rather difficult project to work on.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
how can i copy files and folders from a specific location on my computer to a remote pc on my network using c# code and a window form based application
And putting "Urgent" anywhere in your post tends to get you ignored. If it were that "urgent", you'd either be Googling this question to until your fingers bled, or running to the bathroom, whichever the case may be.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
how can i copy files and folders from a specific location on my computer to a remote pc on my network using c# code and a window form based application
Check out File.Copy.
using System;
using System.IO;class Test
{
public static void Main()
{
string path = @"c:\temp\MyTest.txt";
if (!File.Exists(path))
{
// Create a file to write to.
using (StreamWriter sw = File.CreateText(path))
{
sw.WriteLine("Hello");
sw.WriteLine("And");
sw.WriteLine("Welcome");
}
}// Open the file to read from. using (StreamReader sr = File.OpenText(path)) { string s = ""; while ((s = sr.ReadLine()) != null) { Console.WriteLine(s); } } try { string path2 = path + "temp"; // Ensure that the target does not exist. File.Delete(path2); // Copy the file. File.Copy(path, path2); Console.WriteLine("{0} was copied to {1}.", path, path2); // Delete the newly created file. File.Delete(path2); Console.WriteLine("{0} was successfully deleted.", path2); } catch (Exception e) { Console.WriteLine("The process failed: {0}", e.ToString()); } }
}
Paul Watson wrote: Like, if you say sort of, like, you know, one more, you know, time, I'm going to, like, you know, sort of sort you out, you know.
-
And putting "Urgent" anywhere in your post tends to get you ignored. If it were that "urgent", you'd either be Googling this question to until your fingers bled, or running to the bathroom, whichever the case may be.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
And putting "Urgent" anywhere in your post tends to get you ignored. If it were that "urgent", you'd either be Googling this question to until your fingers bled, or running to the bathroom, whichever the case may be.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007Dave Kreskowiak wrote:
f it were that "urgent", you'd either be Googling this question to until your fingers bled, or running to the bathroom, whichever the case may be.
Very true :)
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
-
And putting "Urgent" anywhere in your post tends to get you ignored. If it were that "urgent", you'd either be Googling this question to until your fingers bled, or running to the bathroom, whichever the case may be.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007Dave Kreskowiak wrote:
If it were that "urgent", you'd either be Googling this question to until your fingers bled, or running to the bathroom, whichever the case may be.
Well said Dave.
Regards, Satips.:rose: Don't walk in front of me, I may not follow; Don't walk behind me, I may not lead; Walk beside me, and just be my friend. - Albert Camus
-
Dave Kreskowiak wrote:
If it were that "urgent", you'd either be Googling this question to until your fingers bled, or running to the bathroom, whichever the case may be.
Well said Dave.
Regards, Satips.:rose: Don't walk in front of me, I may not follow; Don't walk behind me, I may not lead; Walk beside me, and just be my friend. - Albert Camus
-
:)
Vasudevan Deepak Kumar Personal Homepage Tech Gossips