DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 7 of 7

Thread: Access text file located on another machine with ASP .NET

  1. #1
    Join Date
    Jun 2005
    Posts
    33

    Access text file located on another machine with ASP .NET

    Simply I have to access a text file on a machine other than the webserver. I get the error message "Unknown username or bad password" when i try to access the text file. ASP uses internet guest account IUSR_<machine_name> for annonymus access, i created the same account on the machine where text file is located and the password is kept same. I am using win xp. I have completed all the steps mentioned in the microsoft technical articles:

    http://support.microsoft.com/default...b;en-us;184566
    http://support.microsoft.com/kb/197964/EN-US/

    Plz help me to solve this problem.

  2. #2
    Join Date
    Dec 2003
    Posts
    2,750
    Have you enabled impersonation? ASP.NET works a little differently than ASP as the default account used is ASPNET (or NetworkService under Windows 2003). Impersonation is not enabled by default as it is under ASP.

    http://msdn.microsoft.com/library/de...ersonation.asp
    Paul
    ~~~~
    Microsoft MVP (Visual Basic)

  3. #3
    Join Date
    Jun 2005
    Posts
    33
    Great! It works ....Thanx
    Would you please tell me how can i get the name of virtual directory in which my application is placed.

  4. #4
    Join Date
    Jun 2005
    Posts
    33
    Okay, i have got the solution to my second problem. It can be done by Request.ApplicationPath property.
    Thanx again.

  5. #5
    Join Date
    Jun 2005
    Posts
    33
    I have another problem for u people :-( When i reach a particular page in my application all the session variables that i have defined in other pages do not work in that page, and all the session variable defined in that particular page dont work on other pages. Please guide me what is the reason for this and what can be the solution.

  6. #6
    Join Date
    Dec 2003
    Posts
    2,750
    Are you redirecting to a page in another domain, web app or virtual root?
    Paul
    ~~~~
    Microsoft MVP (Visual Basic)

  7. #7
    Join Date
    Jun 2005
    Posts
    33
    Last night i got the solution to my problem when i was compiling the code in my mind and amazingly the problem was due to the reason you have told me.
    Lots of Thanks......

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center