Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Security / June 2004

Tip: Looking for answers? Try searching our database.

System.IO.FileNotFoundException using file.copy

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stephen Witter - 27 May 2004 16:44 GMT
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 impersonationContext As
System.Security.Principal.WindowsImpersonationContext
   Dim currentWindowsIdentity As System.Security.Principal.WindowsIdentity
   currentWindowsIdentity =
CType(User.Identity,System.Security.Principal.WindowsIdentity)
   impersonationContext = currentWindowsIdentity.Impersonate()
   dim Temp as string="TestFile"
   File.Copy("\\MyServer\Template.doc", "\\MyServer\" & Temp &".doc")

   impersonationContext.Undo()

I get the error "System.IO.FileNotFoundException: Could not find file
\\Server\File..." when running it from the [authenticated] client
browser.   I searched everywhere on the web and MSDN on this error but found
nothing.  The error it occurs on the file copy statement The file.copy
statement is trying to copy a file on a different server than the web
server.

Any help is appreciated.
She Ven Ng - 23 Jun 2004 05:19 GMT
I also facing the same problem. Did u manager to solve ur problem? If
yes, can u pls post ur solution?
Thanks.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.