PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Using a network path not working
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Using a network path not working
![]() |
Using a network path not working |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Hi all, I have a vb.net program running as a service that uses a network
path to query a file. If System.IO.File.Exists(fpath & "\" & filename) Can anyone tell me why the above isn't working? When I place it in a none service program it works fine. Any help appreciated. Thanks in advance. |
|
|
|
#2 |
|
Guest
Posts: n/a
|
1. Check your full path?
2. When you installed service, did you specify your working folder? If you didn't and you are relying on app relative path, then full path will anchor from System32 folder. Winista http://www.universalshoppingmall.com "Mike" <ward007@swbell.net> wrote in message news:8RClg.149493$F_3.65027@newssvr29.news.prodigy.net... > Hi all, I have a vb.net program running as a service that uses a network > path to query a file. > > If System.IO.File.Exists(fpath & "\" & filename) > > Can anyone tell me why the above isn't working? When I place it in a none > service program it works fine. > > > Any help appreciated. > > > Thanks in advance. > |
|
|
|
#3 |
|
Guest
Posts: n/a
|
I made sure everthing is there. It seems that network paths don't work when
the vb program is running as a serice. Is that true? "Winista" <winista@gmail.com> wrote in message news:OUw1Ud9kGHA.5036@TK2MSFTNGP02.phx.gbl... > 1. Check your full path? > 2. When you installed service, did you specify your working folder? If you > didn't and you are relying on app relative path, then full path will > anchor from System32 folder. > > Winista > http://www.universalshoppingmall.com > > > "Mike" <ward007@swbell.net> wrote in message > news:8RClg.149493$F_3.65027@newssvr29.news.prodigy.net... >> Hi all, I have a vb.net program running as a service that uses a network >> path to query a file. >> >> If System.IO.File.Exists(fpath & "\" & filename) >> >> Can anyone tell me why the above isn't working? When I place it in a none >> service program it works fine. >> >> >> Any help appreciated. >> >> >> Thanks in advance. >> > > |
|
|
|
#4 |
|
Guest
Posts: n/a
|
Under what user context service is running?
"Mike" <ward007@swbell.net> wrote in message news:Y8Dlg.149520$F_3.125172@newssvr29.news.prodigy.net... >I made sure everthing is there. It seems that network paths don't work when >the vb program is running as a serice. Is that true? > > "Winista" <winista@gmail.com> wrote in message > news:OUw1Ud9kGHA.5036@TK2MSFTNGP02.phx.gbl... >> 1. Check your full path? >> 2. When you installed service, did you specify your working folder? If >> you didn't and you are relying on app relative path, then full path will >> anchor from System32 folder. >> >> Winista >> http://www.universalshoppingmall.com >> >> >> "Mike" <ward007@swbell.net> wrote in message >> news:8RClg.149493$F_3.65027@newssvr29.news.prodigy.net... >>> Hi all, I have a vb.net program running as a service that uses a network >>> path to query a file. >>> >>> If System.IO.File.Exists(fpath & "\" & filename) >>> >>> Can anyone tell me why the above isn't working? When I place it in a >>> none service program it works fine. >>> >>> >>> Any help appreciated. >>> >>> >>> Thanks in advance. >>> >> >> > > |
|
|
|
#5 |
|
Guest
Posts: n/a
|
Check the account the service is running as and make sure it has access to
the share. This is a common problem b/c if the permissions aren't there, it will return false. -- Cordially, W.G. Ryan - MVP Windows Embedded Author - MCTS Self-Paced Training Kit (Exam 70-536) http://www.amazon.com/gp/product/07...=books&v=glance http://search.barnesandnoble.com/bo...735622779&itm=1 "Mike" <ward007@swbell.net> wrote in message news:8RClg.149493$F_3.65027@newssvr29.news.prodigy.net... > Hi all, I have a vb.net program running as a service that uses a network > path to query a file. > > If System.IO.File.Exists(fpath & "\" & filename) > > Can anyone tell me why the above isn't working? When I place it in a none > service program it works fine. > > > Any help appreciated. > > > Thanks in advance. > |
|
|
|
#6 |
|
Guest
Posts: n/a
|
Always include the error message. As soon as something works in a regular
application but doesn't work in an ASP.NET application or a service, double check permissions... -- Patrice "Mike" <ward007@swbell.net> a écrit dans le message de news: 8RClg.149493$F_3.65027@newssvr29.news.prodigy.net... > Hi all, I have a vb.net program running as a service that uses a network > path to query a file. > > If System.IO.File.Exists(fpath & "\" & filename) > > Can anyone tell me why the above isn't working? When I place it in a none > service program it works fine. > > > Any help appreciated. > > > Thanks in advance. > |
|
|
|
#7 |
|
Guest
Posts: n/a
|
Thanks to all for the help. I changed the user for the service and it
worked. Thanks again. "Patrice" <scribe@chez.com> wrote in message news:ejytI3ElGHA.1260@TK2MSFTNGP05.phx.gbl... > Always include the error message. As soon as something works in a regular > application but doesn't work in an ASP.NET application or a service, > double check permissions... > > -- > Patrice > > "Mike" <ward007@swbell.net> a écrit dans le message de news: > 8RClg.149493$F_3.65027@newssvr29.news.prodigy.net... >> Hi all, I have a vb.net program running as a service that uses a network >> path to query a file. >> >> If System.IO.File.Exists(fpath & "\" & filename) >> >> Can anyone tell me why the above isn't working? When I place it in a none >> service program it works fine. >> >> >> Any help appreciated. >> >> >> Thanks in advance. >> > > > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

