Click here to Skip to main content
13,000,017 members (46,389 online)
Rate this:
Please Sign up or sign in to vote.
Hello All,

I'm making a web browser with the default browser control of visual studio 2012.

but i want to make a custom login popup when a website is trying to login
with a .htpasswd file(this usually happens if you try to access you're router website or such sites)

my problem is: I don't know the request the website is sending toe the web browser(if it IS a request!!!)

Please help me,,

Bart de Lange
Posted 24-Apr-13 8:05am
Sergey Alexandrovich Kryukov 24-Apr-13 14:35pm
Not clear. How .htpasswd (Apache?) is related to WebBrowser and System.Windows.Forms?!
Bart de Lange 24-Apr-13 15:40pm
Yes apache

I made a few websites in the past an a couple of them used the htpasswd file
So i thougt it is website based

But if you visit such a site with the new win 8 style ie than you get a different popup then if you visit it with chrome or firefox
So because of that i know that it is not. Website based but a browser based popup
And i want to know how to handle that because a want to customize it(thats why i also dont have a code)
Sergey Alexandrovich Kryukov 24-Apr-13 15:47pm
Still unclear, even more unclear. You are talking about client side now. How it all depends on what's on client? Unrelated things...
Bart de Lange 24-Apr-13 15:52pm
Yes the popup is cleint side but the htpassws file is server side.
the server(apache or whatever) is sending something(i want to know what and how??) to the browser that makes the browser opens up a popu screen with a username and a password field and then the browser sends the info back to the server and he chrcks if it is correct
Sergey Alexandrovich Kryukov 24-Apr-13 16:01pm
All the server-side internals, like this file, are totally hidden from the client side. An HTTP server sends anything only on HTTP request. You can try sending HTTP request using VB.NET application (not browser) directly to server and see what's in the HTTP response.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Please see my last comment to the question, about HTTP response and HTTP request. You can do it directly using the class System.Net.HttpWebRequest:[^].

It might help you to understand what's going on, but I doubt it immediately help you to solve your problem. I suspect that your problem is based on misunderstanding of how Web words, so you cannot even explain the problem. Learn about it some more; this is the best way to help yourself.

Bart de Lange 9-Jun-13 5:48am
OK i gave it another try to look what the .htpasswd file does

and here it is

it sends a login request to the browser and normally the browser then shows the user a login pop up(like when you trying to login on your routers web page where you can define your routers settings) this pop up is made by the browser itself because it is a different pop up if you are using IE or Google Chrome.

so when you're trying to access a site which is blocked by a .htpasswd file Apache sends a login request and the browser then responds with a pop up to let the user login to the site

Kind Regards,
Bart de Lange

P.S. Sorry to bumb this question but i really need to know this because its the only thing that my browser is not capable of
(and downloading files from example download.aspx?file=.... or download.php?file=....)
Bart de Lange 9-Jun-13 7:11am
OK i know a little more it has to do something with the web credentials and the basic authentication/basic realm

and intercepting a 401 HTTP status code

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170624.1 | Last Updated 24 Apr 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100