|
Question : Could not find part of the path
|
|
Hello
I cannot seem to access a file via a mapped drive or UNC, using VS2005.
Originally, I had a scheduled Tasks executable which invokes a web method in my web service. The web method needs to open a text file and insert each line into a SQL Server 2005 table. Pretty simple stuff. The exe is just there so that I can run this routine as a scheduled task. This all works fine when dealing with local drives.
If the source text file is on a mapped drive or a UNC path, I either get "Could not find part of the path" or "URI formats are not supported". I've granted full access to "EVERYONE" on the source file, source folder and the destination folder. So I thought the issue must be with the web service.
I've now added a FileCopy command into the exe to copy the text file locally, but I'm having the same issue. I don't think it's permissions as I've grabnted full rights to the 'EVERYONE' user. I am even using personation as a domain account and have granted that account fuill access to all.
My next step is to write a bat file and try to run the bat file, but to me this seems incredibly stupid.
Can anyone help please?
- Lee
|
|
Answer : Could not find part of the path
|
|
You might check the "aspnet_wp" account for privelages.
Or...
If you are using a FileStream to open a resource referenced by HTTP, you cannot do this. You must use System.Net.WebClient or System.Net.HttpWebRequest to obtain a network stream instead.
WebClient webclient = new WebClient(); using(Stream stream = webClient.OpenRead(fileUrl)) { // Process file... }
|
|
|
|