.net ³ÌÐò·¢²¼ºóxmlÎļþÕÒ²»µ½µÄÁ½ÖÖ½â¾ö·½·¨
×Ô¼º×öÏîÄ¿ÐèÒªÓÃÖÇÄÜ¿Í»§¶Ë·¢²¼£¬ÎÒÓöµ½Á˸öÎÊÌâ¾ÍÊdzÌÐòÖеÄxmlÎļþÔÚ·¢²¼ºóÕÒ²»µ½ÁË¡£¾¹ýÔÚÍøÉϲéѯºÍ×Ô¼ºµÄÊÔÑé·¢ÏÖÕâÁ½¸ö·½·¨¶¼¿ÉÒÔ½â¾öÕâ¸öÎÊÌâ¡£
·½·¨1
ÓÒ¼üwinUIÏîÄ¿£¬·¢²¼-¡µÓ¦ÓóÌÐòÎļþ....->Ñ¡ÔñxmlÎļþ-¡µ·¢²¼×´Ì¬¸ÄΪ“Êý¾ÝÎļþ(×Ô¶¯)”
ÔÚ³ÌÐòÀïÈ¡xml·¾¶µÄд·¨
file = Application.CommonAppDataPath+@"\text\text.xml"£»
Õâ¸ö·½·¨ÓиöÎÊÌâ¾ÍÊÇÔÚµ÷ÊÔ»·¾³Ï²»ÄÜÈ¡µ½ÕýÈ·µÄ·¾¶£¬Ö»Óз¢²¼µÄʱºòÈ¡µÄ·¾¶¶Ô¡£
·½·¨2
ÓÒ¼üwinUIÏîÄ¿£¬·¢²¼-¡µÓ¦ÓóÌÐòÎļþ....->Ñ¡ÔñxmlÎļþ-¡µ·¢²¼×´Ì¬¸ÄΪ“°üÀ¨”
ÔÚ³ÌÐòÀïÈ¡xml·¾¶µÄд·¨
file = System.AppDomain.CurrentDomain.BaseDirectory + @"\text\text.xml"£»
Õâ¸ö·½·¨µ÷ÊԺͷ¢²¼È¡µ½µÄ·¾¶¶¼ÊǶԵġ£
Ïà¹ØÎĵµ£º
À©Õ¹±ê¼ÇÓïÑÔXML£¨eXtensible Markup Language£©£¬ÊÇÓÉW3C×éÖ¯Öƶ¨µÄ¡£×öΪÓÃÓÚÌæ´úHTMLÓïÑÔµÄÒ»ÖÖÐÂÐ͵ıê¼ÇÓïÑÔ£¬XMLÄÚ²¿ÓÐןܶà»ù±¾±ê×¼£¬XML¾ÍÊÇͨ¹ýÓëÕâЩÏà¹Ø±ê×¼µØ½áºÏ£¬Ó¦ÓÃÓÚ¿Æѧ¼ÆËã¡¢µç×Ó³ö°æ¡¢¶àýÌåÖÆ×÷ºÍµç×ÓÉÌÎñµÄ¡£C££×÷ΪһÖÖÐÂÐ͵ijÌÐòÓïÑÔ£¬ÊÇ.Net¿ò¼ÜµÄÒ»¸öÖØÒª×é³É²¿·Ö£¬ËûºÍXMLµÄ¹ØϵÆÄÉî¡£±¾ÎÄ¾Í´Ó ......
/*
* Ö÷Òª×÷ÓÃ;
* ´Óxml¶ÁÈ¡ÓÎÏ·ÅäÖÃÐÅÏ¢»ò±£´æ
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Forms;
using System.IO;
using System.Xml;
using System.Reflection;
namespace Game
{
class Config
{
Ke ......
Ò»¡¢±£´æµ½XMLÎļþ
//µÃµ½Óû§ÒªÉÏ´«µÄÎļþÃû
string strFilePathName = loFile.PostedFile.FileName;
string strFileName = Path.GetFileName(strFilePathName);
int FileLength = loFile.PostedFile.ContentLength;
if(FileLength<=0)
return; ......
--XQuery »ùÓÚÏÖÓÐµÄ XPath ²éѯÓïÑÔ£¬²¢Ö§³Ö¸üºÃµÄµü´ú¡¢¸üºÃµÄÅÅÐò½á¹ûÒÔ¼°¹¹Ôì±ØÐèµÄ XML µÄ¹¦ÄÜ¡£
--1.ÉùÃ÷Ò»¸ö xml ÀàÐ͵ıäÁ¿£¬È»ºóʹÓà xml Êý¾ÝÀàÐ굀 query() ·½·¨À´²éѯ´Ë±äÁ¿
DECLARE @x xml
SET @x = '<ROOT><a>111</a></ROOT>'
SELECT @x.query('/ROOT/a')
--²éÕÒÊôÐÔaid=20µÄa½ ......
Ò»°ãÐÂÊÖͨ³£Ö»ÊÇʹÓÃÀàËƵÄXerces,
TinyXMLÖ®ÀàµÄXML½âÎöxml£¬ÕâÖÖ·½Ê½Êµ¼ÊÉϺÜÀË·Ñʱ¼ä£¬×Ô¼º±àдºÜ¶à´úÂëÒ²ÈÝÒ׳ö´í¡£ÒòΪ£¬ËûÃǾ³£ÒªÐ´Ò»¸öXML¶ÔÏóEntityµÄÀ࣬²¢¸½×ÅÒ»¶Ñ¶ÔÏó½âÎöµÄcode¡£¹¤×÷Á¿±È½Ï´ó¡£Ê¹ÓÃXML
Schema¹¤¾ß£¬XSDÉè¼Æ¹¤¾ß£¬È»ºóͨ¹ý¹¤¾ßÉú³ÉEntityClassºÍPaser
class¡£ÎÒ²»ÖªµÀÕâÖÖ¼¼ÊõÈ·ÇеÄÆðÔ ......