Ask a Question related to ASP.NET General, Design and Development.
-
David Waz... #1
Re: System.IO.File.Copy not copying and no error
I'd suggest wrapping the copy in a Try/Catch block just to be sure. Then
throw a new exception, outputing your source/destination paths along with
the original exception:
Try
System.IO.File.Copy(Source,Dest)
Catch ex as exception
throw new Exception("Source: '" & source & "' - Dest: '" & dest &
"'",ex)
end try
also, put a break point at the Throw, and examine your variables.
"Xander Q." <xander_q@hotmail.com> wrote in message
news:1958ff15.0307052341.260d3083@posting.google.c om...> Something really strange is happening. i'm using the following code to
> copy a file. this worked on my development machine, but when i moved
> it to the server (win2k) it is not copying the file and not generating
> an error. it just merrily goes on.
>
> --------------------------------------------------------------------
> source= Server.MapPath("/TTClaimsForm2/Reports/xxx.doc")
> dest= Server.MapPath("/TTClaimsForm2/Reports/Temp/xxx.doc")
>
> System.IO.File.Copy(source, dest)
> --------------------------------------------------------------------
>
>
> i checked the value of dest and it's correct. i replaced it with an
> empty string and it gave an error as expected.
>
> BUT i noticed that if i hard code destination like this:
> System.IO.File.Copy(source,
> "C:\inetpub\wwwroot\ttclaimsform2\Temp\xxx.doc ") then the copy works.
>
> how can this be happening?
David Waz... Guest
-
network or file system error
Contribute encountered a network or file system error. Please try the operation again, and contact the administrator if the error continues to... -
System.IO.FileNotFoundException using file.copy
I am trying to copy a file to a network drive. I can do it on the domain controller/web server but not from a client. Here is the code: Dim... -
Copying system drive to another one so that it could be used as a boot disk
When I bought my Mac, 10 GB was all you needed. Now, it's barely sufficient to write an e-mail. I bought a 120 GB drive and want to copy the... -
HELP: Copying DVD'S with copy guard to my drive (MAC)
Greetings all I am new to MAC, Finally came to my senses. I am presently trying to figure out how to copy some of my dvd's with copy protection on... -
File Copy Error To My Network Places
Hello, I'm sorry to waist your time with this, but I can't figure this one out. I was hoping someone could help me. I have set-up a Network... -
Xander Q. #2
Re: System.IO.File.Copy not copying and no error
"David Waz..." <dlw@pickpro.com> wrote in message news:<bhZNa.1682$Ro2.1449@newssvr31.news.prodigy.c om>...
> I'd suggest wrapping the copy in a Try/Catch block just to be sure. Then
> throw a new exception, outputing your source/destination paths along with
> the original exception:
ah yes i neglected to mention that i already did that, and the value
of 'dest' is correct. it is the same as the hard-coded string and yet
it fails...
damn i hate this stuff!!!
but thx for the input...
Xander Q. Guest



Reply With Quote

