<%@ page import="java.util.*,java.io.*,ondraw.*" contentType="text/html; charset=gb2312" %> <% String strPD = request.getParameter("pd"); String strName = request.getParameter("pdname"); String strUrl = ""; if (strPD==null) { strUrl = "http://www.ondraw.com/index.jsp"; } else if (strPD.equals("1")) { strUrl = "http://www.ondraw.com/download/"+strName; try { RandomAccessFile file = new RandomAccessFile ("/onsee_download.txt", "rw"); int num = 0; try { String strnum=file.readLine (); if (strnum!=null) { num = Integer.parseInt(strnum); } } catch(IOException e) { strUrl = "http://www.ondraw.com/index.jsp"; num = 0; } file.seek(0); num++; String strtmp = String.valueOf(num); file.writeBytes(strtmp); file.close (); } catch (IOException fe) { strUrl = "http://www.ondraw.com/index.jsp"; } } else if (strPD.equals("2")) { strUrl = "http://www.ondraw.com/download/"+strName; try { RandomAccessFile file = new RandomAccessFile ("/onmovie_download.txt", "rw"); int num = 0; try { String strnum=file.readLine (); if (strnum!=null) { num = Integer.parseInt(strnum); } } catch(IOException e) { strUrl = "http://www.ondraw.com/index.jsp"; num = 0; } file.seek(0); num++; String strtmp = String.valueOf(num); file.writeBytes(strtmp); file.close (); } catch (IOException fe) { strUrl = "http://www.ondraw.com/index.jsp"; } } else { strUrl = "http://www.ondraw.com/index.jsp?pd="+strUrl; } if (strPD!=null) { ODDBManager2.SetProduceSummary(strPD, 1); String address = request.getRemoteAddr(); if (address!=null) { ODDBManager2.SetUserSummary(strPD, 1, address); } } response.sendRedirect(strUrl); %>