import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;import javax.swing.JButton;
import javax.swing.JEditorPane;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JScrollPane;
import javax.swing.JTextField;public class J6 extends JFrame {
private JTextField t1=new JTextField("http://xx.xxxxx.xxx.cn/newsadm/newsview.asp?id=1143%20and%201=2");
private JButton b1=new JButton("开始");
private String sstr=null;
private JEditorPane editPane=new JEditorPane();
public J6()
{
b1.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e1)
{
sstr=t1.getText();
sstr.trim();
t1.setText(sstr);
try{
URL address=new URL(sstr);
// editPane=new JEditorPane(address);
editPane.setPage(address);
}catch(MalformedURLException e){
System.out.println("MalformedURLException:"+e);
editPane.setText((String)e.getMessage().toString());
}catch(IOException e){
System.out.println("IOException:"+e);
editPane.setText((String)e.getMessage().toString());
}
}
});
setLayout(new FlowLayout());
add(t1);
add(b1);
add(editPane);
editPane.setEditable(false);
t1.setEditable(true);
}
public static void main(String[] args) throws IOException {
run(new J6(),500,500);
}
}
}
我想利用以上代码依次运行以下三个网址
http://xx.xxxxx.xxx.cn/newsadm/newsview.asp?id=1143'
http://xx.xxxxx.xxx.cn/newsadm/newsview.asp?id=1143%20and%201=1
http://xx.xxxxx.xxx.cn/newsadm/newsview.asp?id=1143%20and%201=2
可是不知道怎么修改代码,请各位帮帮忙!非常感谢!
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;import javax.swing.JButton;
import javax.swing.JEditorPane;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JScrollPane;
import javax.swing.JTextField;public class J6 extends JFrame {
private JTextField t1=new JTextField("http://xx.xxxxx.xxx.cn/newsadm/newsview.asp?id=1143%20and%201=2");
private JButton b1=new JButton("开始");
private String sstr=null;
private JEditorPane editPane=new JEditorPane();
public J6()
{
b1.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e1)
{
sstr=t1.getText();
sstr.trim();
t1.setText(sstr);
try{
URL address=new URL(sstr);
// editPane=new JEditorPane(address);
editPane.setPage(address);
}catch(MalformedURLException e){
System.out.println("MalformedURLException:"+e);
editPane.setText((String)e.getMessage().toString());
}catch(IOException e){
System.out.println("IOException:"+e);
editPane.setText((String)e.getMessage().toString());
}
}
});
setLayout(new FlowLayout());
add(t1);
add(b1);
add(editPane);
editPane.setEditable(false);
t1.setEditable(true);
}
public static void main(String[] args) throws IOException {
run(new J6(),500,500);
}
}
}
我想利用以上代码依次运行以下三个网址
http://xx.xxxxx.xxx.cn/newsadm/newsview.asp?id=1143'
http://xx.xxxxx.xxx.cn/newsadm/newsview.asp?id=1143%20and%201=1
http://xx.xxxxx.xxx.cn/newsadm/newsview.asp?id=1143%20and%201=2
可是不知道怎么修改代码,请各位帮帮忙!非常感谢!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货