求Delphi函数转成VB.NET
Delphi函数如下,转成vb.net,万分感谢function Encrypt(S : String) : String;
type
PWORD = ^WORD;
var
Len : Integer;
I : Integer;
V : DWORD;
P : PChar;
Buffer : String[255];
begin
Buffer := S;
Len := Length(Buffer) + 1;
if (Len mod 2) <> 0 then
Inc(Len);
if Len < 10 then
Len := 10;
I := Length(Buffer);
if I = 0 then
Buffer := IntToStr(GetTickCount)
else
while Length(Buffer) < 10 do
Buffer := Buffer + Buffer;
SetLength(Buffer, I);
Result := '';
P := PChar(@Buffer[0]);
for I := 1 to Len div 2 do begin
V := 34567 + PWORD(P)^;
P := P + 2;
Result := Result + Format('%5.5d', [V]);
end;
end; --------------------编程问答-------------------- PWORD = ^WORD;
这句是什么意思?
其他代码基本跟vb类似,应该好转 --------------------编程问答-------------------- Word: Int16
^Word是Int16变量的指针
补充:.NET技术 , VB.NET