Results 1 to 4 of 4

Thread: [2005] Problem with paths

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2006
    Location
    Manchester, England
    Posts
    255

    [2005] Problem with paths

    Hello,
    I'm having trouble streamreading a text file located on a network drive.
    If I run the code in VWD2005, everything is ok.
    If I run the code in I.E., or IIS, it has the following problems:

    Path = K:\Text\File.txt
    It can't find this file

    Path = \\Server\Share\Text\File.txt
    The user name or password is invalid

    I then thought that I'd try creating a batch file that could copy the file from the network drive, to somewhere local, and read the file from there. In VWD, it copies the file, and reads the file from the local drive, but in IE or IIS, it doesn't even bother running the .bat file.

    I imagine that this all quite correct, and ensures security when viewing a page on the web, but this is for internal use only, so I need the users to be able to read a text file, irrespective of whether its on the local drive, or network drive.
    At home - VB.NET 2005/2008 Express, Visual Web Developer 2005 Express
    At work - VS 2008 Standard (VB)
    .NET 2.0/3.5


    Visual Studio Express Learning Centre | How do I videos | MSDN VB Express Forum | MSDN VB Developer Centre

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: [2005] Problem with paths

    When a web site is running under IIS it uses a local account named ASPNET or Network Services depending on the OS. In IIS you could also configure the site to "run as" a specific user.

    Whichever account you use, it needs permissions to access network resources.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 2006
    Location
    Manchester, England
    Posts
    255

    Re: [2005] Problem with paths

    In IIS you could also configure the site to "run as" a specific user.
    Thanks for your reply. I actually managed to do what I needed to do by writing a file system watcher utility to watch for changes to the file I need to work with, and copy it to where ASP.NET could read it.

    However, could you point me in the right direction with regards to your comment?
    At home - VB.NET 2005/2008 Express, Visual Web Developer 2005 Express
    At work - VS 2008 Standard (VB)
    .NET 2.0/3.5


    Visual Studio Express Learning Centre | How do I videos | MSDN VB Express Forum | MSDN VB Developer Centre

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [2005] Problem with paths

    If you set identity impersonate="true", then your ASP.NET application impersonates the user of the application assuming you're using Windows Authentication rather than basic/anonymous.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width