日期:2014-05-19  浏览次数:20874 次

急!急!急!VB转C#!一个串口程序!
VB写的一个串口程序,现在要转成C#。
我又不会VB,请各位帮帮忙,分不够再加!
代码如下:


Option   Explicit
Dim   COUNTER   As   Integer
Dim   crc0   As   Integer
Dim   BO   As   Boolean
Dim   CRC   As   Integer
Dim   k   As   Integer
Dim   out(0)   As   Byte
Dim   data(400)   As   Byte
Dim   RxBuff(1000)   As   Byte
Dim   RxPoint   As   Integer
Dim   Filenum   As   Integer
Dim   Filenum_zo   As   Integer
Dim   Filenum_fu   As   Integer

Dim   Fun         As   Byte
  Dim   Cnt2   As   Integer
 
Dim   Fang_Lmm(3120)   As   Single
Dim   Fu_Lmm(1120)   As   Single
Dim   Zo_Lmm(1120)   As   Single

Dim   Fang_str(3120)   As   String   *   6
Dim   Fu_str(1120)   As   String   *   6
Dim   Zo_str(1120)   As   String   *   6


Private   Sub   Command1_Click()
      Dim   str   As   String   *   36
        Text1.Text   =   " "
        Text2.Text   =   " "
        Text4.Text   =   " "
        Label2.Caption   =   " "
        Label1.Caption   =   " "
        Fun   =   3
        Cnt2   =   0
        Filenum   =   0
        Filenum_fu   =   0
        Filenum_zo   =   0
       
       
       
        Call   Fun_3_fuchong
End   Sub

Private   Sub   Command2_Click()
        Dim   str   As   String   *   36
        Text1.Text   =   " "
        Text3.Text   =   " "
        Label2.Caption   =   " "
        'Label1.Caption   =   " "
        Fun   =   4
        Cnt2   =   0
        Filenum   =   0
            Filenum_fu   =   0
        Filenum_zo   =   0
       
     
       
        Call   Fun_4_fangdian
End   Sub


 
  Timer1.Enabled   =   True
End   Sub


Private   Sub   Timer1_Timer()
      Dim   i   As   Integer
      Dim   J   As   Integer
      Dim   meter   As   Integer
      Dim   m   As   Byte
     
      Dim   MFILE   As   Byte