sif*_*all 10 vb.net delphi syntax
我正在尝试将Delphi代码转换为vb.net,我不确定这一行:
stream.Seek($42, soFromBeginning);
Run Code Online (Sandbox Code Playgroud)
我熟悉在文件流上使用搜索(在vb.net中),但我不确定$42.
我假设这对应于某个职位,但这又如何转化为vb.net?
小智 14
$是十六进制常量的前缀.在VB.NET中,那是&H,所以你会写&H42.
The code required for VB.net is almost identical:
stream.Seek(&H42, SeekOrigin.Begin)
Run Code Online (Sandbox Code Playgroud)
The points of note here are:
$ in Delphi is the prefix for hexadecimal.soFromBeginning corresponds to SeekOrigin.Begin.