Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 29th, 2007, 08:28 PM
Authorized User
 
Join Date: Jan 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Redirect URL to File path

Hi,

Does anyone know how to redirect the url path typed in the web browser to a local file path that we specified?
e.g: when typed www.google.com, it redirects to C:\ProgramFiles\Application\Block.html.
I'm currently working on creating an application that should restrict the students from surfing internet. Either a certain url to be block or all.

Any idea how to do it in C#?
Thanks in advance.

_____________________
(^oo^) as pure as snow
__________________
_____________________
(^oo^) as pure as snow
 
Old January 30th, 2007, 06:42 AM
Udi Udi is offline
Registered User
 
Join Date: Jan 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,
I didnt got u'r question correctly. What I understood from it is U want to redirect path to a file on local machine i.e. server on which the application is running.
For this U need to set the navigation Url path. Also U will have to map the virtual and physical paths of the file.

 
Old January 30th, 2007, 09:50 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

This sounds like you want to build an HTTP filtering application. You would need to build something that monitored the IP traffic that the computer generates and change the response when you see a request that you want to filter. There are web appliances and software that already do that sort of thing that would be far easier to implement than building something (I would think).

The company I work for uses WebSense (http://www.websense.com) to monitor/restrict our web activity. I don't know any others off the top of my head.

-Peter
 
Old January 30th, 2007, 11:00 PM
Authorized User
 
Join Date: Jan 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

So sorry, it did not emphasize more.

It's not on web application. Not webserver redirection or such.
What i want is to create a windows application that would restrict or block student from surfing internet on some or all websites.
If the student visiting a url that similiar with our list of restricted website, this program should know it and redirect it to our own html page, in which maybe showing that 'the page you are viewing is currently blocked' or something like that.

This idea is coming from two sample applications that used this approach in order to block student from viewing restricted websites. i just don't know how they did it.

_____________________
(^oo^) as pure as snow
 
Old January 30th, 2007, 11:07 PM
Authorized User
 
Join Date: Jan 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Emm.. about purchasing other software, it might not be possible. My management would like to built it in-house for the sake of further service if needed, such as custom enhancement and debugging.

Btw, this is only one of sub-feature inside one of the functions on my entire project.

_____________________
(^oo^) as pure as snow
 
Old February 1st, 2007, 11:18 PM
Authorized User
 
Join Date: Jan 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

something like here:

http://www.codeproject.com/useritems...56&msg=1873556

But i don't understand C++
Anyone can help?

_____________________
(^oo^) as pure as snow
 
Old February 2nd, 2007, 02:05 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

I dont know, but why not just setup a SQUID proxy? This is what we use at my agency and it works fairly well. (It runs on linux and is Free as in Beer)

That would be my suggestion, else you are getting into some heavy development.

By the by, you could try using this tool: http://code2code.net/ to convert the c++ to c#

================================================== =========
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
 
Old February 2nd, 2007, 03:00 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Im no expert in this area but it might be worth looking into the inbuild dns on your network.
Im not sure how to access it, but it seems like you are trying to redirect a request for one web site to another site or page and that is what dns does.
We do this manually when we want to use the external web site address from inside the network.

Does anyone know how to access this data, it seems like a management utility for the dsn is what you want.


======================================
They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================
 
Old February 2nd, 2007, 03:10 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Hmmm, I think I was on the wrong track.


Is this correct?
You are building a Windows App that has Web browsing ablities but you want to restrict the access.

I would load a list of banned sites into a collecion on the app, preferably from a central source, not C:\..., and then test every navigation that it is not in the list, if it is, redirect.

Hope this is some help.
Rod

======================================
They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================
 
Old February 2nd, 2007, 04:21 AM
Authorized User
 
Join Date: Jan 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Dear dparsons and rodmcleay, thanks for your advice.

However, i have a case that is quite complicated:
1st: we are building commercial product and not providing network admin service
2nd: our client are somehow government sector that have a tight policy especially on their server.

the sample product that i found: www.ashkon.com/webblock.html
i need that block website function they have.

_____________________
(^oo^) as pure as snow





Similar Threads
Thread Thread Starter Forum Replies Last Post
URL Redirect based on given URL somnath.kartic VS.NET 2002/2003 1 August 2nd, 2012 08:21 AM
How to change file path to http url cJeffreywang BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 0 July 25th, 2007 12:18 AM
Error: File path and URL http map differently cJeffreywang ASP.NET 1.0 and 1.1 Basics 4 March 27th, 2007 08:03 PM
file path does not correspond to url rnelson330 .NET Framework 1.x 1 May 27th, 2006 09:42 AM
URL Redirect Help david29118 Classic ASP Basics 3 April 3rd, 2005 06:09 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.