我想解析XML文件并读取所有InnerText并将其保存在DB中

我想解析XML文件并读取所有InnerText并将其保存在DB中

本文介绍了我想解析XML文件并读取所有InnerText并将其保存在DB中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<?xml version="1.0" encoding="utf-8"?>
<Event>
  <System xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
    <Provider Name="User32" Guid="{b0aa8734-56f7-41cc-b2f4-de228e98b946}" EventSourceName="User32" />
    <EventID Qualifiers="32768">1074</EventID>
    <Version>0</Version>
    <Level>4</Level>
    <Task>0</Task>
    <Opcode>0</Opcode>
    <Keywords>0x8080000000000000</Keywords>
    <TimeCreated SystemTime="2014-01-23T06:53:03.860676800Z" />
    <EventRecordID>2555</EventRecordID>
    <Correlation />
    <Execution ProcessID="544" ThreadID="596" />
    <Channel>System</Channel>
    <Computer>Rupesh</Computer>
    <Security UserID="S-1-5-21-4087883770-4115454469-2954625715-1001" />
  </System>
  <EventData xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
    <Data Name="param1">C:\Windows\System32\shutdown.exe (RUPESH)</Data>
    <Data Name="param2">RUPESH</Data>
    <Data Name="param3">No title for this reason could be found</Data>
    <Data Name="param4">0x800000ff</Data>
    <Data Name="param5">restart</Data>
    <Data Name="param6">To make the changes effective, restarting in 10 secs.Please save your work!!</Data>
    <Data Name="param7">RUPESH\PIV</Data>
  </EventData>
  <System xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
    <Provider Name="User32" Guid="{b0aa8734-56f7-41cc-b2f4-de228e98b946}" EventSourceName="User32" />
    <EventID Qualifiers="32768">1074</EventID>
    <Version>0</Version>
    <Level>4</Level>
    <Task>0</Task>
    <Opcode>0</Opcode>
    <Keywords>0x8080000000000000</Keywords>
    <TimeCreated SystemTime="2014-01-25T08:00:14.475637000Z" />
    <EventRecordID>2944</EventRecordID>
    <Correlation />
    <Execution ProcessID="532" ThreadID="624" />
    <Channel>System</Channel>
    <Computer>Rupesh</Computer>
    <Security UserID="S-1-5-21-4087883770-4115454469-2954625715-1001" />
  </System>
  <EventData xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
    <Data Name="param1">C:\Windows\System32\shutdown.exe (RUPESH)</Data>
    <Data Name="param2">RUPESH</Data>
    <Data Name="param3">No title for this reason could be found</Data>
    <Data Name="param4">0x800000ff</Data>
    <Data Name="param5">restart</Data>
    <Data Name="param6">To make the changes effective, restarting in 10 secs.Please save your work!!</Data>
    <Data Name="param7">RUPESH\PIV</Data>
  </EventData>
</Event>

推荐答案


这篇关于我想解析XML文件并读取所有InnerText并将其保存在DB中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-19 06:21