首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > PB >

VB中的这段代码怎么转换成PB代码?

2012-04-19 
VB中的这段代码如何转换成PB代码????VoiceFile VoicePath + One.telOpen VoiceFile For Binary Access

VB中的这段代码如何转换成PB代码????
VoiceFile = VoicePath + "One.tel"
  Open VoiceFile For Binary Access Read As #1 Len = 2878
  Get #1, 1, OneBuffer
  Close #1
  VoiceFile = VoicePath + "Eight.tel"
  Open VoiceFile For Binary Access Read As #1 Len = 3542
  Get #1, 1, EightBuffer
  Close #1

[解决办法]
Open VoiceFile For Binary Access Read As #1 Len = 2878以只读的二进制方式(Binary Access Read )打开(Open)文件【VoicePath + "One.tel"
】,并赋予本次打开的文件号为【1】(As #1)号, 同时指定每次读取的数据大小为2878字节(Len = 2878)
[解决办法]

C/C++ code
integer li_fnum, li_bytesstring VoiceFileblob OneBuffer, EightBufferVoiceFile = VoicePath + "One.tel"li_fnum = FileOpenVoiceFile,  StreamMode!)li_bytes = FileRead(li_fnum, OneBuffer)fileclose(li_fnum)VoiceFile = VoicePath + "Eight.tel"li_fnum = FileOpenVoiceFile,  StreamMode!)li_bytes = FileRead(li_fnum, EightBuffer)fileclose(li_fnum) 

热点排行