المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : File.Copy Issue



C# Programming
04-03-2009, 10:06 AM
Good People,

I have attempted to use File.Copy to copy from a source file to a new file. However, even after I get the apps running directory (usine AppDomain.CurrentDomain.BaseDirectory + @"UserImages\") it still does not work. It throws an exception claiming it can't find part of the directory of the destination file. What I don't understand is that using AppDomain.CurrentDomain.BaseDirectory + @"Database\AppDatabase.vdb3" to find my database for the application works as expected.

Do I have to create the new file first before writing to it? Doesn't File.Copy create the new file? Any ideas?

Thanks,
Blitz