|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
File.Exists not working.Now this is strange.
I had an app runing on W2K Pro and now that its on XP I cant find a file. The code that is not working is: If File.Exists("O:\DTX Import UMAR\AsTester.txt") Then Where "O:\DTX Import UMAR\AsTester.txt" is a network path. Any ideas why this is not working? "George Lake" <g@lake.com> schrieb: Documentation:>I had an app runing on W2K Pro and now that its on XP I cant find a file. > >The code that is not working is: >If File.Exists("O:\DTX Import UMAR\AsTester.txt") Then > >Where "O:\DTX Import UMAR\AsTester.txt" is a network path. > >Any ideas why this is not working? Show quoteHide quote | *Return Value* | 'true' if the caller has the required permissions and 'path' | contains the name of an existing file; otherwise, 'false'. This | method also returns 'false' if 'path' is a null reference | ('Nothing' in Visual Basic) or a zero-length string. If the | caller does not have sufficient permissions to read the specified | file, no exception is thrown and the method returns 'false' | regardless of the existence of 'path'. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> mmm
It should work then. The application is running under the same user as the old server. mmmm Show quoteHide quote "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message news:eo61gG6nGHA.2312@TK2MSFTNGP04.phx.gbl... > "George Lake" <g@lake.com> schrieb: >>I had an app runing on W2K Pro and now that its on XP I cant find a file. >> >>The code that is not working is: >>If File.Exists("O:\DTX Import UMAR\AsTester.txt") Then >> >>Where "O:\DTX Import UMAR\AsTester.txt" is a network path. >> >>Any ideas why this is not working? > > Documentation: > > | *Return Value* > | 'true' if the caller has the required permissions and 'path' > | contains the name of an existing file; otherwise, 'false'. This > | method also returns 'false' if 'path' is a null reference > | ('Nothing' in Visual Basic) or a zero-length string. If the > | caller does not have sufficient permissions to read the specified > | file, no exception is thrown and the method returns 'false' > | regardless of the existence of 'path'. > > -- > M S Herfried K. Wagner > M V P <URL:http://dotnet.mvps.org/> > V B <URL:http://classicvb.org/petition/> > George Lake wrote:
Show quoteHide quote >>> I had an app runing on W2K Pro and now that its on XP I cant find a You can use filemon from www.sysinternals.com to see if it is really trying >>> file. The code that is not working is: >>> If File.Exists("O:\DTX Import UMAR\AsTester.txt") Then >>> >>> Where "O:\DTX Import UMAR\AsTester.txt" is a network path. >>> >>> Any ideas why this is not working? >> >> Documentation: >> >>> *Return Value* >>> 'true' if the caller has the required permissions and 'path' >>> contains the name of an existing file; otherwise, 'false'. This > It should work then. The application is running under the same user as > the old server. to do what you want. Andrew What user? If it is "system", then XP won't let the network IO succeed.
This is one of the security changes from W2K to XP. Mike Ober. Show quoteHide quote "George Lake" <g@lake.com> wrote in message news:%23WM8CX6nGHA.4604@TK2MSFTNGP02.phx.gbl... > > mmm > It should work then. The application is running under the same user as the > old server. > mmmm > > > "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message > news:eo61gG6nGHA.2312@TK2MSFTNGP04.phx.gbl... > > "George Lake" <g@lake.com> schrieb: > >>I had an app runing on W2K Pro and now that its on XP I cant find a file. > >> > >>The code that is not working is: > >>If File.Exists("O:\DTX Import UMAR\AsTester.txt") Then > >> > >>Where "O:\DTX Import UMAR\AsTester.txt" is a network path. > >> > >>Any ideas why this is not working? > > > > Documentation: > > > > | *Return Value* > > | 'true' if the caller has the required permissions and 'path' > > | contains the name of an existing file; otherwise, 'false'. This > > | method also returns 'false' if 'path' is a null reference > > | ('Nothing' in Visual Basic) or a zero-length string. If the > > | caller does not have sufficient permissions to read the specified > > | file, no exception is thrown and the method returns 'false' > > | regardless of the existence of 'path'. > > > > -- > > M S Herfried K. Wagner > > M V P <URL:http://dotnet.mvps.org/> > > V B <URL:http://classicvb.org/petition/> > > > > > It´s a domain user that has admin rights on the target server.
Show quoteHide quote "Michael D. Ober" <ober***@.alum.mit.edu.nospam> wrote in message news:u%23OecEDoGHA.1592@TK2MSFTNGP04.phx.gbl... > > What user? If it is "system", then XP won't let the network IO succeed. > This is one of the security changes from W2K to XP. > > Mike Ober. > > "George Lake" <g@lake.com> wrote in message > news:%23WM8CX6nGHA.4604@TK2MSFTNGP02.phx.gbl... >> >> mmm >> It should work then. The application is running under the same user as >> the >> old server. >> mmmm >> >> >> "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message >> news:eo61gG6nGHA.2312@TK2MSFTNGP04.phx.gbl... >> > "George Lake" <g@lake.com> schrieb: >> >>I had an app runing on W2K Pro and now that its on XP I cant find a > file. >> >> >> >>The code that is not working is: >> >>If File.Exists("O:\DTX Import UMAR\AsTester.txt") Then >> >> >> >>Where "O:\DTX Import UMAR\AsTester.txt" is a network path. >> >> >> >>Any ideas why this is not working? >> > >> > Documentation: >> > >> > | *Return Value* >> > | 'true' if the caller has the required permissions and 'path' >> > | contains the name of an existing file; otherwise, 'false'. This >> > | method also returns 'false' if 'path' is a null reference >> > | ('Nothing' in Visual Basic) or a zero-length string. If the >> > | caller does not have sufficient permissions to read the specified >> > | file, no exception is thrown and the method returns 'false' >> > | regardless of the existence of 'path'. >> > >> > -- >> > M S Herfried K. Wagner >> > M V P <URL:http://dotnet.mvps.org/> >> > V B <URL:http://classicvb.org/petition/> >> > >> >> >> > > > Does the user have the O drive mapped to the correct network share? Also,
can the user browse to that file manually and open it? Jim Wooley http://devauthority.com/blogs/jwooley/default.aspx Show quoteHide quote > It´s a domain user that has admin rights on the target server. > > "Michael D. Ober" <ober***@.alum.mit.edu.nospam> wrote in message > news:u%23OecEDoGHA.1592@TK2MSFTNGP04.phx.gbl... > >>>>> I had an app runing on W2K Pro and now that its on XP I cant find >>>>> a >>>>> >> file. >> >>>>> The code that is not working is: >>>>> If File.Exists("O:\DTX Import UMAR\AsTester.txt") Then >>>>> Where "O:\DTX Import UMAR\AsTester.txt" is a network path. yes to both.
what beats me is that the same app runing under the same user works on win2k Pro and not on XP pro Show quoteHide quote "Jim Wooley" <jimNOSPAMwooley@hotmail.com> wrote in message news:24f81e8f4c798c86e5e4f0b2329@msnews.microsoft.com... > Does the user have the O drive mapped to the correct network share? Also, > can the user browse to that file manually and open it? > Jim Wooley > http://devauthority.com/blogs/jwooley/default.aspx > >> It´s a domain user that has admin rights on the target server. >> >> "Michael D. Ober" <ober***@.alum.mit.edu.nospam> wrote in message >> news:u%23OecEDoGHA.1592@TK2MSFTNGP04.phx.gbl... >> > >>>>>> I had an app runing on W2K Pro and now that its on XP I cant find >>>>>> a >>>>>> >>> file. >>> >>>>>> The code that is not working is: >>>>>> If File.Exists("O:\DTX Import UMAR\AsTester.txt") Then >>>>>> Where "O:\DTX Import UMAR\AsTester.txt" is a network path. > >
ulong vs UInt64
Live multi-user debugging? Help! dotnet activex equivalent? Can I use an asterisk in the "Imports" statement? Accessing existing Excel instance Transferring data between datatables and between datareader and datatable Another Printing Question Opacity on form Testing for OleDbDataReader is nothing before closing it Beta Testers Needed for WindowsForms Component. |
|||||||||||||||||||||||