Results 1 to 13 of 13
Thread: [SOLVED] Site Blocking
- 06-05-2008, 02:28 PM #1
Senior Member
- Join Date
- Mar 2008
- Posts
- 447
- Rep Power
- 6
- 06-06-2008, 06:04 AM #2
Senior Member
- Join Date
- Mar 2008
- Posts
- 447
- Rep Power
- 6
Plz help me for solve the problme
- 06-10-2008, 11:08 PM #3
Member
- Join Date
- Jul 2007
- Posts
- 14
- Rep Power
- 0
Normally to block a site you just need to know the URL to block, typically the hostname. Using java.net.URL class you can check the domain used for a URL.
e.g.
URL url = new URL(address);
String host = url.getHost();
if(host.equals(blockedDoman) {
// perform deny code here
}
- 06-11-2008, 03:38 AM #4
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Mir, as I said one of the earlier thread, first you should have the list of sites which you want to block. Then implement a access denied method on such.
- 06-11-2008, 09:05 AM #5
Senior Member
- Join Date
- Mar 2008
- Posts
- 447
- Rep Power
- 6
- 06-11-2008, 09:07 AM #6
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Add a menu item on your GUI menu. After that add an action listener to that menu item and call your method there.
- 06-11-2008, 09:16 AM #7
Senior Member
- Join Date
- Mar 2008
- Posts
- 447
- Rep Power
- 6
I add GUI menu...ok i am sending you menu code..
this is not working but same code is here which is working proxy classJava Code:if (evt.target instanceof Button) { if(evt.target == button) { hide(); dispose(); return true; } else if(evt.target == site) { ArrayList <String> asq; px= new Proxy(""); asq=px.GetSite(); String a3=px.geUrlStr(); String un; for(int j=0;j<asq.size();j++) { un=asq.get(j); if(a3.contains(un)) { JOptionPane.showMessageDialog(null," In"); } else { JOptionPane.showMessageDialog(null," out"); } }
Java Code:for(int j=0;j<ArTemp.size();j++) { nu=ArTemp.get(j); if(un.contains(nu)) { JOptionPane.showMessageDialog(null," In"); return; // Here is difference } else { JOptionPane.showMessageDialog(null,"out"); } }
In This code i mark "return" which is blocking site to go next part. In the menuitem code "return " is not working..
Plz help me....
- 06-11-2008, 09:42 AM #8
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
In simple word what you have to do is, make a list with blocking URL. Every time a user entered a URL compared it with the list. If you found such a thing in the list, block the whole process.
I can't see in your code have tried such a thing.
- 06-11-2008, 09:49 AM #9
Senior Member
- Join Date
- Mar 2008
- Posts
- 447
- Rep Power
- 6
- 06-11-2008, 10:16 AM #10
Senior Member
- Join Date
- Mar 2008
- Posts
- 447
- Rep Power
- 6
- 06-23-2008, 06:56 AM #11
Senior Member
- Join Date
- Mar 2008
- Posts
- 447
- Rep Power
- 6
- 07-02-2008, 05:59 PM #12
Member
- Join Date
- Jun 2008
- Posts
- 11
- Rep Power
- 0
dude reposting a milion times wont help you. you have to search on google. read other threads and see if they help. Also a really good program will take things and put them together to make what you want happen
- 07-03-2008, 06:04 AM #13
Senior Member
- Join Date
- Mar 2008
- Posts
- 447
- Rep Power
- 6
Similar Threads
-
Code to connect to a web site
By suji in forum NetworkingReplies: 1Last Post: 02-15-2008, 04:05 PM -
Site hacked
By tim in forum Suggestions & FeedbackReplies: 3Last Post: 02-02-2008, 09:47 AM -
How can I get a RealMedia file from a web site?
By emesol0 in forum NetworkingReplies: 0Last Post: 01-24-2008, 07:01 PM -
Printing all IP address of a site
By Java Tip in forum Java TipReplies: 0Last Post: 11-24-2007, 07:38 PM -
Non Blocking Network
By mathias in forum NetworkingReplies: 1Last Post: 08-07-2007, 06:49 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks