摘要:
/// <summary> ///读取sql脚本文件,注意:文件以utf-8格式保存 /// 每个执行单元,以独占一行的go结束 /// 可执行建表,修改表结构等操作 /// </summary> /// <param name="varFileName"></param> /// <returns></returns> public static List<string> SqlFileToList(string varFileName) { if (!File.Exists(varFil 阅读全文
摘要:
<s:select name="user.sex" list="#{0:'女',1:'男'}" value="${user.sex}" theme="simple"></s:select>加上theme="simple" 不会自动换行了使用map初始化action: List listValue=new ArrayList(); Map d=new HashMap(); d.put("k",0); d.put(" 阅读全文
摘要:
package com.hunuo.common;import java.awt.Image;import java.awt.image.BufferedImage;import java.io.File;import java.io.FileOutputStream;import javax.imageio.ImageIO;import com.sun.image.codec.jpeg.JPEGCodec;import com.sun.image.codec.jpeg.JPEGImageEncoder;public class ImageUtil { /** * 生成缩略图 * @par.. 阅读全文
摘要:
// 上传的文件 private File file; private String fileContentType;// 文件类型 private String fileFileName;// 文件名 public void setFile(File file) { this.file = file; } public void setFileContentType(String fileContentType) { this.fileContentType = fileContentType; } public void setFileFileName(String fileFile... 阅读全文
摘要:
PHP/Javascript/ASP 删除前提示 1,链接形式echo "<a href='../delete/delete.php?rec_id=$query_row[0]' onClick=/"if(confirm('确实要删除此条记录吗?')) return true;else return false;/">删除</a>";2,按钮形式<button onClick="if(confirm('确实要删除此条记录吗?')) return submit();els 阅读全文
摘要:
struts2的s:iterator 标签 详解struts2的s:iterator 可以遍历 数据栈里面的任何数组,集合等等 以下几个简单的demo:s:iterator 标签有3个属性: value:被迭代的集合 id :指定集合里面的元素的id status 迭代元素的索引1:jsp页面定义元素写法 数组或list<s:iterator value="{'1','2','3','4','5'}" id='number'> <s:property value 阅读全文
摘要:
system.io.path下有好几个实用的方法. system.io.path.getExtension(path) 得到扩展名 system.io.path.getfilename(path) 阅读全文
摘要:
DownloadFile.aspx页面内容:<%@ Page Language="C#" %><%//使用方法DownloadFile.aspx?file=要下载的图片 string url = HttpContext.Current.Request.Url.Query.ToLower(); //file=dddd.jpg url = url.Replace("?file=", ""); Response.BufferOutput = false; Response.Clear(); Response.Content 阅读全文
摘要:
1、要让一个Windows Form的TextBox显示多行文本就得把它的Multiline属性设置为true。这个大家都知道,可是当你要在代码中为Text属性设置多行文本的时候可能会遇到点麻烦:)你往往会想到直接付给一个含有换行符"\n"的字符串给Text属性:aTextBox.Text = "First Line\nSecond Line\nThird Line";可是实际运行的时候你却发现它始终不会换行,显示的结果为"First LineSecond LineThirdLine"。其实主要是因为TextBox运行在Windows 阅读全文
摘要:
在编程中经常会遇到在一个按钮中执行复杂操作,并将复杂操作最后返回的值加入一个ListView或ComboBox中候选。这个时候程序会卡,当程序员将这些卡代码放进线程(Thread)中后发现当对控件操作时出现“线程间操作无效: 从不是创建控件的线程访问它”异常。为什么.net不让我们跨线程操作控件,这是有好处的。因为如果你的线程多了,那么当两个线程同时尝试将一个控件变为自己需要的状态时,线程的死锁就会发生。但是难道就是因为这个原因,我们就只能让程序卡着么?当然不是,这里教大家一个解决方案:用BackGroundWorker这里通过一个实例来告诉大家BackGroundWorker的用法。首先我们 阅读全文