¸ü¿ìµÄдXMLµÄ·½·¨
ÎÒдµÄµÚÒ»¸ö³ÌÐòÖÐдXMLµÄ´úÂëÖ´ÐÐËÙ¶ÈÓÐЩÎÊÌ⣬¸ÄÁËһϣ¬ÏÖÔÚÓÐËù¸ÄÉÆ¡£
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Data.SqlClient;
using System.Xml;
using System.IO;
using System.Collections;
using System.Threading;
namespace StockUpService
{
public partial class StockUpService : ServiceBase
{
public StockUpService()
{
InitializeComponent();
if (!System.Diagnostics.EventLog.SourceExists("MySource"))
{
System.Diagnostics.EventLog.CreateEventSource(
"MySource", "MyNewLog");
}
eventLog1.Source = "MySource";
eventLog1.Log = "MyNewLog";
}
protected override void OnStart(string[] args)
{
System.Timers.Timer t = new System.Timers.Timer(20000); //ʵÀý»¯TimerÀ࣬ÉèÖüä¸ôʱ¼äΪ20000ºÁÃë|20ÃëÖ´ÐÐÒ»´Î£»
t.Elapsed += new System.Timers.ElapsedEventHandler(runservice); //µ½´ïʱ¼äµÄʱºòÖ´ÐÐʼþ£»
t.AutoReset = true; //ÉèÖÃÊÇÖ´ÐÐÒ»´Î£¨false£©»¹ÊÇÒ»Ö±Ö´ÐÐ(true)£»
t.Enabled = true; //ÊÇ·ñÖ´ÐÐSystem.Timers.Timer.Elapsedʼþ£»
}
public void runservice(object source, System.Timers.ElapsedEventArgs e)
{
string t;
t = System.DateTime.Now.Hour.ToString()+System.DateTime.Now.Minute.ToString();
if (t == "933")
{
readXml();
}
}
public static void readXml()
{
string classId="";
string filialeId;
string startTime;
string endTime;
string companyType;
string xmlChildNodes = "";
Ïà¹ØÎĵµ£º
using System;
using System.Data;
using System.Drawing;
using System.Globalization;
using System.IO;
using System.Windows.Forms;
using Excel = Microsoft.Office.Interop.Excel;
// Ìí¼ÓÒýÓÃ -> .NET -> Microsoft.Office.Interop.Excel(2003->11.0, 2007->12.0)
namespace WinFormTable
{
& ......
Ê×ÏÈÎÒÃǸø³öÒ»¶ÎʾÀý³ÌÐò£º
import
java.io.File;
import
java.io.FileWriter;
import
java.util.Iterator;
import
org.dom4j.Document;
import
org.dom4j.DocumentHelper;
import
org.dom4j.Element;
import
org.dom4j.io.OutputFormat;
import
org.dom ......
ÔÎÄ:ʹÓà MSXML ·ÖÎöÆ÷´¦Àí XML Îĵµ
#include <atlbase.h>
#include <iostream>
using namespace std;
//<?xml version="1.0"?>
//<xmldata>
//<xmlnode />
//<xmltext>Hello, World!</xmltext>
//</xmldata>
void main ......
XMLÊÇÒ»ÏîÈÈÃŵļ¼Êõ¡£ËüÖ®ËùÒÔÄܹ»ÒýÆðÈËÃǵÄÐËȤ£¬Ò»¸öÖ÷ÒªµÄÔÒòÔÚÓÚËüÊ®·ÖµÄ¼òµ¥£¬ÈËÃÇ¿ÉÒÔºÜÈÝÒ×µØÀí½âºÍʹÓÃËü¡£Ã¿Ò»¸ö³ÌÐòÔ±¶¼ÄÜÇáÒ׵ؿ´¶®Ò»¸öXMLÎļþ£¬Àí½âËü°üº¬µÄÄÚÈÝ¡£
.NETÖаüº¬Á˺ܶàÖ§³ÖXMLµÄÀ࣬ÕâЩÀàʹµÃ³ÌÐòԱʹÓÃXML±à³Ì¾ÍÈçͬÀí½âXMLÎļþÒ»Ñù¼òµ¥¡£ÔÚÕâÆªÎÄÕÂÖУ¬ÎÒ½«¸ø³öÕâÑùµÄÒ»¸öÀàµÄʹÓÃʾÀý£¬Õ ......
1.¶ÁÈ¡XMLÎļþµÄÀࣺ
public class XMLUtils {
private final String DB_XML_FILE = "/XMLSetting.xml";
public Properties getPropertiesfromXML() {
URL url = XMLUtils.class.getResource(dBXMLFILE);
URI uri;
try {
uri = url.toURI();
InputSource xmlfile = new InputSource(uri.g ......