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

java读取windows系统日志文件,并在页面显示--光天化日跪求
光天化日,跪求。我的工作就看高手的出手了。我没学过这种技术

windows系统日志的地址存在 项目的address.properties配置里面address1=C:\WINDOWS\system32\config\AppEvent.Evt
address2=C:\WINDOWS\System32\config\SecEvent.Evt
address3=C:\WINDOWS\system32\config\SysEvent.Evt


java读取windows系统日志(上面3个)文件,并在页面显示(不要进数据库)
要求显示在jsp页面后,可以有右键功能(每条都可以删除和查询信息)


------解决方案--------------------
直接是读不出 .evt文件内容的,都是乱码。 有个工具包叫 log parser 的工具,去看看如何用的。
------解决方案--------------------
在xml配置文件中,导入address.properities文件
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="ignoreResourceNotFound" value="true"/>
<property name="locations">
<list>
<value>/WEB-INF/address.properties</value>
</list>
</property>
</bean>
<bean id="proxyName" class="xxx.xxx.xxx.ProxyClass">
<value>${address1}</value>
</bean>
再到ProxyClass类中进行解析