¹ØÓÚXML½âÎö û˼·ÁË ¾ÈÃü
XML code:
<?xml version="1.0" encoding="utf-8"?>
<root>
<line lineCode="1" lineName="test" speed="45" direct="1">
<road lineInCode="1" roadCode="253" roadName="н¨Â·¿Ú253" sectionLong="0" opCycle="1800" splitCoordPhase="1"
splitStageTable="1" phaseDiff="2" periodTable="1" period="1">
<stages number="4">
<stage stageCode="1" stageGreen="25" minGreen="15" maxGreen="32" yellow="3" redClear="0" phases="1,3,9,10,11,12"/>
<stage stageCode="2" stageGreen="17" minGreen="12" maxGreen="28" yellow="3" redClear="0" phases="2,4"/>
<stage stageCode="3" stageGreen="22" minGreen="12" maxGreen="32" yellow="3" redClear="0" phases="5,7,13,14,15,16"/>
<stage stageCode="4" stageGreen="18" minGreen="12" maxGreen="25" yellow="3" redClear="0" phases="6,8"/>
</stages>
</road>
<road lineInCode=&quo
Ïà¹ØÎÊ´ð£º
txt ºÍXML ¸ñʽÏàÓ¦
²»½èÖúDataSet
µ¼Èë¶ÁÈ¡TXTÎļþ
È»ºóÖ±½ÓдÈëXML(ͬһÎļþ,²»Í¬Êý¾Ý,µÝÔöÔÊý¾ÝûÓб»¸²¸ÇÇé¿öÏÂÔö¼ÓÊý¾Ý.)
½Ì¸öÒªµã»ò×îºÃÊÇÓиö´úÂëÌáʾµÄ
¹ý·ºÃºº °ï¸öæÈö^^
²»»á£¬°ïÂ¥Ö÷ ......
Private Sub Command1_Click()
Dim MyString() As String
Open "a.xml" For Binary As #1 ' ´ò¿ª¸Õ´´½¨µÄÎļþ¡£
ReDim MyString(LOF(1) - 1)
Put #1, , MyRecord ' ¶ÁÈëËùÓÐ×Ö·ûµ½±äÁ¿ÖÐ ......
ÏÖÔÚÓиöxmlÎļþÊÇ<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xm ......
ΪʲôÎҵijÌÐòµ÷ÓÃXMLÅäÖÃÎļþÖеİ¢À²®ÎÄÏÔʾ²»³öÀ´£¿ÆäËûµÄÓïÖÖ¶¼¿ÉÒÔ£¬ÈçÖÐÎÄ£¬Ó¢ÎÄ£¬µÂÎͼ¿É¡£
ÎÒ½«XMLµÄ±àÂë¸ÄΪutf-8ºÍunicodeµÄµ½µÃ½á¹û¶¼Ò»Ñù.
°¢À²®ÎĵÄ×Ö¿âÄãÓÐô£¿
ÓÐ,ÎÒµÄEXEÊÇ·ÅÔÚpc»úÉÏÖ´Ðе ......
ÎÒÒªÔÚÍøÒ³ÉÏÉÏ´«Ò»¸öXMLÎļþ£¬ÎÒÔÚC#ÖÐдÁËÒ»¸öÑéÖ¤XMLÎļþ¸ñʽµÄ·½·¨£º
private bool ValidateXml(string xmlFilePath)
{
string xsdPath = Request.PhysicalApp ......