程序全部源码如下:
请达达们指点!在下感激不尽unit Unit1;interfaceuses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,IdHashMessageDigest,
  Dialogs, StdCtrls, shellapi, ExtCtrls, bsSkinCtrls, Mask, bsSkinBoxCtrls, bsSkinData, BusinessSkinForm;type
  TForm1 = class(TForm)
    Image1: TImage;
    OpenDialog1: TOpenDialog;
    Button1: TbsSkinButton;
    Button2: TbsSkinButton;
    bsBusinessSkinForm1: TbsBusinessSkinForm;
    bsSkinData1: TbsSkinData;
    bsStoredSkin1: TbsStoredSkin;
    Edit2: TbsSkinPasswordEdit;
    Edit1: TbsSkinEdit;
    bsSkinLabel1: TbsSkinLabel;
    bsSkinLabel2: TbsSkinLabel;
    CheckBox1: TbsSkinCheckRadioBox;
    procedure Button1Click(Sender: TObject);
    function GetCommandLine(QQPath, QQNum, QQPw: string; QQState: integer): string;
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;var
  Form1: TForm1;implementation{$R *.dfm}function Base64(Src: string): string;
const
  DataSet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
var
  i, ModLen: integer;
  Current: string;
  Buf: array[1..3] of Byte;
  NewBuf: array[1..4] of Byte;
begin
  result := '';
  if Src = '' then
    exit;
  ModLen := Length(Src) mod 3;
  while Length(Src) > 0 do
  begin
    FillChar(Buf, 3, #0);
    Current := Copy(Src, 1, 3);
    Src := Copy(Src, 4, Length(Src) - 3);
    for i := 1 to 3 do
      Buf[i] := ord(Current[i]);
    NewBuf[1] := Buf[1] shr 2;
    NewBuf[2] := (Buf[1] shl 6 shr 2 or Buf[2] shr 4) and $3F;
    NewBuf[3] := (Buf[2] shl 4 shr 2 or Buf[3] shr 6) and $3F;
    NewBuf[4] := Buf[3] and $3F;
    for i := 1 to 4 do
      result := result + DataSet[NewBuf[i] + 1];
  end;
  if ModLen >= 1 then
    result[Length(result)] := '=';
  if ModLen = 1 then
    result[Length(result) - 1] := '=';
end;function GetCommandLine(QQPath, QQNum, QQPw: string; QQState: integer): string;
type
  TempChar = array[0..15] of char;
var
  md5: TIdHashMessageDigest5;
begin
  md5 := TIdHashMessageDigest5.Create;
  result := QQPath + ' /START QQUIN:' + QQNum + ' PWDHASH:' + Base64(TempChar(md5.HashValue(QQPw))) + ' /STAT:' + IntToStr(QQState);
  md5.Free;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
QQpath : string;
QQPw , QQUS : string;
QQState : integer;
TempChar : array[0..15] of char;
md5: TIdHashMessageDigest5;
begin
  if checkbox1.Checked then QQstate := 40 else QQstate := 10 ;
  begin
    if edit1.Text = '' then
    begin
    application.MessageBox('请填写QQ号码!','提示',64);
    exit;
    end
    else
    if edit2.Text = '' then
    application.MessageBox('请填写QQ密码!','提示',64)
    else
    opendialog1.Execute ;
    QQpath := opendialog1.FileName ;
    //调用些函数时,提示出错。不知道hashvalue这里整出来的是什么类型的
    GetCommandLine(QQpath + ' /START QQUIN:' + QQUs + ' PWDHASH:' + Base64(TempChar(md5.HashValue(QQPw))) + ' /STAT:' + IntToStr(QQState));
    end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
  close;
end;end.

解决方案 »

  1.   

    既然知道TempChar(md5.HashValue(QQPw))出错了,就跟踪单步调试,看返回什么类型的
      

  2.   

    function GetCommandLine(QQPath, QQNum, QQPw: string; QQState: integer): string;函数有4个参数,你调用的时候只有一个参数:QQpath + ' /START QQUIN:' + QQUs + ' PWDHASH:' + Base64(TempChar(md5.HashValue(QQPw))) + ' /STAT:' + IntToStr(QQState)
      

  3.   

    cuteant   is true.....
      

  4.   

    错误之处:
    1 在函数的实现处:
    function GetCommandLine改为function TForm1.GetCommandLine
    2 调用函数时改为:
    QQPw := GetCommandLine(QQpath,edit1.Text,edit2.Text,QQstate);
    GetCommandLine功能:QQPath, QQNum, QQPw,QState组成的字符串。其中密码用MD5加密过。