Language : C# (Visual studio 2005)
Hi , i have problem
I use File.Copy to copy from Local HDD to network HDD .
THe app on my side works , but on client's side , that operation hangs.
So , when program should start copying , the client just gets an hourglass cursor (indicating that it is busy).
File size is less than 1 MB .
Can it be permission issue , how can I find solution ?
Thanks-

Can you post the entire method where you are calling File.Copy() ? If it were a permission error you would typically see an exception thrown. The only reason that it would hang (that I know of) is because the operation is working but it is going very slowly, ie if you mapped a network drive that was mounted over a 56k VPN. Are you sure the HDD space is available and connected at a fast speed? Also can you use windows explorer to manually copy a file and does it complete quickly?

File.Copy(fileListBox.SelectedItem.ToString(), Class1.GetElement(2, programSettings.FileTypeSettings[x].ToString(), '~') + datum + "\\" + Class1.GetFileNameOnly(fileListBox.SelectedItem.ToString()), true);

To answer you qs:
1.The user did go thgrough the process manually where he copied the file(s) to locations
2.I will have to see about hdd space available
3.I will have to check their network speeds , it is financial institution

Please use code tags when posting code on daniweb:

[code=csharp] ...code here...

[/code]

By the way -- that looks like an incredibly dangerous way to assemble a file path so you could likely have a problem with the paths. Maybe have the application post the source and destination file paths to ensure they are being assembled properly. Also ensure that the method is not hanging on another call aside from the File.Copy() which is why I asked you to post the entire method.

The code should not be problem because it works on my side.
It uses available paths

I will try to investigate the scenario(network), and try to see if permissions is an issue . Thanks -

Hi , problem was a logical error.
Code was executing in a for loop that would not terminate(forgot to increment a variable).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.