[求助] 拜求MOTOV600手机可以访问互联网的程序样例
<P>[em13]</P><P>我写了一段程序访问公网,但总是连不上去,请高手前辈给予指点,谢谢!!!!<BR>以下是我的代码:</P>
<P> HttpConnection http = (HttpConnection) Connector.open("<a href='http://10.0.0.172/intl/zh-CN/",Connector.READ,true' target="_blank" >http://10.0.0.172/intl/zh-CN/",Connector.READ,true</A>);<BR> http.setRequestProperty("X-Online-Host", "<a href="http://www.google.com" target="_blank" >www.google.com</A>");<BR> http.setRequestMethod(HttpConnection.POST);<BR> http.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");<BR> http.setRequestProperty("Accept", "*/*");<BR> oStrm = http.openOutputStream();<BR> inMsg = "game=" + inMsg;<BR> byte data[] = inMsg.getBytes();<BR> http.setRequestProperty("Content-Length", "" + data.length);<BR> OutputStream oStrm.write(data);<BR> oStrm.flush();<BR> InputStream iStrm = http.openInputStream();</P>
页:
[1]
