473,408 Members | 2,477 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

path related

I have following code

if (!System.IO.File.Exists(sFile))
{

//do something
}
else
{

//do something else

}

my possible sFile values are

\\msnt102\shared\dbs\db1.mdb"
x:\dbs\db1.mdb (where x is a mapped drive to \\msnt102)

above code doesn not work for mapped drives....any workaround....


Nov 19 '05 #1
6 1027
Possibly because of this?

<msdn>
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.
</msdn>

"abcd" <ab**@abcd.com> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl...
I have following code

if (!System.IO.File.Exists(sFile))
{

//do something
}
else
{

//do something else

}

my possible sFile values are

\\msnt102\shared\dbs\db1.mdb"
x:\dbs\db1.mdb (where x is a mapped drive to \\msnt102)

above code doesn not work for mapped drives....any workaround....

Nov 19 '05 #2
I believe your ASPNET account does not have the rights to access your mapped
drive.

As a test, try use impersonation to overcome this, impersonating and
Administrator/Power Users account.
"abcd" <ab**@abcd.com> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl...
I have following code

if (!System.IO.File.Exists(sFile))
{

//do something
}
else
{

//do something else

}

my possible sFile values are

\\msnt102\shared\dbs\db1.mdb"
x:\dbs\db1.mdb (where x is a mapped drive to \\msnt102)

above code doesn not work for mapped drives....any workaround....

Nov 19 '05 #3
I am confused with ASPNET user on other machine

Machine A - IIS , ASP.net application hernce has MachineA\ASPNET user
MachineB - non IIS, no aspnet user, no dot net

I have maped a drive \\MachineB\shared on MachineA called as X drive

if I see X drive's security tab properties then I can add only users from
MAchineB and no ASPNET user is available there how can I addd
MachineA\ASPNET user on that drive....


"Grant Merwitz" <gr***@workshare.com> wrote in message
news:uy**************@TK2MSFTNGP15.phx.gbl...
I believe your ASPNET account does not have the rights to access your
mapped drive.

As a test, try use impersonation to overcome this, impersonating and
Administrator/Power Users account.
"abcd" <ab**@abcd.com> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl...
I have following code

if (!System.IO.File.Exists(sFile))
{

//do something
}
else
{

//do something else

}

my possible sFile values are

\\msnt102\shared\dbs\db1.mdb"
x:\dbs\db1.mdb (where x is a mapped drive to \\msnt102)

above code doesn not work for mapped drives....any workaround....


Nov 19 '05 #4
i don't think you can, as that user is specific to that machine.

But you can either impersonate a common user, or set IIS to be run by a
domain user that can exist on both machines

In IIS, right click on your default website or vistual directory
Click Directory Security
Click Edit

There you can set another user with approprate rights over both machines
"abcd" <ab**@abcd.com> wrote in message
news:uF*************@TK2MSFTNGP15.phx.gbl...
I am confused with ASPNET user on other machine

Machine A - IIS , ASP.net application hernce has MachineA\ASPNET user
MachineB - non IIS, no aspnet user, no dot net

I have maped a drive \\MachineB\shared on MachineA called as X drive

if I see X drive's security tab properties then I can add only users from
MAchineB and no ASPNET user is available there how can I addd
MachineA\ASPNET user on that drive....


"Grant Merwitz" <gr***@workshare.com> wrote in message
news:uy**************@TK2MSFTNGP15.phx.gbl...
I believe your ASPNET account does not have the rights to access your
mapped drive.

As a test, try use impersonation to overcome this, impersonating and
Administrator/Power Users account.
"abcd" <ab**@abcd.com> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl...
I have following code

if (!System.IO.File.Exists(sFile))
{

//do something
}
else
{

//do something else

}

my possible sFile values are

\\msnt102\shared\dbs\db1.mdb"
x:\dbs\db1.mdb (where x is a mapped drive to \\msnt102)

above code doesn not work for mapped drives....any workaround....



Nov 19 '05 #5
Thanks Grant now that makes sense.

Are there any security risks if I run my web application as an domina user
as an annonymous user.

thanks

"Grant Merwitz" <gr***@workshare.com> wrote in message
news:e4**************@TK2MSFTNGP14.phx.gbl...
i don't think you can, as that user is specific to that machine.

But you can either impersonate a common user, or set IIS to be run by a
domain user that can exist on both machines

In IIS, right click on your default website or vistual directory
Click Directory Security
Click Edit

There you can set another user with approprate rights over both machines
"abcd" <ab**@abcd.com> wrote in message
news:uF*************@TK2MSFTNGP15.phx.gbl...
I am confused with ASPNET user on other machine

Machine A - IIS , ASP.net application hernce has MachineA\ASPNET user
MachineB - non IIS, no aspnet user, no dot net

I have maped a drive \\MachineB\shared on MachineA called as X drive

if I see X drive's security tab properties then I can add only users from
MAchineB and no ASPNET user is available there how can I addd
MachineA\ASPNET user on that drive....


"Grant Merwitz" <gr***@workshare.com> wrote in message
news:uy**************@TK2MSFTNGP15.phx.gbl...
I believe your ASPNET account does not have the rights to access your
mapped drive.

As a test, try use impersonation to overcome this, impersonating and
Administrator/Power Users account.
"abcd" <ab**@abcd.com> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl...
I have following code

if (!System.IO.File.Exists(sFile))
{

//do something
}
else
{

//do something else

}

my possible sFile values are

\\msnt102\shared\dbs\db1.mdb"
x:\dbs\db1.mdb (where x is a mapped drive to \\msnt102)

above code doesn not work for mapped drives....any workaround....




Nov 19 '05 #6
Good question, but one for which i don't have an answer.
I just know it works :)

"abcd" <ab**@abcd.com> wrote in message
news:u5**************@TK2MSFTNGP11.phx.gbl...
Thanks Grant now that makes sense.

Are there any security risks if I run my web application as an domina user
as an annonymous user.

thanks

"Grant Merwitz" <gr***@workshare.com> wrote in message
news:e4**************@TK2MSFTNGP14.phx.gbl...
i don't think you can, as that user is specific to that machine.

But you can either impersonate a common user, or set IIS to be run by a
domain user that can exist on both machines

In IIS, right click on your default website or vistual directory
Click Directory Security
Click Edit

There you can set another user with approprate rights over both machines
"abcd" <ab**@abcd.com> wrote in message
news:uF*************@TK2MSFTNGP15.phx.gbl...
I am confused with ASPNET user on other machine

Machine A - IIS , ASP.net application hernce has MachineA\ASPNET user
MachineB - non IIS, no aspnet user, no dot net

I have maped a drive \\MachineB\shared on MachineA called as X drive

if I see X drive's security tab properties then I can add only users
from MAchineB and no ASPNET user is available there how can I addd
MachineA\ASPNET user on that drive....


"Grant Merwitz" <gr***@workshare.com> wrote in message
news:uy**************@TK2MSFTNGP15.phx.gbl...
I believe your ASPNET account does not have the rights to access your
mapped drive.

As a test, try use impersonation to overcome this, impersonating and
Administrator/Power Users account.
"abcd" <ab**@abcd.com> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl...
>I have following code
>
> if (!System.IO.File.Exists(sFile))
> {
>
> //do something
> }
> else
> {
>
> //do something else
>
> }
>
>
>
> my possible sFile values are
>
> \\msnt102\shared\dbs\db1.mdb"
> x:\dbs\db1.mdb (where x is a mapped drive to \\msnt102)
>
> above code doesn not work for mapped drives....any workaround....
>
>
>
>



Nov 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

70
by: Michael Hoffman | last post by:
Many of you are familiar with Jason Orendorff's path module <http://www.jorendorff.com/articles/python/path/>, which is frequently recommended here on c.l.p. I submitted an RFE to add it to the...
34
by: Reinhold Birkenfeld | last post by:
Hi, the arguments in the previous thread were convincing enough, so I made the Path class inherit from str/unicode again. It still can be found in CVS:...
12
by: Xah Lee | last post by:
Python Doc Problem Example Quote from: http://docs.python.org/lib/module-os.path.html ---------- split( path) Split the pathname path into a pair, (head, tail) where tail is the last...
4
by: Matt Sawyer | last post by:
I am attempting to use an API (CxApiOem.dll) that has a large number of defines and complicated structs. It's just too much hassle to attempt to use DLLImport to make the desired API calls. ...
1
by: Markus | last post by:
Hi My ISP seems to have made a PHP version upgrade - without any change in the code, a new error occurs: PHP Warning: ftp_nlist() : open_basedir restriction in effect. File(/var/tmp/) is not...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.