你试一下
String s1="start C:\\Winnt\\System32\\telnet.exe";
Runtime.getRuntime().exec(s1);
String s1="start C:\\Winnt\\System32\\telnet.exe";
Runtime.getRuntime().exec(s1);
解决方案 »
- URLConnection获取html源码不完整,SOS.......
- 大家看看我这段代码问题在哪啊,老师给了我们一个文件,里面有几十万条记录,要求我们读出,在进行排序!
- 看到一个面试题,大家来讨论下!
- 删除xml文件所有节点????
- 我X~这是怎么回事啊,大家帮我看看
- 怎样让Jfilechoose显示指定扩展名的文件?
- 求助:如何用java实现EXCEL文件的打印
- 出现了这个异常通常是什么意思?
- 有关Swing事件线程的疑问,1000分求教。
- 大家都来看看,项目的关键所在 -- 有关JAVA处理解压缩的问题
- 请问dateFormat.parse(String str )中的str的格式是什么
- 我用的是oracle jDeveloper 9.03,怎样把jdk1.3升为1.4?
try{
URL url = new URL("http://host/redirect.htm");
this.getAppletContext().showDocument(url,"_blank");
}
catch(Exception ee)
{
ee.printStackTrace();
}
然后写一个中转的htm文件redirect.htm
<Script language="javascript">
this.location="telnet://bbs.gznet.edu.cn";
</script>同样达到你要的效果
URL url = new URL("http://192.168.4.36/redirect.htm");
this.getAppletContext().showDocument(url,"_blank");
}
catch(Exception ee)
{
ee.printStackTrace();
}怎么没有反映啊,也没有任何异常
在浏览器中输入http://192.168.4.36/redirect.htm就可以
package test;import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import javax.swing.*;
import java.io.*;
import java.net.*;public class Applet2 extends Applet {
private boolean isStandalone = false;
private JButton jButton1 = new JButton();
//Get a parameter value
public String getParameter(String key, String def) {
return isStandalone ? System.getProperty(key, def) :
(getParameter(key) != null ? getParameter(key) : def);
} //Construct the applet
public Applet2() {
}
//Initialize the applet
public void init() {
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
//Component initialization
private void jbInit() throws Exception {
jButton1.setText("jButton1");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
jButton1_actionPerformed(e);
}
});
this.add(jButton1, null);
}
//Start the applet
public void start() {
}
//Stop the applet
public void stop() {
}
//Destroy the applet
public void destroy() {
}
//Get Applet information
public String getAppletInfo() {
return "Applet Information";
}
//Get parameter info
public String[][] getParameterInfo() {
return null;
} void jButton1_actionPerformed(ActionEvent e) {
try{
URL url = new URL("http://192.168.4.36/redirect.htm");
this.getAppletContext().showDocument(url,"_blank");
}
catch(Exception ee)
{
ee.printStackTrace();
}
}
}
在windows下的ie就行