求师傅们给予指示·····

壹路有你小猴子 2014-07-17 02:32:19
麻烦师傅们帮忙看看,我需要点击”产品注册码“输出的是16进制字符串!!!我需要怎么改,本人刚入门希望师傅们给予指示,再次真诚的感谢师傅们,谢谢!

程序运行时是这样的↓↓↓


麻烦师傅们帮帮忙,我想点击“产品注册码”输出是16进制的字符串。


正确输出的16进制字符串是“等号”后面的↓↓↓


下面是我的程序↓↓↓
...全文
127 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
Yothan 2014-07-18
  • 打赏
  • 举报
回复
你贴图不如直接贴代码,这要人一个个打出来的节奏吗? 你的代码是一种加密算法吧,不能直接用16进制转换
  • 打赏
  • 举报
回复
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Editid: TEdit; Editcode: TEdit; Label1: TLabel; Label2: TLabel; Button1: TButton; Button2: TButton; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); private { Private declarations } public { Public declarations } function Decrypt(const s: string; key: word): string; end; var Form1: TForm1; implementation {$R *.dfm} function TForm1.Decrypt(const s: string; key: word): string; var i:integer; R:String; const C1=50; C2=50; begin SetLength(R,Length(s)); for i:=1 to Length(s) do begin R[i]:=char(byte(s[i]) xor (key shr 8)); key:=(integer(s[i])+key)+C1+C2 end; Result:=R; end; procedure TForm1.Button1Click(Sender: TObject); begin if Trim(Editid.Text)='' then begin MessageBox(Handle,pchar('对不起,机器标识不能为空'),pchar('系统提示'),mb_ok or mb_iconwarning); Editid.SetFocus; Exit; end; Editcode.Text:=Decrypt(Trim(Editid.Text),100); end; procedure TForm1.Button2Click(Sender: TObject); begin Close; end; end.

16,748

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 语言基础/算法/系统设计
社区管理员
  • 语言基础/算法/系统设计社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧