首页
社区
课程
招聘
[求助]关于VB的LEN和LENB函数
发表于: 2009-9-27 15:47 7062

[求助]关于VB的LEN和LENB函数

2009-9-27 15:47
7062
按VB的解释,应该LEN求的是字符数,LENB求的是字节数
可是我用LEN求RASENTRY结构的长度,是2879,
而用LENB求RASENTRY的结构长度,确实2884,
搞不懂啊,在这种情况不是应该都是2879吗?

按微软的说法,用RasGetEntryProperties求出来的RASENTRY的结构正确长度应该是2884,
谁能告诉我,为什么在VB里面,用LEN和LENB求出来的长度差了5个字节??

Private Type GUID
  Data1 As Long
  Data2 As Integer
  Data3 As Integer
  Data4(7) As Byte
End Type

Private Type RASIPADDR
    a As Byte
    b As Byte
    c As Byte
    d As Byte
End Type

Private Type RASENTRY
    dwSize As Long
    dwfOptions As Long
    dwCountryID As Long
    dwCountryCode As Long
    szAreaCode(10) As Byte
    szLocalPhoneNumber(128) As Byte
    dwAlternateOffset As Long
    ipaddr As RASIPADDR
    ipaddrDns As RASIPADDR
    ipaddrDnsAlt As RASIPADDR
    ipaddrWins As RASIPADDR
    ipaddrWinsAlt As RASIPADDR
    dwFrameSize As Long
    dwfNetProtocols As Long
    dwFramingProtocol As Long
    szScript(259)  As Byte
    szAutodialDll(259)  As Byte
    szAutodialFunc(259)  As Byte
    szDeviceType(16) As Byte
    szDeviceName(128) As Byte
    szX25PadType(32) As Byte
    szX25Address(200) As Byte
    szX25Facilities(200) As Byte
    szX25UserData(200) As Byte
    dwChannels As Long
    dwReserved1 As Long
    dwReserved2 As Long
    dwSubEntries As Long
    dwDialMode As Long
    dwDialExtraPercent As Long
    dwDialExtraSampleSeconds As Long
    dwHangUpExtraPercent As Long
    dwHangUpExtraSampleSeconds As Long
    dwIdleDisconnectSeconds As Long
    dwType As Long
    dwEncryptionType As Long
    dwCustomAuthKey As Long
    guidId As GUID
    szCustomDialDll(259) As Byte
    dwVpnStrategy As Long
    dwfOptions2 As Long
    dwfOptions3 As Long
    szDnsSuffix(255) As Byte
    dwTcpWindowSize As Long
    szPrerequisitePbk(259) As Byte
    szPrerequisiteEntry(256) As Byte
    dwRedialCount As Long
    dwRedialPause As Long
End Type

[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!

收藏
免费 0
支持
分享
最新回复 (2)
雪    币: 290
活跃值: (20)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
2
vb结构按4个字节对齐
2009-9-27 16:29
0
雪    币: 280
活跃值: (58)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
3
明白了,谢谢啊,茅塞顿开
2009-9-27 17:38
0
游客
登录 | 注册 方可回帖
返回
//