By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,978 Members | 1,373 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,978 IT Pros & Developers. It's quick & easy.

To search a file and copy it to server

P: 7
I want to search a file from server and want to copy it to the local disk.
how it is done? This is working if the file is in my hard disk itself.But not when it comes to server. If i map the server i can y:\\serverfolde\\folder am tring to make an exe. different people will map to different drive. so i cant give like that.should give like @\\server\\serverfolde\\folder\\ but it is not working.
My code is<code>
destination ="D:\\Princy\\My Documents\\project\\";
string source=searchfolder+"\\"+"mod501_"+filetosearch+". 3d";
string target=destination+"mod501-"+filetosearch+".3d";
string[] files = Directory.GetFiles(searchfolder, "mod501_"+filetosearch+".3d");
//string[] files = Directory.GetFiles(searchfolder, filetosearch+"*");
foreach (string dir in files)
lblcnt.Text="Selected File: "+ dir;
string[] search = Directory.GetFiles(destination,"mod501-"+filetosearch+".3d");
lblcnt.Text="File already exist";
lblcnt.Text="File copied";
what to give insted of

If am using
am geting error:
System.IO.DirectoryNotFoundException:Could not find a part of the "@books\template\Template\els".
Otherwise its working perfectly.
Sep 17 '07 #1
Share this Question
Share on Google+
2 Replies

Expert 100+
P: 1,351
i'm assuming this is C#, please post in the .Net Forums where the resident experts can better assist you.
Sep 17 '07 #2

P: 7
Sep 18 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.