Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ C# Win7
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,
 
Galvez
Posted 4-Apr-12 3:42am
Edited 4-Apr-12 5:52am
v4
Comments
Code-o-mat at 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?
jcgalveza at 4-Apr-12 10:53am
   
Clarification:
 
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,
 
Galvez
Code-o-mat at 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.
jcgalveza at 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.
Code-o-mat at 4-Apr-12 14:20pm
   
Don't know about such a forum, sorry, which of course does not mean it doesn't exist.
jcgalveza at 4-Apr-12 14:29pm
   
Ok, thanks a lot any way
Jochen Arndt at 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 at 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 at 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 at 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
Jochen Arndt at 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 at 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.

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

  Print Answers RSS
0 OriginalGriff 304
1 Maciej Los 285
2 Sergey Alexandrovich Kryukov 230
3 Shweta N Mishra 186
4 Aajmot Sk 153
0 OriginalGriff 7,660
1 Sergey Alexandrovich Kryukov 7,072
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,760


Advertise | Privacy | Mobile
Web02 | 2.8.1411023.1 | Last Updated 5 Apr 2014
Copyright © CodeProject, 1999-2014
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