见标题

解决方案 »

  1.   

    思路:用Ord取得每个字符的ASCII码,然后用IntToHex转化为16进制字符。代码自己写吧,应该不难
      

  2.   

    function IntToHex(Value: Integer; Digits: Integer): string; overload;
    function IntToHex(Value: Int64; Digits: Integer): string; overload;procedure TForm1.Button1Click(Sender: TObject);var
      i: Integer;
    begin
      Label1.Caption := '';
      for i := 1 to Length(Edit1.Text) do
      begin
        try
          Label1.Caption := Label1.Caption + IntToHex(Edit1.Text[i],2) + ' ';
        except
          Beep;
        end;
      end;
    end;
      

  3.   

    tmpint:integer;if ( ord(ch)>127 ) or (ord(ch)<32) then
    begin
        tmpint:=ord(ch)
        inttohex(tmpint);
    end;
      

  4.   

    还是看 windofsun(太阳风) 的吧。
      

  5.   

    将字符串转成整型,然后用InttoHex转成16进制的字符串。
      

  6.   

    这样看看行不行:var
      Form1: TForm1;
    function gethexd(str:pchar):pchar;stdcall;external'Project4.dll';
    function getlinebyte(str:pchar):pchar;stdcall;external'Project4.dll';
    function gettotalbyte(str:pchar):pchar;stdcall;external'Project4.dll';implementation{$R *.DFM}procedure TForm1.Button1Click(Sender: TObject);
    var s:string;
    begin
       memo1.clear;
       s:=gethexd(pchar(edit1.text));
       memo1.lines.Add(s);
       edit2.text:=string(getlinebyte(pchar(edit1.text)));
       edit3.text:=string(gettotalbyte(pchar(edit1.text)));
    end;procedure TForm1.FormDblClick(Sender: TObject);
    begin
      showmessage(inttostr(length(memo1.text)));
    end;end.
    动态连接库是这样的:library Project4;uses
      Unit1 in 'Unit1.pas' {Form1};{$R *.RES}
      exports
        gethexd,getlinebyte,gettotalbyte;beginend.
    就这样了。我刚才试了一下全部完全达到你的要求。