本文介绍了如何在PC而非手机上测试某些Internet功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在使用NetBeans 6.9连接到Internet的PC上测试此代码(例如)
Hi,
I''d like to test this code(for example) on PC connected to Internet using NetBeans 6.9
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
import javax.microedition.io.*;
import java.io.*;
/////////////
try{
HttpConnection connection = (HttpConnection) Connector.open("http://somenonexistentsite");
connection.setRequestMethod(HttpConnection.GET);
connection.setRequestProperty("Content-Type","//text plain");
connection.setRequestProperty("Connection", "close");
textBox.setString("ok"); // <=== when started On PC
}
catch(IOException e)
{
textBox.setString("unable to open url");//<<== ...on Mobile Phone
}
这可能吗?
谢谢.
我已将PC连接到Internet,并安装了JDK和netbeans-6.9-ml-windows.exe.开始发布代码后,无论我写了什么URL,我总是在TextBox中看到"OK".
Is this possible and how?
thanks.
I have PC connected to Internet, and installed JDK and netbeans-6.9-ml-windows.exe. Starting posted code, I always see "OK" in TextBox, whatever url I wrote.
推荐答案
这篇关于如何在PC而非手机上测试某些Internet功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!