Click here to Skip to main content
13,000,742 members (55,140 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hello, I'm writing an app that creates a wifi software access point using the Win7 Wireless Hosted Network API from C# I found a project on codeplex (VirtualRouter) that shows how to do that from C# so no problems but now I need to force a client to go to an specific web page once it conects to the router for the first time. Does any one know how to do that?

Thanks a lot in advance,

Posted 4-Apr-12 2:42am
Updated 4-Apr-12 4:52am
Code-o-mat 4-Apr-12 9:31am
Explain a bit more what you mean by "force a client to go to a specific web page". A client connects to your WiFi network, then what happens, what would the client experience?
Jochen Arndt 4-Apr-12 10:01am
Such a behaviour is usually implemented using a HTTP proxy server that catches all HTTP requests. With the first request of a new client, it will redirect to a specific server and page ignoring the original destination address while following requests are forwarded.
Member 8649772 4-Apr-12 10:13am
Thanks Jochen for your answer,
by enabling the Wireless Hosted Network on win7 the Internet Connection Sharing is also enabled even when you're not sharing any internet connection, so, could I get the wanted behaviour by programmaticaly accessing the ICS (INetSharingManager interface)? If so then how do I do that?
Jochen Arndt 4-Apr-12 10:40am
Please use the Reply link on a comment to answer to a comment to generate an email notification. Otherwise, the poster of the comment will not see your reply when not visiting this page again.

I'm sorry, but I did not have experience with ICS. I just wanted to point out how it can be done: Install a HTPP proxy (or write one yourself) that has access to the list of new clients and marks them as seen when serving the start page.
jcgalveza 4-Apr-12 10:53am

Thanks a lot Code-o-mat for your quick response, well when a client connect to my WiFi network and opens the browser I want the browser to show an specific page or show a message on the client screen or a browser popup window.
What I want is the same effect as changing the client's browser homepage, I've seen that on computers belonging to a domain where a domain administrator may change the browser's homepage at will. I've also read about something similar done in Hotels WiFi's.
I just found this here[^]:

"The wifi works in a similar way to a Hotels wifi hotspot, when you log on to the wifi connection and refresh your browser it immediately redirects the user to the advertising content page just like a hotel redirects you to the payment page upon initiation. On an iPhone it works even better by actually pushing a login box to the handset upon connection that displays the adverts."

Tha's exactly what I want but done using a SoftwareAP instead of a custom hardware.

Thanks a lot,

jcgalveza 4-Apr-12 10:56am
Thanks Jochen, well I will research on the matter of writing a proxy but it sounds quite complicated, I'll post my solution if I find one
Code-o-mat 4-Apr-12 11:03am
In this case, as Jochen also pointed out, i think your best bet is a proxy server. Since all HTTP traffic would go trough your hotspot, you can detect HTTP requests coming from clients and redirect them to wherever you want them to go.
Jochen Arndt 4-Apr-12 11:03am
You must not write one yourself. At first I would look for for existing ones. If you find some with sources, you may also use them as a base for your implementation.

But there may be other (simpler) solutions. That's the reason why I posted a comment and not an answer.
jcgalveza 4-Apr-12 11:20am
I'm searching the web and codeplex for solutions, the whole thing here is that I'm new to all of this stuff of proxies and wireless networks so maybe there is a simple solution but I don't see it. I'm also looking on the Internet Connection Sharing API because I belive that service implements a proxy but I don't know if I can use it for my purpose.
Do you know if there is a forum on microsoft where I can make that question?

Thanks once again.
jcgalveza 4-Apr-12 11:22am
Thanks a lot Jochen, I'm looking now on codeplex and on MSDN to see if there is a simple solution, I belive ICS implements a proxy, but I'm not sure if I can programmaticaly implement the redirection.
Code-o-mat 4-Apr-12 14:20pm
Don't know about such a forum, sorry, which of course does not mean it doesn't exist.
jcgalveza 4-Apr-12 14:29pm
Ok, thanks a lot any way

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 5 Apr 2014
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