473,396 Members | 1,833 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,396 software developers and data experts.

HttpListerner in Console App and Web Config

Reg
Hello All!

I have a small Console based Application which acts like Http server.
HttpListener is used for Http requests and responses.

Now I would like to use Digest Authentication and I made a IHttpModule based
assembly to handle authentication. Problem is that IHttpModeule based
assembly is configured into web.config but I don't know how HttpListener can
read App.Config to get information considering Digest Authentication module.
How that can be done? Or are there any other ways to implement Digest
Authentication to Console Apps using HttpListener?

Code in Console App is below:

// Create a listener and add the prefixes.

System.Net.HttpListener listener = new System.Net.HttpListener();

foreach (string s in prefixes)

{

listener.Prefixes.Add(s);

}

// Digest Authentication selected

listener.AuthenticationSchemes = AuthenticationSchemes.Digest;

// How to read configuration information from Web.Config file???

try

{

// Start the listener to begin listening for requests.

listener.Start();

Thanks!


Sep 10 '07 #1
0 1288

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

Similar topics

3
by: Richard | last post by:
I have a simple C# console app that needs to read the appname.exe.config file to get db connect strings etc. from the <appSettings>. When the app starts, it deletes the file! I can't figure it...
4
by: christopher green | last post by:
I have a solution that comprises a web based project and a console application. Web.Config holds attributes that I want to access from my console application, can anyone advise me as to how to do...
6
by: yaron | last post by:
Hi all, I want to give a sample console application for the user with 2 configuration files. I want to give also a 2 .bat files for running the sample application, one for each configuration...
2
by: Vikram | last post by:
I am using log4net in a vb.net console application. But its not working. I have added congif setting in app.config file also No error is generated but app. does not write to log file. ...
2
by: Jim Heavey | last post by:
Hello, I used VS 2005 to create a console application. Got the application working just fine. I then decided I would create a folder for each of my "console" applications within that project. I...
9
by: antonyliu2002 | last post by:
By default, IIS is configured to timeout a session in 20 minutes, which can be changed through the IIS config window. I use InProc sessionState mode. I can also set the session timeout in...
4
by: olduncleamos | last post by:
I am trying to share one config file between multiple console apps. Is there anyway I can set the config file name for the current application? Thanks in advance.
1
by: MasterLalit | last post by:
Hi, i am using a app.config file in my console application. App.config code--> <configuration> <configSections> <section name="enterpriseLibrary.ConfigurationSource"...
0
by: Darko Bazulj | last post by:
How to add next to web.config <location path="9998886"> <system.web> <compilation tempDirectory="D:\logs\temporary_asp_net_files\9998886" /> </system.web> </location> <location path="444">
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.