在调用commonDialog控件以后,在程序中写如下代码:
Open CommonDialog1.FileName For Binary As #tempFile   二进制打开文件
              Get #tempFile, , loadbytes() 文件内容写入数组  
Close #tempFile放入mscomm控件,写代码
mscomm.output=loadbytes()内容写入mscomm的发送缓冲区
功能完成。打开以后显示的代码:
Open CommonDialog1.FileName For Binary As #tempFile       
         ReDim loadbytes(0 To LOF(tempFile) - 1) As Byte 
         Get #tempFile, , loadbytes()   文件内容写入数组
Close #tempFileText1.Text = StrConv(loadbytes(), vbUnicode)  显示在text1中