这个问题老土这里有源码啦。unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Memo1: TMemo;
Edit2: TEdit;
Button4: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
memo1.lines.add(Chr(strToInt(Edit1.text)));
end;
procedure TForm1.Button2Click(Sender: TObject);
var
Temp
char;
Name:string;
c:char;
i,Long,Pass:integer;
begin
Pass:=0;
Name:=edit1.Text;
long:=length(Name);
for i:=1 to Long do
begin
temp:=pchar(copy(Name,i,1));
c:=temp^;
Pass:=ord(c)
//将用户名每个字符转换为ASCII码。
memo1.lines.Append(IntToStr(Pass));
end;
end;
procedure TForm1.Button3Click(Sender: TObject);
var
S: string;
begin
S :=Edit2.Text;
AppendStr(S,memo1.Text);
Edit2.Text := S;
Edit1.Clear;
Memo1.Clear;
end;
end.