摘要: public static int[] sortAsc(int[] array) { if (array != null) { int temp; for (int i = 0; i < array.Length; i++) { for (int j = i + 1; j < array.Length; j++) { if (a... 阅读全文
posted @ 2013-07-22 16:18 loklook123 阅读(220) 评论(0) 推荐(0) 编辑
摘要: 上传文件,如果文件存在则递归重命名文件;递增+11、建一个类用户保存文件信息;2、递归方法;3、实际调用;1、 1 /// <summary> 2 /// 用户保存文件信息 3 /// </summary> 4 public class UploadInfo 5 { 6 private string fileDir;//文件夹 7 private string fileName;//文件名 8 9 public string FileDir10 {11 ... 阅读全文
posted @ 2013-05-15 12:00 loklook123 阅读(404) 评论(0) 推荐(0) 编辑
摘要: 1 /// <summary> 2 /// 递归遍历dir目录下的所有文件 3 /// </summary> 4 /// <param name="dir">要查找的目录</param> 5 /// <param name="files">集合对象,用于保存文件信息</param> 6 /// <returns></returns> 7 public void GetAllFiles(DirectoryInfo dir, List<FileInfo> 阅读全文
posted @ 2013-05-15 11:30 loklook123 阅读(438) 评论(0) 推荐(0) 编辑
摘要: 1 /** 2 * 递归遍历指定目录下的所有文件 3 * @param dir 指定目录 4 * @param allfiles 集合对象 用于保存文件信息 5 */ 6 public static void getAllfiles(File dir,ArrayList<File> allfiles) 7 { 8 try { 9 File[] files = dir.listFiles();10 if (files == null)11 re... 阅读全文
posted @ 2013-05-15 11:27 loklook123 阅读(744) 评论(0) 推荐(0) 编辑
摘要: 有3张图片,第一张固定在左边,第三张固定右边,第二张根据浏览器自动伸缩(top-1_1.jpg,top-1_2.jpg,top-1_3.jpg)1、样式 <style> body,div {margin:0; padding:0; }/*顶框背景图片*/.top1_bgimage{background-image: url(images/top-1.jpg);background-repeat:no-repeat;}.top1_bgimage1{background-image: url(images/top-1_1.jpg); height:71px; width:267px;f 阅读全文
posted @ 2013-04-26 12:52 loklook123 阅读(310) 评论(0) 推荐(0) 编辑
摘要: Jsp调用组件代码:<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%><jsp:useBean id="smart" scope="page" class="org.cys.smart.SmartUpload"/><% //首先使用javaBean //初始化组件 smart.initialize(pageContext); 阅读全文
posted @ 2013-03-25 15:17 loklook123 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 1、后台类CreateXLS代码package com.cys.j2ee.jxl;import java.io.*;import java.util.Collection;import javax.servlet.http.HttpServletResponse;import com.cys.j2ee.model.Person;import jxl.*;import jxl.write.*;public class CreateXLS {public static String ToExcel(HttpServletResponse response,String fileName,Colle 阅读全文
posted @ 2013-03-25 11:15 loklook123 阅读(283) 评论(0) 推荐(0) 编辑
摘要: 1 <html> 2 <head> 3 <title>浏览本地图片</title> 4 <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 5 </head> 6 <body> 7 <p> 8 <style type="text/css"> 9 #kk{ 10 width:1000px; 11 height:300px; 12 overflow 阅读全文
posted @ 2013-03-19 09:07 loklook123 阅读(499) 评论(0) 推荐(0) 编辑
摘要: 一、服务器端:1、指定IP地址和端口 开启监听 IPAddress ip = IPAddress.Parse(ServerIP);//配置监听IP地址和端口 tcpListener = new TcpListener(ip, ServerPort); //启动监听tcpListener.Start();2、接收到客户端请求,并编写处理函数Socket tempSocket = tcpListener.AcceptSocket();//接受挂起的连接请求clientSocket = tempSocket;byte[] buffer=new Byte[1024];clientSocket.Rece 阅读全文
posted @ 2013-02-25 12:14 loklook123 阅读(943) 评论(0) 推荐(0) 编辑
摘要: Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE); ResultSet rs = stmt.executeQuery(sql); int colcount=rs.getMetaData().getColumnCount(); int rowcount=0; if(rs.next()) { rs.last(); rowcount=rs.getRow(); rs.first(); }注意点:必须先指定:stmt = con.cr... 阅读全文
posted @ 2012-11-15 09:09 loklook123 阅读(176) 评论(0) 推荐(0) 编辑