我写了个http://127.0.0.1/send.aspx页面通过http接收数据,
比如用户 这样访问:http://127.0.0.1/send.aspx?circle=csdn2006&pwd=csdncscn.
如果有的用户是恶意访问这个页面,就是说通过循环不停的访问这个页面,那我的这个页面就不能接收数据了,有的时候要重起iis。
那位大虾能指点一下,要怎样在send.aspx这个页面限制用户不停的访问,我小弟在这里跪谢了

解决方案 »

  1.   

    可以通过控制ip的,不过你说的这个,还不如对你DDOS攻击的,发一堆虚假连接........挺没意义的一件事
      

  2.   

    import java.net.*; 
    import java.io.*; 
    import java.util.*; 
    import java.lang.*; 
    import java.sql.*;
    //import alading.cn.BaseDB;public class HttpSend{
    public static void main(String[] args){

    /* try{
    BaseDB db = new BaseDB();
    String phone,msgContent;
    String str = "{call Proc_MT_tsxx}" ;
    while (true){
    ResultSet rs = db.ExecuteNonProcdure(str);
    while(rs.next()){
    phone = rs.getString("cPhone");
    msgContent = rs.getString("cMsgContent");
    System.out.println(getHTML("http://218.66.49.193/Smsclientinterface/send.asp?circle=shineyo&pwd=shineyo2006&mobile=" + phone + "&message=" + msgContent + "&cell=3668"));
    }
    Thread.sleep(20000); 
    }
    }catch (Exception e){
    System.out.println("错误");
    }*/
    System.out.println(getHTML("http://127.0.0.1/wt/send.aspx?circle=shineyo&pwd=shineyo2006&msgcontent=你好&spnumber=09520&mtLink=123456789"));
    /* while (true){
    try{
    System.out.println(getHTML("http://127.0.0.1/wt/send.aspx?circle=shineyo&pwd=shineyo2006&msgcontent=你好&spnumber=09520&mtLink=123456789"));
    }catch (Exception e){
    System.out.println("错误");
    }
    // Thread.sleep(20000); 
    }*/
    } /**
     * 根据URL获取HTML
     * @param str URL字符串
     * @return 页面的HTML
     */
    public static String getHTML(String str) {
    String strret = null;
    URL rTmp = null;
    InputStream ins = null;
    BufferedReader breader = null;
    InputStreamReader isreader = null;
    try {
    rTmp = new URL(str);
    ins = rTmp.openStream();
    isreader = new InputStreamReader(ins);
    breader = new BufferedReader(isreader);
    String info = breader.readLine();
    strret = info;
    info = breader.readLine();
    while (info != null) {
    strret = strret + "\n" + info;
    info = breader.readLine();
    }
    } catch (Exception e) {
     e.printStackTrace(System.err);
     return null;
    } finally {
    try {
    if (breader != null) {
    breader.close();
    }
    } catch (IOException ex) {
    } try {
    if (isreader != null) {
    isreader.close();
    }
    } catch (IOException ex1) {
    } try {
    if (ins != null) {
    ins.close();
    }
    } catch (IOException ex2) {
    }
    }
    return strret;

    }
      

  3.   

    csdn验证页用的就是时间+次数的
      

  4.   

    csdn验证页用的就是时间+次数的 你能不能给我写一下代码
      

  5.   

    <%@ OutputCache Duration="60" VaryByParam="*" %>把这行代码加在第二行,能给IIS喘喘气哦.
      

  6.   

    to esocr() 能不能留个QQ向你请教一下
      

  7.   

    <%@ OutputCache Duration="60" VaryByParam="*" %> 这个方法可以,不知那位大虾还有其他的方法