Jump to content

Recommended Posts

Posted

replace this line:

isr = new InputStreamReader(url.openStream());

 

with these:

URLConnection con = url.openConnection();
con.addRequestProperty("User-Agent", "Mozilla/4.76"); 
isr = new InputStreamReader(con.getInputStream());

1 error on URLConnection con = url.openConnection(); :S how i can replace this?

Posted

remove the sun.net.www.. line from the imports and import the java.net.URLConnection

 

It works perfectly now :D

Thanx!

Posted

Ive tried what all of you said.. but im still getting the 403 error, i even tried to add application settings and still the same

 

url = new URL(hz_http);
URLConnection con = url.openConnection();
con.setRequestProperty("CONTENT-TYPE", "application/x-www-form-urlencoded");
con.addRequestProperty("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 6.0; el; rv:1.9.2.18) Gecko/20110614 Firefox/3.6.18 ( .NET CLR 3.5.30729; .NET4.0C)"); 
con.setRequestProperty ("From", "Mozilla");
isr = new InputStreamReader(con.getInputStream());

 

PS: About the useragent, yes i tried adding Mozilla/4.76 and i still got a 403

 

EDIT: Nevermind fixed.

Posted

I can't open hopzone at all.

 

Website Currently Unavailable
The website you are trying to access is currently unavailable. Please try again at a later time.

 

I guess this is why it doesn't work

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




×
×
  • Create New...