日期:2014-05-20  浏览次数:20562 次

CSDN_java华山论剑_日不落神贴
一楼压低,代码节节高。。
------解决方案--------------------
接分
------解决方案--------------------

------解决方案--------------------
这是干嘛的,接分接分!
------解决方案--------------------

------解决方案--------------------
能接分吗?
------解决方案--------------------
什么意思啊?
------解决方案--------------------
引用:
IE8浏览器下面上传图片,怎样得到图片的宽高

<input type="file" name="upload"onchange="checkPicSize(this);"/>

function checkPicSize(obj){
var img = new Image();
img.src = obj.value;
alert(img.width);
alert(img.height);
}
通过这种方式是不可以的,得到的都是0 。该怎么解决,

试试offsetWidth和offsetHeight
------解决方案--------------------
public class WatchThread extends Thread {
private static final Log LOG = LogFactory.getLog("crawler");

private int crawlerThreadCount;//抓取线程的数目
private int scriptFilterThreadCount;//调度线程的数目

//所有抓取线程的执行状态,<线程名称,是否正在运行>,true表示正常运行,false表示已终止
private static HashMap<String, Boolean> crawlerThreadsStatus;
//所有调度线程的执行状态
private static HashMap<String, Boolean> scriptFilterThreadsStatus;

public WatchThread(String threadName) {//构造函数
super(threadName);
LOG.info("Start Watch Thread");
init();
}

/**
 * 初始化抓取线程和脚本调度线程的数目、状态,并启动所有抓取线程和调度线程
 */
public void init() {
//从配置文件读取抓取线程的数目
crawlerThreadCount = Integer.parseInt(LoadConfig
.lookUpValueByKey("crawlerThreadCount"));
LOG.info("crawler thread count:" + crawlerThreadCount);

//调度线程的数目暂定为1
scriptFilterThreadCount = 1;
LOG.info("script filter thread count:" + scriptFilterThreadCount);

crawlerThreadsStatus = new HashMap<String, Boolean>();
scriptFilterThreadsStatus = new HashMap<String, Boolean>();

//启动所有的抓取线程,数目为crawlerThreadCount
startAllCrawlerThreads();

//启动脚本调度线程
startAllScriptFilterThreads();
}

/**
 * 启动所有的抓取线程,数目为crawlerThreadCount
 * 各抓取线程执行具体的抓取行为
 */
public void startAllCrawlerThreads() {
for (int i = 0; i < crawlerThreadCount; i++) {
CrawlerThread crawlerThread = new CrawlerThread("CrawlerThread-"
+ i);
crawlerThread.start();
crawlerThreadsStatus.put("CrawlerThread-" + i, true);
}
}