Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

c# and File.copy() function

Status
Not open for further replies.

menyy

Programmer
Apr 23, 2008
1
GB
I have a simple C# apllication that is transfering files from one machine to another. PC's are connected via VPN. Copy(path1,path2) function works very slow - about 1% of bandwidth. What can be the reason ?
I'd be very greatful for any help
 
there are alot of variables: 1. network 2. vpn 3. file size

start with these simple tests.
1. transfering an empty text file from 1 directory to another on your local box.
2. then preform the same test with a larger file (similiar in size the actual file you want to copy.)
*repeat steps 1 and 2 with your local machine and another machine on the network (not over vpn).
*repeat steps 1 and 2 to a computer over vpn.

i created a copy routine which transfers sql backs from the server to a usb drive. it takes about 30 minutes to transfer everything.

another stragety is to stream parts of the file and save them. I believe Copy.File() loads the entire file into memory, then transfers. streaming bytes would begine coping the file before the entire file is loaded. haven't tried this, but it makes sense in theory.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Are either of these machines running Vista? The shipping version has a known problem with slow network file copies.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top