Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

C# ¸ñʽ»¯Êä³öXML

ºÜ¶àʱºòÓÐÒ»¸öxml×Ö·û´®£¬Ã»Óл»ÐУ¬Ã»ÓÐËõ½ø£¬ÒªÉú³ÉxmlÎļþ²»Ò×ÔĶÁ¡£ÏÂÃæµÄ´úÂë¾ÍÊÇÔõô½«Ò»¸öÁ¬ÐøµÄxml×Ö·û´®¸ñʽ»¯Êä³ö
// a demo string
string xml = "<Root><Eles><Ele>abc</Ele><Ele>123</Ele></Eles></Root>";
System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
doc.LoadXml(xml);
System.IO.StringWriter sw = new System.IO.StringWriter();
using (System.Xml.XmlTextWriter writer = new System.Xml.XmlTextWriter(sw))
{
    writer.Indentation = 2;  // the Indentation
    writer.Formatting = System.Xml.Formatting.Indented;
    doc.WriteContentTo(writer);
    writer.Close();
}
// out put the formated xml
Console.WriteLine(sw.ToString());


Ïà¹ØÎĵµ£º

C#Á¬½ÓmysqlÊý¾Ý¿â

using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using MySql ......

½«Í¼Æ¬µÈÎļþ±£´æµ½sqliteÖУ¨c#£©

 SqLite.netµÄdllΪSystem.Data.SQLite.dll£¬ÕâÖÖdll·ÖΪ32λ¡¢64λºÍÊÊÓÃÓÚcompactframeworkÈýÖÖ£¬ÔÚÒýÓÃʱҪעÒ⣬ѡÔñÕýÈ·µÄdll¡£
½«Òª±£´æÍ¼Æ¬µÄ×Ö¶ÎÀàÐÍÉèΪblob¡£´úÂëÈçÏ£º
private void savePicture£¨£©
{
using (SQLiteConnection cnn = new SQLiteConnection(dbPath))
......

C#ÖÐ¶Ô XML½Úµã½øÐÐÔö¡¢É¾¡¢¸Ä¡¢²é

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml;
namespace WebApplication2
{
    /// <summary>
    /// XMLHelper XMLÎĵµ²Ù×÷¹ÜÀíÆ÷
  &nb ......

C# ͨ¹ýxslת»»´óxmlÎļþ·½·¨

ͨ¹ýxslת»»´óxmlÎļþ
Õ⼸ÌìÔÚ×öÕâ¸ö£¬ÍøÉϵö·½·¨ÎÒ¶¼ÊÔ¹ýÁË£¬»ã×ÜÈçÏÂ
·½·¨Ò»£º
XPathDocument myXPathDoc = new XPathDocument(tbXMLFile.Text);
 
XslCompiledTransform myXslTrans = new XslCompiledTransform();
myXslTrans.Load(tbXSLFile.Text);
 
XmlTextWriter myWriter = new XmlTextWrit ......

ÓÃC#´´½¨XML[¼òµ¥´úÂë]

XmlDocument doc = new XmlDocument();
XmlDeclaration dec = doc.CreateXmlDeclaration("1.0", "GB2312", null);
doc.AppendChild(dec);
//´´½¨Ò»¸ö¸ù½Úµã£¨Ò»¼¶£©
XmlElement root = doc.CreateElement("First");
doc.AppendChild(root);
//´´½¨½Úµã£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ