Delphi²Ù×÷XMLµÄ¼¼ÇÉ
Delphi²Ù×÷XMLÊǺܷ½±ãµÄ£¬Ö÷ÒªÓÐÁ½ÖÖ·½·¨£»
1.ÓÃTClientDataSet²Ù×÷XML£»TClientDataSetÊǸöºÃ¶«Î÷£¬ÓÃËü²Ù×÷XMLÊǺܼòµ¥µÄÊ£¬²»¹ýȱµãÊÇÖ»ÄܲÙ×÷¹Ì¶¨¸ñʽµÄ XML£¬ËüÊʺϲÙ×÷±í½á¹¹µÄÊý¾Ý£¬Èç¹ûÄãÐèÒª°ÑÊý¾Ý±íµ¼³ö³ÉXMLÄÇÓÃTClientDataSetÊǸöºÃÖ÷Ò⣬±ÈÈçÏÂÃæÊÇÒ»¸öÊý¾Ý¼¯µ¼³ö³ÉXMLµÄ·½ ·¨£º
procedure ExportToXML(SrcDataSet:TDataSet;const XMLFileName:String);
var tmpCds:TClientDataSet;
i:integer;
NewField:TFieldDef;
begin
SrcDataSet.DisableControls;
tmpCds:=TClientDataSet.Create(nil);
try
for i:=0 to SrcDataSet.FieldCount-1 do
begin
NewField:=tmpCds.FieldDefs.AddFieldDef;
NewField.Name:=SrcDataSet.Fields[i].FieldName;
NewField.DataType:=SrcDataSet.fields[i].DataType;
NewField.Size:=SrcDataSet.Fields[i].Size;
end;
tmpCds.CreateDataSet;
if tmpCds.Active then tmpCds.LogChanges:=False;
SrcDataSet.First;
while not SrcDataSet.Eof do
begin
tmpCds.Append;
for i:=0 to SrcDataSet.FieldCount-1 do
tmpCds.FieldByName(SrcDataSet.Fields[i].FieldName).Value:=SrcDataSet.Fields[i].Value;
tmpCds.Post;
SrcDataSet.Next;
end;
tmpCds.SaveToFile(XMLFileName);
finally
SrcDataSet.EnableControls;
tmpCds.Free;
end;
end;
2.»¹ÓÐÒ»ÖÖ·½·¨¾ÍÊÇÓÃTXMLDocumentÁË£¬TXMLDocumentºÜÁé»î£¬Òò´Ë²Ù×÷ÆðÀ´ÓеãÂé·³£¬ÌرðÊÇXMLÊ÷ºÜÉîµÄʱºò¡£²»¹ý Delphi¸øÎÒÃÇÌṩÁ˸ü·½±ãµÄ·½·¨£¬Ê¹ÎÒÃǸü¼Ó¼òµ¥µÄ²Ù×÷XML£¬Õâ¸ö·½·¨¾ÍÊÇXML Data BindingÏòµ¼£¬XML Data BindingÏòµ¼»á°ÑXMLµÄ½ÚµãÓ³Éä³É¶ÔÏ󣬴ӶøʹÎÒÃǸü·½±ãµÄ²Ù×÷ËüÃÇ¡£ÏÂÃæÊÇÒ»¸öXML Da
Ïà¹ØÎĵµ£º
º¯ÊýÒ»£º
view plaincopy to clipboardprint?
uses
Windows,
SysUtils,
Classes,
ShellAPI;
function RunAndWait(FileName: string; Visibility: Integer): THandle;&nbs ......
DELPHIÖвÙ×÷ACCESSÊý¾Ý¿â(½¨Á¢.mdbÎļþ,ѹËõÊý¾Ý¿â)
ÒÔÏ´úÂëÔÚWIN2K,D6,MDAC2.6ϲâÊÔͨ¹ý,
±àÒëºÃµÄ³ÌÐòÔÚWIN98µÚ¶þ°æÎÞACCESS»·¾³ÏÂÔËÐгɹ¦.
//ÉùÃ÷Á¬½Ó×Ö·û´®
Const
SConnectionString
= 'Provider=M ......
¸ù¾ÝDelphiÌṩµÄÓÐ¹Ø DLL±àдºÍµ÷ÓõİïÖúÐÅÏ¢£¬Äã¿ÉÒԺܿìÍê³ÉÒ»°ãµÄ DLL±àдºÍµ÷ÓÃµÄ Ó¦ÓóÌÐò¡£±¾ÎĽéÉܵÄÖ÷ÌâÊÇÈçºÎ±àдºÍµ÷ÓÃÄܹ»´«µÝ¸÷ÖÖ²ÎÊý£¨°üÀ¨¶ÔÏóʵÀý£©µÄ DLL¡£ÀýÈ磬 Ö÷½Ð³ÌÐò´«µÝ¸ø DLLÒ»¸öADOConnection ¶ÔÏóʾÀý×÷Ϊ²ÎÊý£¬ DLLÖеĺ¯ÊýºÍ¹ý³Ìµ÷ÓÃͨ¹ý¸Ã¶ÔÏó ʵÀý·ÃÎÊÊý¾Ý¿â¡£
ÐèÒªÃ÷ȷһЩ»ù±¾¸ÅÄî¡£¶ÔÓ ......
uses WinInet;
procedure TForm1.Button1Click(Sender: TObject);
begin
if InternetGetConnectedState(nil, 0) then
ShowMessage('ÒÑÁ¬½Ó')
else
ShowMessage('ÒѶϿª');
end; ......
ÔÚȺÀï¿´µ½ÓÐÈË·¢Á˸ö±ðÈË·¢¸øËûµÄ
ÎÒ¿´ÁËдµÄ±È½ÏÉú¶¯ ÔÚÕâת¸ø´ó¼Ò¿´¿´
ºÃµÄ Ê°È¡ÎïÌ庯ÊýдºÃÁË Ï²½ÊÇÈçºÎ½«´úÂë×¢Èëµ½ÓÎÏ·½ø³ÌÖÐÖ´ÐÐ??
1) С͵¿ªÃÅ
PHND:= OpenProcess (PROCESS_ALL_ACCESS, False, PID);µÃµ½ÓÎÏ·´°¿Ú¾ä±ú»ñµÃȨÏÞ
2)С͵ÔÚ·¿¼ä¸ã¸ö·Å×÷°¸·½°¸µÄµØ·½
TAdd := VirtualAllocEx(PHND, nil, 4096, ......