);
end;
procedure TForm1.Button4Click(Sender: TObject);
begin
FXMLOption.CloseXml;
WebBrowser1.Navigate(''about:blank'');
end;
procedure TForm1.Button5Click(Sender: TObject);
begin
if FXMLOption.FindUser(edit2.text) then label1.Caption:=''true''
else label1.Caption:=''false'';
end;
procedure TForm1.Button6Click(Sender: TObject);
var
auser:RecUser;
begin
auser.U_Id:=edit2.Text;
auser.U_Name:=''peter'';
auser.U_Sex:=''女'';
auser.U_Birth:=''1980-8-7'';
auser.U_Tel:=''36-3654-7890'';
auser.U_Addr:=''peter 大街 8 号'';
auser.U_PostCode:=''100018'';
auser.U_Email:=''peter@888.com'';
FXMLOption.InsertUser(edit2.text,auser);
WebBrowser1.Navigate(ExtractFilePath(application.ExeName)+edit1.Text);
end;
procedure TForm1.Button7Click(Sender: TObject);
begin
FXMLOption.RemoveUser(edit2.text);
WebBrowser1.Navigate(ExtractFilePath(application.ExeName)+edit1.Text);
end;
procedure TForm1.Button8Click(Sender: TObject);
var
auser:RecUser;
begin
auser.U_Id:=edit2.Text;
auser.U_Name:=''张三'';
auser.U_Sex:=''男'';
auser.U_Birth:=''1970-8-7'';
auser.U_Tel:=''001654-7890'';
auser.U_Addr:=''张三 大街 8 号'';
auser.U_PostCode:=''100018'';
auser.U_Email:=''zhangsan@888.com'';
FXMLOption.ReplaceUser(edit2.Text,auser);
WebBrowser1.Navigate(ExtractFilePath(application.ExeName)+edit1.Text);
end;
end.
Unit单元对应的Form:
object Form1: TForm1
Left = 192
Top = 107
Width = 696
Height = 480
Caption = ''Form1''
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = ''MS Sans Serif''
Font.Style =
OldCreateOrder = False
OnCreate = FormCreate
OnDestroy = FormDestroy
PixelsPerInch = 96
TextHeight = 13
object Label1: TLabel
Left = 440
Top = 400
Width = 32
Height = 13
Caption = ''Label1''
end
object Button1: TButton
Left = 256
Top = 360
Width = 75
Height = 25
Caption = ''CreateBlank''
TabOrder = 0
OnClick = Button1Click
end
object Button2: TButton
Left = 352
Top = 360
Width = 75
Height = 25
Caption = ''AddUser''
TabOrder = 1
OnClick = Button2Click
end
object Edit1: TEdit
Left = 208
Top =