程序全部源码如下:
请达达们指点!在下感激不尽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.
请达达们指点!在下感激不尽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.
解决方案 »
- delphi三层程序,如果在服务器端禁止同IP的不允许再连接? 服务器端用的是scktsrvr服务,
- 怎么样把一图象序列合成一段视频???
- 我这样写有什么问题码?(Treeview)
- 求将数字金额转化为中文金额的函数?
- 多语言合作开发软件的方法?
- 散掉最后20分来问这个简单的问题,高手一定要帮帮我,一定等解答了才去吃晚饭. :)
- 关于数据汇总的问题!120分
- 如何取得数据表字段得值?
- 关于内存得问题
- 为何DBRichEdit构件编辑和显示汉字时总成乱码?——急求好构件和解决方案!
- 一个SQL查询语句,怎么搞都不能在delphi中搞掂~~大家出下主意。
- 谁能帮我设计一个10进制转换到60进制的程序呀
1 在函数的实现处:
function GetCommandLine改为function TForm1.GetCommandLine
2 调用函数时改为:
QQPw := GetCommandLine(QQpath,edit1.Text,edit2.Text,QQstate);
GetCommandLine功能:QQPath, QQNum, QQPw,QState组成的字符串。其中密码用MD5加密过。