I want to copy a file

abo samra - Jul 7, 2009 at 08:53 AM
 abo samra - Jul 7, 2009 at 11:35 PM
Hello, i made a windows application in C#, it contains some files in the same folder of the application which i need to make copy some of them under certain conditions when i write the path of the file i have to determine the partiion then the folder then my file like that "C:\\windowsapplication1\\....." but if i wanted to move the application to any other partition the link won't work, so my question is how can i make the program search about the file in the local folder only without mentionning the partition so i can use the pro anywhere

1 response

use the .(dot) - means current folder and ..(two dots) means parent directory.

Say c:\abc\user is a path
In user directory "hello.txt" is a file.
You are in user directory to access file "hello.txt".
use ".\hello.txt"
thnx alot for ur help, but there's one more problem it can't paste the file but only inside the local folder, when i want to pastw the file to any other place it gives me an unhandeled exception "The file can't be found"
wht do i do now