Microsoft
Software
Hardware
Network
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...
}
Random Solutions
like statement
Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.
graphics card for acer monitor.
Using getdate() to provide only short date
Show email id in excel
Access variable field locking
No Netware NDS Trees detected
Using Batch file to Obtain the Computernames, usernames, IP Address and MAC Address from each remote PCs
Deploy Access Application with runtime and revise Table links - Inno - XP Developer - Iexpress
Search Forms