Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 395561
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T16:27:58+00:00 2026-05-12T16:27:58+00:00

I need to let an aspx.cs file run code to enumerate the contents of

  • 0

I need to let an aspx.cs file run code to enumerate the contents of a directory on another server altogether. Basically, use a Directory object, etc.

Here is what I can piece together (I’m really not a network rights guy at all, so this is all confusing to me.) When a user loads my aspx page, that page, code behind, is actually running under some kind of windows user account. IUSR_ or something.

For some reason, the server I need to reach (it’s a Page Flex server) will not let me change the “Location” to search for users in so I can’t go find /IUSR… and give it rights.

Is there some way to pass credentials as I try to enumerate the contents of a remote server’s directories?

I really hope that made sense.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T16:27:59+00:00Added an answer on May 12, 2026 at 4:27 pm

    I don’t know all your security constraints, but you may want to look into delegation

    http://msdn.microsoft.com/en-us/library/aa291350(VS.71).aspx

    There’s lots of other articles on it if you search google

    EDIT:

    From: http://msdn.microsoft.com/en-us/library/xh507fc5(VS.71).aspx

    <!-- Web.config file. -->
    <identity impersonate="true" userName="contoso\Jane" password="pass"/>
    

    The idea is to have the web request run as whatever domain user does have access to the share, instead of the default (IUSR_* or ASPNET user, I can’t remember)

    I believe you can do this for just a subdirectory or script if you want to limit what scripts are running as this user, see http://msdn.microsoft.com/en-us/library/b6x6shw7.aspx

    <location path="ReadUNC.aspx">
        <system.web>
            <identity impersonate="true" userName="contoso\Jane" password="pass"/>
         </system.web>
    </location>
    

    And if you want to do the impersonation programmatically, maybe this will help get you started: http://www.west-wind.com/WebLog/posts/1572.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically in order to have a profile Block u need - let's say profile
Let's say I need to upload files to a server programmatically using uploading a
I need to pass a JavaScript Array variable to a code-behind file and access
Let's say I have a repeater with the code: <ItemTemplate> <asp:HyperLink ID=HyperLink1 runat=server NavigateUrl='<%#DataBinder.Eval(Container.DataItem,
I need to let users of an application open a folder by clicking a
I have a simple application in which I need to let the user select
I have a cart on my website and I need to let users easily
In my web application, I need to let users (mostly IE browsers) to click
I have a C# project using windows forms. I need to let the user
Let's say I need to take names of movies the person likes. I don't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.