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

delphi Éú³Éxml ·½·¨ Óë delphi txtÎļþ²Ù×÷

Procedure TForm1.Button1Click(Sender: TObject);
Var
xmlstr,FileName: String;
f: Textfile;
Begin
xmlStr := '<?xml version="1.0" encoding="gb2312"?>';
xmlstr := xmlstr + '<user><name>ÕÅÈý</name><sex>ÄÐ</sex></user>';
showmessage(xmlstr);
FileName:='a.xml';
If fileExists(FileName) Then DeleteFile(FileName); {¿´ÎļþÊÇ·ñ´æÔÚ,ÔÚ¾Í刪³ý}
AssignFile(F, FileName); {½«ÎļþÃûÓë±äÁ¿ F ¹ØÁª}
ReWrite(F); {´´½¨Ò»¸öеÄÎļþ²¢ÃüÃûΪ ek.txt}
Writeln(F, xmlstr);
Closefile(F); {¹Ø±ÕÎļþ F}
End;
Procedure NewTxt(FileName:String);
Var
F : Textfile;
Begin
if fileExists(FileName) then DeleteFile(FileName); {¿´ÎļþÊÇ·ñ´æÔÚ,ÔÚ¾Í刪³ý}
AssignFile(F, FileName); {½«ÎļþÃûÓë±äÁ¿ F ¹ØÁª}
ReWrite(F); {´´½¨Ò»¸öеÄÎļþ²¢ÃüÃûΪ ek.txt}
Writeln(F, '½«ÄúҪдÈëµÄÎı¾Ð´Èëµ½Ò»¸ö .txt Îļþ');
Closefile(F); {¹Ø±ÕÎļþ F}
End;
Procedure OpenTxt(FileName:String);
Var
F : Textfile;
Begin
AssignFile(F,FileName); {½«ÎļþÃûÓë±äÁ¿ F ¹ØÁª}
Append(F); {ÒԱ༭·½Ê½´ò¿ªÎļþ F }
Writeln(F, '½«ÄúҪдÈëµÄÎı¾Ð´Èëµ½Ò»¸ö .txt Îļþ');
Closefile(F); {¹Ø±ÕÎļþ F}
End;
Procedure ReadTxt(FileName:String);
Var
F : Textfile;
str : String;
Begin
AssignFile(F, FileName); {½«ÎļþÃûÓë±äÁ¿ F ¹ØÁª}
Reset(F); {´ò¿ª²¢¶ÁÈ¡Îļþ F }
Readln(F, str);
ShowMessage('ÎļþÓÐ:' +str + 'ÐС£');
Closefile(F); {¹Ø±ÕÎļþ F}
End;
Procedure AppendTxt(Str:String;FileName:String);
Var
F:Textfile;
Begin
AssignFile(F, FileName);
Append(F);
Writeln(F, Str);
Closefile(F);
End;


Ïà¹ØÎĵµ£º

C#ÐòÁл¯xmlµÄÍêÕûÀý×Ó

C#ÐòÁл¯xml
¹Ø¼ü²½Ö裺
XmlSerializer xSerializer = new XmlSerializer(typeof(MyObj));
StringWriter sWriter = new StringWriter(CultureInfo.InvariantCulture);
XmlTextWriter xTextWriter = new XmlTextWriter(sWriter);
......

DTD£¬XML SchemaºÍRelax NGµÄ±È½Ï¼°Ï໥ת»¯£¡

±È½Ï£º
1. DTD
a. ×îÔçµÄXML Contraint
b. ÓÉW3C¶¨Òå
C. ·Ç³£¼òµ¥
2. XML Schema
a. ĿǰӦÓÃ×î¹ãµÄXML Contraint
b. ÓÉW3C¶¨Òå
c. ºÜÁé»î£¬µ«·Ç³£¸´ÔÓ
3. Relax NG
a. ÊǸöÒ°º¢×Ó£¬²»ÊÇÓÉW3C¶¨Òå
b. ·Ç³£·Ç³£¼òµ¥Ö±¹Û
c. ¶ÔÓÚÐèҪƵ·±¶¨ÒåContraintµÄEngineer·Ç³£ºÏÊÊ
Ï໥ת»¯£º
1. XML Document -> DTD ......

C#ÖжÔXML½Úµã½øÐÐÔöɾ¸Ä²é

ºÅ³ÆxmlhelperµÄÒ»¸öÀà
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml;
namespace WebApplication2
{
/// <summary>
/// XMLHelper XMLÎĵµ²Ù×÷¹ÜÀíÆ÷
/// </summary>
public class XMLHelper
{
public X ......

ʹÓÃXMLÔÚSQL ServerÉÏ´´½¨¼ÆËãÁÐ

¡¡ÔÚSQL ServerÊý¾Ý¿âÖУ¬µ±ÄãÏëʹÓÃÒ»¸öÊý¾Ý£¬¶øÕâ¸öÊý¾Ý²»±£´æÔÚ±íÖУ¬¼ÆËãÁкÜÓÐÓá£ÀýÈ磬ÄãÓÐÒ»ÕÅ±í£¬Ëü°üÀ¨ÁÐdollar amounts, wholesale pricesºÍretail prices¡£Äã¿Ï¶¨²»ÏëÔÚÿ´Î²éѯ±íʱÀ´¼ÆËãÄÇÁ½ÁÐÖ®¼äµÄ²îÖµ£¬ÄãÏ£Íû½«ÆäÖµ±£´æÔÚµÚÈýÁÐÖУ¬ÈÃÆä×Ô¶¯¼ÆËãǰÁ½ÁÐÖ®¼äµÄ²îÖµ¡£¶ø´ËÁоÍÊǼÆËãÁС£
¡¡¡¡ÔÚSQL ServerÖ ......

delphi ±àдµÄcom ¶ÔÏó ÓÃphpµ÷ÓõÄʵÀý

delphi ±àдµÄcom ¶ÔÏó ÓÃphpµ÷ÓÃ
µÄ
ʵÀý
delphi:
function Tmyxml.Get_xml: WideString;
begin
      Get_xml:='wo shi a lei!';
end;
function Tmyxml.Get_xmldata: WideString;
var
xmlStr:string;
begin
  xmlStr := '<?xml   version="1.0" & ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ