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

  • SEARCH
  • Home
  • 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 8090881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:52:23+00:00 2026-06-05T19:52:23+00:00

I am using HttpListener Class to produce a local web server. But by default,

  • 0

I am using HttpListener Class to produce a local web server. But by default, HttpListener Class will read the path which saves HttpListener exe file.

If I want to set a different path as server root path, just like Apache can choose a root path, how to do it with HttpListener?

I have read the HttpListener document, but there is no method for doing this.

Thanks

Water Lin

  • 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-06-05T19:52:25+00:00Added an answer on June 5, 2026 at 7:52 pm

    But by default, HttpListener Class will read the path which saves HttpListener exe file. ”

    HttpListener has very little interest in local paths at all. Do you mean “my own code is defaulting to the working directory”? If so, this could simply just a case of

    Directory.SetCurrentDirectory(rootDirectory);
    

    Although actually, frankly I’d just expect this to be done by keeping a string rootDirectory (or maybe a DirectoryInfo) kicking around, and working relative to that.

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

Sidebar

Related Questions

I am using the class HttpListener as a web server. This server runs on
I'm using HttpListener to provide a web server to an application written in another
I tried creating a simple HTTP server using System.Net.HTTPListener, but it doesn't receive connections
I am using a HttpListener to implement a very simple http server, which is
I've written a server using HttpListener that works perfectly well for requests sent from
I wrote a simple WebServer using HttpListener class (.net 2.0) It seems that It
I have implemented a really simple C# Http Server using HttpListener within a windows
In vb2005 how do you simulate a web browser's file download using Net.HttpListener? This
Im trying to send images over HTTP using HttpListener but some images come from
I'm using HttpListener as a simple http server. I've been benchmarking req/sec performance by

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.