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;
Ïà¹ØÎĵµ£º
×Ô¼º×öÏîÄ¿ÐèÒªÓÃÖÇÄܿͻ§¶Ë·¢²¼£¬ÎÒÓöµ½Á˸öÎÊÌâ¾ÍÊdzÌÐòÖеÄxmlÎļþÔÚ·¢²¼ºóÕÒ²»µ½ÁË¡£¾¹ýÔÚÍøÉϲéѯºÍ×Ô¼ºµÄÊÔÑé·¢ÏÖÕâÁ½¸ö·½·¨¶¼¿ÉÒÔ½â¾öÕâ¸öÎÊÌâ¡£
·½·¨1
ÓÒ¼üwinUIÏîÄ¿£¬·¢²¼-¡µÓ¦ÓóÌÐòÎļþ....->Ñ¡ÔñxmlÎļþ-¡µ·¢²¼×´Ì¬¸ÄΪ“Êý¾ÝÎļþ(×Ô¶¯)”
&nb ......
<!-- xml ¸ñʽ
<books>
<book id='1001'>
<author>andylin</author>
<title>c language</title>
<publisher id="aaa">O'Reilly</publisher>
</book>
<book id='1002'>
<author>congfeng</author>
<t ......
public static Hashtable xml_unserialize(string strXml)
{
//¼ÓÉÏÏÂÃæÕâ¾ä¾ÍºÃÁË
strXml = strXml.Replace("&", "&");
Hashtable ht = new Hashtable();
XmlDocument XMLDom = new XmlDocument();
......
ASP.NETÖ®XML£ºÒª²åÈëµÄ½Úµã³ö×Ô²»Í¬µÄÎĵµÉÏÏÂÎÄ
Òª²åÈëµÄ½Úµã³ö×Ô²»Í¬µÄÎĵµÉÏÏÂÎÄ
ʱ¼ä£º2009-06-12 08:15:11
Òì³£ÏêϸÐÅÏ¢: System.ArgumentException: Òª²åÈëµÄ½Úµã³ö×Ô²»Í¬µÄÎĵµÉÏÏÂÎÄ¡£
²úÉú×´¿ö£ºÏÖÔÚÓÐÁ½¸öxmlÎļþ£¬ÎÒÏë°ÑÕâÁ½¸öxmlºÏ²¢£¬ÔÚ¸øxml½Úµã²åÈëÒ»¸ö×Ó½Úµãʱ³öÏÖÁËÕâÑùµÄ´ ......
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" & ......