1. 首页 > 科技

Delphi 7代码转换vb6? delphi代码

Delphi 7代码转换vb6?delphi代码

Delphi7的一段代码转换VB

shell "c:\ZcomMagSubscribe-100-5083.exe",vbNormalFocus

delphi代码转为VB代码

private declare sub copymemory lib "kernel32" alias "rtlmovememory" (destination as any, source as any, byval length as long)

Function SeqEnc( Str as String,Key as Integer,Times as Integer)

dim i as Integer

dim c as Integer

dim n as Integer

dim Key1() as Byte

dim Key2() as Byte

dim Key3() as Byte

dim Key4() as Byte

n=Len(Str)

if n=0 then

Exit Function;

ReDim Key4(len(Key / (2^24) ) as Byte

copymemory Key4(0) ,Key / (2^24), len(Key / (2^24))

ReDim Key3(len(Key / (2^16) ) as Byte

copymemory Key3(0) ,Key / (2^16), len(Key / (2^16))

ReDim Key2(len(Key / (2^8) ) as Byte

copymemory Key2(0) ,Key / (2^8), len(Key / (2^8))

ReDim Key1(len(Key) as Byte

copymemory Key2(0) ,Key ,len(Key )

for c= 0 to Times-1

把后面用到c的地方用 Times-(c+1)替换

.....不想写了..

后面的你自己应该可以自己写出来了 上面的位操作可能会有问题 我现在手头没有VB环境 没办法帮你调试 你可以到网上查 "VB位操作" 和“vb STR 转 BYTE”来完成剩下的工作

麻烦将下面代码转换成VB6代码

这样不知道够不够你用

Public Function Process(B() As Byte) As Long

   Dim CRC As Long, I As Long

   CRC = 0

   Dim Index As Long

   For I = 0 To UBound(B) - 1

    Index = (CRC \ (2 ^ 24) And &HFF) Xor B(I)

    CRC = CRCTable(Index) Xor (CRC * (2 ^ 8))

   Next

    Process = CRC

End Function

delphi7 循环语句和VB6 循环语句

修改代码如下:

procedure TForm2.WMDROPFILES(var Msg: TMessage);

var

FilesCount: Integer; // 文件总数

i: Integer; // 整形变量

FileName: array [0 .. 255] of Char;

begin

Memo1.Clear; // 清除memo

// 获取文件总数

FilesCount := DragQueryFile(Msg.WParam, $FFFFFFFF, nil, 0);

Memo1.Lines.Add('文件总数为:' + IntToStr(FilesCount));

ProgressBar1.Min := 0; // 进度条最小值

ProgressBar1.Max := FilesCount - 1; // 进度条最大值

// 获取文件名

for i := 0 to FilesCount - 1 do

begin

DragQueryFile(Msg.WParam, i, FileName, 256);

Memo1.Lines.Add(FileName);

ProgressBar1.Position := i;

end;

DragFinish(Msg.WParam); // 释放

end;