星期二, 十二月 21, 2004

如何编写Jboss startup Service

http://www.jboss.org/wiki/Wiki.jsp?page=ExampleHelloWorldService

编写在启动Jboss的时候就开始启动或服务的Bean.

星期五, 十二月 17, 2004

整合Java和C++

让你更加容易使用JNI

http://www.javaworld.com/javaworld/jw-05-2002/jw-0510-integrate.html
准备翻译下.

星期四, 十二月 16, 2004

XML-RPC active digram

准备今天开始配置compiere

http://www.compiere.org/

ASM Java ByteCode生成软件.

http://asm.objectweb.org/

主要用来生成java bytecode代码.是Groovy的核心.

需要多了解

星期三, 十二月 15, 2004

是XMLHTTPRequest还是XML-PRC?

这里有些学习的例子:
http://jsolait.net/examples/xmlrpc/
目前IE和FireFox 1.0都支持XMLHTTPRequest方法来时间简单的javascript
->java之间的交换.

XML-RPC可以在Javascript中调用?

Java平台下的压力测试工具

Web Stress test Tool
.今天TTS上的压力测试工具看起来好像不错.
GPL的软件,可以打包在自己的工具箱里.

http://www.jcrawler.com

星期五, 十二月 10, 2004

Maven 1.2 命令行语法一览表


__ __
| \/ |__ _Apache__ ___
| |\/| / _` \ V / -_) ' \ ~ intelligent projects ~
|_| |_\__,_|\_/\___|_||_| v. 1.0.2

可用的 [Plugins] / 目标
===========================
genapp ......................... 基于模板来产生应用程序
jdiff .......................... 生成两个版本之间API的不同的报告
junitdoclet .................... 生成单元测试

注意:[]之间的关键词表示maven 后跟随的目标名称,后续的名称表示子项目
比如:maven abbot editor.

[abbot] 运行修道士(abbot)测试
editor ......................... 调用修道士costello编辑器
editor-webstart ................ 调用修道士costello编辑器在一个WebStart应用里
test ........................... 运行修道士(abbot)测试
test-webstart .................. 运行测试在一个webstart引用上

[announcement] 生成发布声明
generate ....................... 生成发布声明
generate-all ................... 生成发布声明对所有的发布
mail ........................... 发送一个包含发布生命的Email

[ant] 生成ant build.xml文件
generate-build ................. 生成ant build.xml文件

[antlr] ( 没有缺省的目标 )
generate ....................... 根据antlr语法生成源代码
prepare-filesystem ............. 为altlr处理生成所有必须的字典

[appserver] ( 没有缺省的目标 )
clean .......................... 安全的删除一个已经安装的AppServer实例
cycle .......................... 强迫安装和启动一个appserver实例

init ........................... 初始化plugin必须的资源
install ........................ 安装一个appserver实例
reinstall ...................... 重安装一个appserver实例
restart ........................ 重新启动一个appserver实例
start .......................... 启动一个appserver实例
stop ........................... 停止一个appserver实例

[artifact] ( 没有缺省的目标 )

[ashkelon] ( 没有缺省的目标 )

[aspectj] Weave with AspectJ
compile ........................ Weave classes with AspectJ
test-compile ................... Weave tests with AspectJ

[aspectwerkz] ( 没有缺省的目标 )
attributec ..................... Compile AspectWerkz javadoc attributes (
xml-defined aspects)
compile ........................ Compile AspectWerkz java sources
weave .......................... Weave aspects (offline mode)

[castor] ( 没有缺省的目标 )
prepare-filesystem ............. 准备所有必须的字典为 castor 处理


[changelog] ( 没有缺省的目标 )

[changes] ( 没有缺省的目标 )
report ......................... 生成改变报告

[checkstyle] 执行 checkstyle 检查
report ......................... 执行 checkstyle 检查

[clean] 删除所有项目部件
clean .......................... 删除所有项目部件

[clover] 使用Clover生成测试覆盖率报告
html-report .................... Generate HTML test coverage reports with
Clover
off ............................ Deactivates Clover
on ............................. Activates Clover
report ......................... Generates the Clover reports
swing-report ................... Generate Swing test coverage reports with
Clover
test ........................... Compile project code with Clover and
executes the unit tests
test-single .................... Compile code with Clover and execute a
single unit test
xml-report ..................... Generate XML test coverage reports with
Clover

[console] 运行Maven控制台
help ........................... 打印帮助信息
listGoals ...................... 列出所有可用目标

[cruisecontrol] ( 没有缺省的目标 )
configure ...................... 更新Cruise 控制配置文件

run ............................ 运行Cruise控制

[dashboard] 生成仪表板报告
report ......................... 生成仪表板报告

[dist] 建立完整的配送.
build .......................... 建立完整的配送.
build-bin ...................... 建立二进制的配送.
build-setup .................... 配置建立陪送的目录
build-src ...................... 建立源代码配送.
deploy ......................... 发布一个配送
deploy-bin ..................... 发布一个二进制配送
deploy-bin-snapshot ............ 发布一个二进制配送
deploy-snapshot ................ 发布一个快照配送
deploy-src ..................... 发布一个源代码配送
deploy-src-snapshot ............ 发布一个源代码配送
prepare-bin-filesystem ......... 建立二进制的配送文件系统.
prepare-src-filesystem ......... 建立源代码的配送

[docbook] ( 没有缺省的目标 )
transform ...................... Transform any docbook-simple source into
xdocs for later use

[ear] 建立一个ear文件
deploy ......................... 发布ear 到远程知识库
deploy-snapshot ................ 发布快照版本的ear到远程知识库
ear ............................ 建立一个ear文件
generate-ear-descriptor ........ 生成 ear描述
init ........................... 初始化ear需要的文件系统和其他资源
install ........................ 在本地知识库里安装ear
install-snapshot ............... 安装快照版本的ear在本地知识库里

[eclipse] 生成Eclipse项目文件
add-maven-repo ................. 确定classpath变量MAVEN_REPO
clean .......................... 清除eclipse生成的文件
external-tools ................. 为每种目标生成一个Eclipse外部工具
external-tools-21 .............. 为每种目标生成一个Eclipse 2.1 外部工具
generate-classpath ............. 生成Eclipse .classpath 文件
generate-project ............... 生成Eclipse .project文件

[ejb] 建立一个ejb文件
deploy ......................... 发布ejb到远程知识库
deploy-client .................. 发布ejb client到远程知识库
deploy-snapshot ................ 发布快照版本的ejb到远程知识库
ejb ............................ 建立一个ejb文件
ejb-client ..................... 建立一个client ejb文件
init ........................... 为建立ejb初始文件系统和其他资源
install ........................ 在本地知识库安装ejb
install-client ................. 在本地知识库安装ejb client
install-snapshot ............... 在本地知识库安装快照版本的ejb

[faq] 从FAQ XML生成FAQ xdoc文件

[fo] This simply pre-requisites the fo:fo goal.
fo ............................. Generates an fo xml document from the ${
maven.pdf.navigationFile} file supplied as
part of the documentation.

[gump] Generate Gump descriptor from Maven
descriptor
generate-descriptor ............ Generate Gump descriptor from Maven
descriptor

[hibernate] ( 没有缺省的目标 )
aggregate-mappings ............. Aggregate multiple .hbm.xml files into one
file
schema-export .................. Export Hibernate schema

[html2xdoc] Generates XDoc documentation from normal
HTML files
transform ...................... Performs the html to xdoc transformation

[idea] Generate IDEA project files
idea ........................... Generate IDEA .ipr, .iml and .iws project
files
module ......................... Generate IDEA .iml project files
project ........................ Generate IDEA .ipr project files
workspace ...................... Generate IDEA .iws project files

[j2ee] Check that a war file is valid
validate-war ................... Check that a war file is valid

[jalopy] Format all sources with code convention
conformance
format ......................... Format all sources with code convention
conformance
taskdef ........................ Define the jalopy task to Ant and Jelly

[jar] Create the deliverable jar file.
deploy ......................... Deploy a jar to the remote repository
deploy-snapshot ................ Deploy a snapshot jar to the remote
repository
install ........................ Install the jar in the local repository
install-snapshot ............... Install a snapshot jar in the local
repository
jar ............................ Create the deliverable jar file.
snapshot ....................... Create a snapshot jar, ie '
id-YYYYMMDD.hhmmss.jar'

[java] ( 没有缺省的目标 )
compile ........................ Compile the project
jar ............................ Create the deliverable jar file.
jar-resources .................. Copy any resources that must be present in
the deployed JAR file
prepare-filesystem ............. Create the directory structure needed to
compile

[javacc] ( 没有缺省的目标 )
javacc-generate ................ Generate source from javacc grammar

[javadoc] ( 没有缺省的目标 )
deploy ......................... Deploys the jar containing javadoc to the
remote repository
deploy-snapshot ................ Deploys the snapshot version of jar
containing javadoc to remote repository
install ........................ Install the jar containing javadoc in the
local repository
install-snapshot ............... Install the snapshot version of the jar
containing javadoc in the local repository

[jboss] 生成特定的JBoss server配置文件
configure ...................... 建立特定的JBoss Server配置
deploy-ear ..................... 发布${maven.final.name}.ear
deploy-ejb ..................... 发布${maven.final.name}.jar
deploy-exploded-warfile ........ 调用'war:webapp' 目标并且发布结果
说明'maven.war.webapp.dir' 必须用.war结尾
deploy-warfile ................. 调用'war' 目标并且发布结果
dist ........................... 生成zipped JBoss配置
install ........................ 安装zip到本地知识库
package ........................ 建立制定JBoss Server的配置
start .......................... 启动JBoss 使用我们制定的Server配置
stop ........................... 停止JBoss
undeploy-ear ................... 卸载 ${maven.final.name}.ear
undeploy-ejb ................... 卸载${maven.final.name}.jar
undeploy-exploded-warfile ...... 卸载'war:webapp' 必须用.war文件结尾

undeploy-warfile ............... 卸载the result of the 'war' goal

[jbuilder] 生成JBuilder项目文件
generate-library ............... 生成JBuilder[id_project].library文件
generate-project ............... 生成JBuilder [id_project].jpx文件

[jcoverage] Generate HTML test coverage reports with
JCoverage
html-report .................... Generate HTML test coverage reports with
JCoverage
merge .......................... Merge two or more instrumentation files
into one
on ............................. perform the coverage analysis

[jdee] Generate JDEE project file
generate-project ............... Generate project file in basedir

[jdeveloper] Generate JDeveloper project files
generate-project ............... Generate jdeveloper .jpr
scanSources .................... Scans the source in order to integrate them
into JDeveloper files

[jellydoc] Generates the tag documentation
doclet ......................... A doclet which outputs all the Jelly tag
related metadata as XML
xml-doclet ..................... Creates an XML representation of the doclet
information

[jetty] Run Jetty
config ......................... Generate a Jetty configuration file
run ............................ Run Jetty
run-war ........................ Run Jetty on the current war project

[jnlp] Generate JNLP file and sign all jars
generate-jnlp .................. Generate the .jnlp file and sign all jars
generate-keystore .............. Generate a keystore file
init ........................... Initialize jnlp plugin

[junit-report] ( 没有缺省的目标 )
report ......................... Generate a report from the test results

[latex] ( 没有缺省的目标 )
generate ....................... Generate documentation from latex source
prepare-filesystem ............. Prepare the filesystem for latex processing

[latka] Run the project's latka tests
jmeter-convert ................. Convert a jmeter jmx file to a latka suite
single ......................... Execute a single test defined using the '
testcase' variable
test ........................... Run the project's latka tests

[license] Generate an XML file from the license file
transfer ....................... Generate a xml file from your license file

[maven-ashkelon-plugin] ( 没有缺省的目标 )

[maven-changelog-plugin] ( 没有缺省的目标 )
report ......................... Generate a changelog report

[maven-changes-plugin] ( 没有缺省的目标 )

[maven-checkstyle-plugin] ( 没有缺省的目标 )

[maven-clover-plugin] ( 没有缺省的目标 )

[maven-cruisecontrol-plugin] ( 没有缺省的目标 )

[maven-dashboard-plugin] ( 没有缺省的目标 )

[maven-developer-activity-plugin] ( 没有缺省的目标 )
report ......................... Generate developer and file activity reports

[maven-faq-plugin] ( 没有缺省的目标 )
report ......................... Generate FAQs

[maven-file-activity-plugin] ( 没有缺省的目标 )
report ......................... Generate developer and file activity reports

[maven-javadoc-plugin] ( 没有缺省的目标 )
report ......................... Generate API documentation

[maven-jcoverage-plugin] ( 没有缺省的目标 )
deregister ..................... Deregister the jcoverage plugin
register ....................... Register the maven-jcoverage-plugin.
report ......................... Run the default report (html).

[maven-jdepend-plugin] ( 没有缺省的目标 )
report ......................... Generate a dependency report with JDepend

[maven-jdiff-plugin] ( 没有缺省的目标 )
report ......................... Generate an api difference report between
versions

[maven-jellydoc-plugin] ( 没有缺省的目标 )
report ......................... Generates the tag documentation

[maven-jira-plugin] ( 没有缺省的目标 )
report ......................... Generate report with all entries defined in
Jira

[maven-junit-report-plugin] ( 没有缺省的目标 )

[maven-jxr-plugin] ( 没有缺省的目标 )
report ......................... Generate HTML cross reference sources

[maven-license-plugin] ( 没有缺省的目标 )
report ......................... Generate an XML file from the license.txt

[maven-linkcheck-plugin] ( 没有缺省的目标 )
clearcache ..................... Removes the cache file
report-real .................... Generate link check results and then
transform to HTML

[maven-multichanges-plugin] ( 没有缺省的目标 )

[maven-multiproject-plugin] ( 没有缺省的目标 )

[maven-pmd-plugin] ( 没有缺省的目标 )

[maven-simian-plugin] Generate Simian (Code Similarity Analyzer)
report.

[maven-tasklist-plugin] ( 没有缺省的目标 )
report ......................... Generate a list of tasks from @todo tags in
your code

[multichanges] ( 没有缺省的目标 )

[multiproject] Run the site goal of all subprojects and
generate overview page
artifact ....................... Builds all artifacts for all subproject
clean .......................... Clean all subprojects
dependency-convergence-report .. Generate report which shows how consistent
are the versions of artitfacts between
projects
deploy ......................... Run 'artifact':deploy for all subprojects
deploy-snapshot ................ Run 'artifact':deploy-snapshot for all
subprojects
goal ........................... Run a given goal on all projects
install ........................ Run 'artifact':install for all subprojects
install-snapshot ............... Run 'artifact':install-snapshot for all
subprojects
site ........................... Run the site goal of all subprojects and
generate overview page

[native] Native compiler
compile ........................ Compile the native compiler
install ........................ Install the lib in the local repository
jniheader ...................... make jniheaders for classes

[nsis] Generate NSIS Installer .exe
generate-project ............... Generate NSIS project.nsh file
generate-setup ................. Generate NSIS .nsi file
installer ...................... Generate NSIS .exe file

[pdf] This is the default goal of the plugin and
simply pre-requisites the pdf:pdf goal.
pdf ............................ Generates a PDF document containing all
project documentation. The PDF is generated
from the .fo file generated in the fo:fo
goal.
prepare ........................ Stages all files needed to generate the PDF

[plugin] Build a plugin jar
download ....................... download and install a plugin from a remote
repo
download-artifact .............. download a plugin from a remote repo
generate-docs .................. Generate navigation, goals and properties
docs
generate-goals ................. Generate goals.xml for the plugin
generate-navigation ............ Generate navigation.xml for the plugin
generate-properties ............ Generate properties.xml for the plugin
install ........................ Install the plugin jar, prepare Maven to
expand it locally and clear caches
install-now .................... Build a plugin and load it into the
currently running instance of Maven.
plugin ......................... Build a plugin jar
uninstall ...................... Uninstall all versions of the plugin
uninstall-now .................. Uninstall all versions of the plugin,
including those in the currently running
instance of Maven

[pmd] Static Code Analyzer
cpd-report ..................... Generate duplicate source code report with
CPD
report ......................... Generate source code report with PMD

[pom] Validate the Maven XML project descriptor
contentvalidate ................ Validate the content of the Maven POM
deploy ......................... Deploy POM to the central repository.
deploy-snapshot ................ Deploys the snapshot version of the POM to
remote repository
install ........................ Install POM in the local repository.
install-snapshot ............... Install the snapshot version of the POM in
the local repository
validate ....................... Validate the Maven XML project descriptor

[rar] Build a rar file
deploy ......................... Deploys the rar to the remote repository
deploy-snapshot ................ Deploys the snapshot version of the rar to
remote repository
init ........................... Initialise filesystem and other resources
for a rar
install ........................ Install the rar in the local repository
install-snapshot ............... Install the snapshot version of the rar in
the local repository
load ........................... no-op goal
rar ............................ Build a rar file

[release] ( 没有缺省的目标 )

[repository] ( 没有缺省的目标 )
audit-copy-license ............. copy the license for the specified groupId
to the repository
audit-copy-licenses ............ copy all licenses in the audit file to the
repository
audit-create-directory ......... create the directory, specified by
directoryName, for all groups in the audit
file
audit-create-licenses .......... create the license directories, for all
groups in the audit file, in the repository
audit-generate-pom ............. generate a pom for the groupId provided,
based on the audit file
audit-generate-poms ............ generate a pom for all the groupId's in the
audit file
audit-rename-licenses .......... rename/link all licenses from their
original name to ${groupId}.license
copy-artifact .................. copy an artifact, specified by groupId,
artifact and type, to the repository
copy-jar ....................... copy a jar, specified by groupId and
artifact, to the repository
copy-snapshot-jar .............. copy a snapshot jar, specified by groupId
and artifact, to the repository
create-project ................. create a project, specified by groupId, in
the repository
delete-project ................. delete a project, specified by groupId, in
the repository

[scm] ( 没有缺省的目标 )
bootstrap-project .............. Bootstrap a project from SCM
checkout-project ............... Checkout a project
perform-release ................ Perform a release from SCM
prepare-release ................ Prepare for a release in SCM
update-project ................. Update a project from SCM

[shell] Generate Zsh files
zsh ............................ Generate Zsh files

[site] Generate the web site
deploy ......................... deploy the generated site docs
ear ............................ Create an EAR File from the generated site
fsdeploy ....................... Deploy the generated site by copying to the
site directory
ftpdeploy ...................... Deploy the generated site docs using ftp
sshdeploy ...................... Deploy the generated site docs using ssh
war ............................ Create a WAR File from the generated site

[struts] Ensure a war file containing a Struts
application is valid
validate-war ................... Ensure a war file containing a Struts
application is valid

[test] Test the application
compile ........................ Compile the TestCases and TestSuites
match .......................... Execute all the tests matching the given '
testmatch' variable
match-test ..................... [deprecated] please use the test:match goal
instead
prepare-filesystem ............. Create the needed directory structure
single ......................... Execute a single test defined using the '
testcase' variable
single-test .................... [deprecated] please use the test:single
goal instead
test ........................... Test the application
test-resources ................. Copy any resources that must be present for
run tests
ui ............................. Starts the Swing TestRunner front end

[tjdo] Enhance classes for use with Triactive JDO
drop-tables .................... Drops the tables managed by Triactive JDO.
enhance ........................ Provides the enhancement of classes to use
TJDO for persistence

[uberjar] Build a uberjar file
classworlds-conf ............... Generates a classworlds conf
deploy ......................... Deploys the uberjar to the remote repository
deploy-snapshot ................ Deploys the snapshot version of the
uberjar to remote repository
install ........................ Install the uberjar in the local repository
install-snapshot ............... Install the snapshot version of the uberjar
in the local repository
uberjar ........................ Build an uberjar

[war] Build a war file
clean .......................... Remove all artifacts created by war plugin
deploy ......................... Deploys the war to the remote repository
deploy-snapshot ................ Deploys the snapshot version of the war to
remote repository
inplace ........................ Deploy a webapp into maven.war.src - in
particular setting up WEB-INF/lib and
WEB-INF/classes
install ........................ Install the war in the local repository
install-snapshot ............... Install the snapshot version of the war in
the local repository
war ............................ Build a war file
war-resources .................. Copy webapp resources to target directory
webapp ......................... Build a webapp directory

[webserver] ( 没有缺省的目标 )
clean .......................... Safely delete an installed webserver
instance
cycle .......................... Forced install and start of a webserver
instance
init ........................... Initialize resources needed for the plugin
install ........................ Install a webserver instance
reinstall ...................... Reinstall a webserver instance
restart ........................ Restart a webserver instance
start .......................... Start a webserver instance
stop ........................... Stop a webserver instance

[wizard] ( 没有缺省的目标 )
ui ............................. Run the Maven Swing Wizard

[xdoc] Generate html project documentation xdoc
sources
copy-resources ................. copy static resources for use in xdocs
generated html
copy-user-resources ............ Copy user provided resources to docs
destination
generate-from-pom .............. Generates xdocs for site based on project
descriptor
init ........................... Generates the directory structure required
for xdocs
jelly-init ..................... Set up jelly xdoc requirements
jelly-transform ................ transform xdocs using jelly/jsl rather than
dvsl
performJSL ..................... Allows the LinkCheck plugin to xdoc a
single directory
transform ...................... Generate html project documentation xdoc
sources
validate ....................... Validate xdocs match the schema

今天开始学习Maven(专家,内行) Project Management Tools.

我现在挺厌烦用OpenSource的管理方面的工具的.包括CVS/ant等等,非常难用.基本上都不是 Ready for out Box.开箱即用的.
都要看大量的文档来牢记标记的语法.

可Groovy组里大家都在热烈的讨论Maven,this is too irritating.
我只好下载了maven 1.2 开始试用.免得被"边缘化"了.:).


简单翻译并记录中间看的资料吧.

1.首先下载.
http://maven.apache.org/
2.然后看帮助:
http://maven.apache.org/start/index.html
3.然后看如何使用:
http://maven.apache.org/start/use.html
在windowsXP下运行.
maven jar 和Maven site:generate
竟然连接到网络上下载了一堆的jar包,让我印象极坏.:(.
4.然后记录如何使用Maven来同Jbuilder和Jboss如何协作工作的经验了.

Very Large Scale Integration 超大规模集成Java实现

今天Sun公司网站上给出了一个用Java编写的电子CAD设计工具.
下载了看看了.

UI方面非常丑陋.不过竟然已经到了8.0了.看来用的人很多吧.
jar包下载的地址:http://ftp.gnu.org/pub/gnu/electric/

几天java.sun.co

星期三, 十二月 08, 2004

用JConsole来监控JVM

http://java.sun.com/developer/technicalArticles/J2SE/jconsole.html

星期六, 十二月 04, 2004

如何关闭最顶级IE窗口,避免提示确认的麻烦?

问题:如果非window.open打开的窗口用window.close();或self.close()关闭,由于安全理由.

IE会提示你确认是否关闭.在B/S应用中这是非常麻烦的,因为它可能改变导航的流程.

所以必须可以用javascript直接关掉.以下代码在IE6.0SP2上测试通过.

加红色的字是关键语句

<script>

function closeself()

{

opener='"';

}

</script>

<body onload="closeself()">

<h1>Welcome</h1><a href="javascript:window.close();">close</a>

<a href="javascript:opennew();">open</a>

<script>

function opennew(){

aw=window.open("2.html","aaa");

aw.opener=this;

}

</script>


星期四, 十二月 02, 2004

在MYSQL中如何得到group by对应最大值的哪条记录呢?

In ANSI SQL, I'd do it with a subquery like this:

SELECT article, dealer, price
FROM shop s1
WHERE price=(SELECT MAX(s2.price)
FROM shop s2
WHERE s1.article = s2.article);


在Mysql 4.1 以下的版本,不支持嵌套select的使用,所以你必须想别的的办法如下:
通过 "MAX-CONTACT 跳票"模式来实现.
SUBSTRING(MAX(CONTACT(Fileld_name_with_max_value,other FIled)),length(Fileld_name_with_max_value));
如此递归,则可以把包含最大值字段对应的记录的其他字段的值都读出来了.
一个实际的例子:
SELECT empid,substring(max(concat(effectivedate,paycatagorycode)),11) as paycatagorycode,max(effectivedate) as effectivedate,substring(max(concat(effectivedate,basicSalary)),11) as basicSalary, substring(max(concat(effectivedate,bankBranchCode)),11) as bankBranchCode, substring(max(concat(effectivedate,currencyCode)),11) as currencyCode, substring(max(concat(effectivedate,payCatagoryCode)),11) as payCatagoryCode,substring(max(concat(effectivedate,salaryPolicyType)),11) as salaryPolicyType,substring(max(concat(effectivedate,remarks)),11) as remarks FROM emp_M_SalaryBasicInfo group by empid

星期三, 十二月 01, 2004

如何制作Intel主板启动splash Screen

Keyword:USB Memory stick bootable,Bios Recovery,Intel 865PERL


建立USB 启动U盘及更新Intel BIOS Splash Screen 启动画面

我的主板是Intel 865PERL,以下以此主板为例。

由于Intel BIOS Splash Screen更新目前只能在DOS下进行,所以首先建立一个可以启动的DOS盘是必备条件.但目前很多机器支持USB启动,而没有安装软驱。所以要完成BIOS启动画面的更新有几种方法可以选择:
a. 光碟启动到DOS下.访问U盘,并更新BIOS
b. U盘直接启动,完成升级BIOS任务.
以下为如何制作从U盘启动升级BIOS启动画面的过程
1. 建立可启动U盘.
目前最好用的工具当属HP公司的HP USB Disk Storage Format Tool
据说Ghost 2003也可以制作U盘启动盘,没有用过,不确定.
下载: http://h18007.www1.hp.com/support/files/hpcpqdt/us/download/20306.html
用HP的工具来制作启动U盘,需要准备好DOS的几个启动文件
io.sys,command.com和msdos.sys几个文件
MSDOS的启动文件包可以从这里下载:
http://www.nu2.nu/bootdisk/network/

将U盘插上后,启动HP Format工具,并指定MSDOS文件存放的目录,就可以格式化U盘了,HP Format会自动检测文件是否齐全.这样就可以制作可启动的U盘了.
2. Enabled USB BOOT.
必须在CMOS中允许通过USB启动.Intel主板是按下F2进入BIOS设置.
这步完成后,可以测试一下U盘确实可以启动,然后再进行下面的步骤.

c. 下载Intel(R) Integrator Toolkit
http://www.intel.com/design/motherbd/itk.htm
1. Intel Iflash BIOS Update 下载
http://www.intel.com/design/motherbd/genbios.htm 选择你对应的Intel主板类型。不要选择错了!下载Iflash版本,不要下载Express版本.
下载的.exe文件可以用winrar打开.

sw.exe 是个包文件.P19-0085.ITK是Intel(R) Integrator Toolkit需要的文件
SW.EXE 包含我们需要的主板BIO文件P19-0085.BIO和更新BIOS的主要程序IFLASH.EXE文件。如图

2. 制作定制的包含新的启动屏幕BIOS
重要提示:首先准备一份BIOS恢复盘.将SW展开的文件全部复制到软盘上,如上图.
Intel(R) Integrator Toolkit 的具体操作可以参看所带的chm帮助,进入主界面后,找到定制启动屏幕的BIOS选项,如图:

选择Edit Module后,出现图形编辑界面,你可以选择你要作为splash screen的图片;
注意:经过实验Intel 865PERL支持4位(16色),8位(256色),24位(16M颜色)的格式图片,要注意的是不能使用压缩的图片.如果用BMP必须画笔保存为16/256/24位颜色的DIB格式的BMP图片.
如果用JPG必须要采用最佳质量的图片!用PS保存的JPG质量最佳图片,如果保留了调色板信息,最好用Acesee再保存一次,去掉有关调色板的信息.



图片的大小不要超过BIOS的空间,如果超出空间,在状态栏上会出现红色的提示.容量大小会超过100%.如果出现红色提示,必须缩减图片大小

然后在File菜单中生成ini文件和BIO文件,在从Tools菜单里选择Generate Media在指定的USB启动盘或软盘上生成更新所要的ini和BIO文件及启动的autoexec.bat文件.
重新启动机器,从USB或软盘引导就开始了更新,更新完成后,机器启动,然后在黑屏下可以听到
10声喇叭的声音.然后机器会关闭。拿出软盘或USB启动盘,
重新启动后,就可以看到新的启动屏幕了。
JPG 24色的图的大小远小于DIB格式的BMP图片,所以采用JPG是最优选择.

重要提示

如果更新的时候因为掉电等原因机器不能再启动,必须首先拔掉主板上BIOS设置的三脚的跳线把模式设置为Recovery Model,启动机器会从软盘引导,插入准备好的BIOS恢复软片,就可以恢复BIOS了.
这是我的主板BIOS启动画面,24位JPG,78K,我去掉了所有网卡启动的有关BIOS.




Javascript文件操作Exception

<script>
function writeData()
{
try
{
//alert(counterValue);
var dataFileObj = fsObj.createtextfile(DataFile, true);
dataFileObj.WriteLine(status);
dataFileObj.Close();
return(true);
}
catch (err)
{
return(false);
}

}

function init()
{
try
{
this.fsObj = new ActiveXObject('Scripting.FileSystemObject');
}
catch (err) {
msg="";
for(var i in err)msg=i+":"+err[i];
alert(msg);
}

if (this.fsObj != null)
{
if (!writeData())alert('写数据时候有错误发生');
}
}
</script>