一个DLL中,内部函数调用内部函数的错误,望高手指较! 在线......

hotlife 2004-01-07 11:13:03
library ConAdo;
uses
ShareMem,
SysUtils,
Registry,
Windows,
Dialogs,
Classes;


const
C1 = 52845;
C2 = 22719;

{$R *.res}
Function ConnAdo:string;stdcall;
var Provider,Password,Info,ID,Dbname,DataSource:string;
ConnString:string;
temp:TRegistry;
begin
temp:=TRegistry.Create;
try
with temp do
begin
rootkey:=HKEY_LOCAL_MACHINE;
openkey('SOFTWARE\ADO.NET\SETTINGS',false);
Provider:=ReadString('Provider');
Password:=ReadString('Password');
Password:=Decrypt(Password);
Info:=ReadString('Persist Security Info');
ID:=ReadString('User ID');
Dbname:=ReadString('Initial Catalog');
DataSource:=ReadString('Data Source');
end;

Connstring := 'Provider='+Provider+';';
Connstring := Connstring + 'Password='+Password+';';
Connstring := Connstring + 'Persist Security Info='+Info+';';
Connstring := Connstring + 'User ID=' + ID+';';
Connstring := Connstring + 'Initial Catalog=' + Dbname+';';
Connstring := Connstring + 'Data Source=' + DataSource+';';
result:=Connstring;
finally
temp.free;
end;
end;
exports ConnAdo;

function Decrypt(S: string): string;
var
i: Integer;
j: Integer;
Key: Word;
begin
result := '';
for i := 1 to (Length(s) div 2) do
begin
j := (Integer(s[2 * i - 1]) - 65) * 26;
j := j + (Integer(s[2 * i]) - 65);
result := result + Char(j);
end;
s := Result;
for i := 1 to Length(S) do
begin
Result[i] := char(byte(S[I]) xor (Key shr 8));
Key := (byte(S[I]) + Key) * C1 + C2;
end;
end;

begin
end.

Password:=Decrypt(Password);这行为什么会报错:
[Error] ConAdo.dpr(29): Undeclared identifier: 'Decrypt'
...全文
34 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
hotlife 2004-01-07
  • 打赏
  • 举报
回复
果然,你是对的.
在次谢过!
hotlife 2004-01-07
  • 打赏
  • 举报
回复
多谢,我试一试!
Linux2001 2004-01-07
  • 打赏
  • 举报
回复
把你的Decrypt函数写到ConnAdo函数上面去!不然你就在implementation关键字上面声明这个函数,就不会报错了

5,930

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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