title: how can I write this code of c# to be in VB.net
body: <p>how can I write the following code written in c# to vb.net. 
  I am trying to write a finger print program but I got stuck to this point
  what is the right way to do it?</p>
  
  <pre><code> public bool Connect_Net(string IPAdd, int Port)
              {
                  if (objCZKEM.Connect_Net(IPAdd, Port))
                  {
                      //65535, 32767
                      if (objCZKEM.RegEvent(1, 32767))
                      {
                          // [ Register your events here ]
                          // [ Go through the _IZKEMEvents_Event class for a complete list of events
                          objCZKEM.OnConnected += ObjCZKEM_OnConnected;
                          objCZKEM.OnDisConnected += objCZKEM_OnDisConnected;
                          objCZKEM.OnEnrollFinger += ObjCZKEM_OnEnrollFinger;
                          objCZKEM.OnFinger += ObjCZKEM_OnFinger;
                          objCZKEM.OnAttTransactionEx += new _IZKEMEvents_OnAttTransactionExEventHandler(zkemClient_OnAttTransactionEx);
                      }
                      return true;
                  }
                  return false;
              }
  ////////////////////////////////////////////
  </code></pre>
  
  <blockquote>
    <p>and here is the code I want to try to convert to:</p>
  </blockquote>
  
  <pre><code>&lt;!-- language: vb.net --&gt;
  
  Public Function Connect_Net(ByVal IPAdd As String, ByVal Port As Integer) As Boolean
                  If objCZKEM.Connect_Net(IPAdd, Port) Then
  
                      If objCZKEM.RegEvent(1, 32767) Then
                          objCZKEM.OnConnected += AddressOf ObjCZKEM_OnConnected
                          objCZKEM.OnDisConnected += AddressOf objCZKEM_OnDisConnected
                          objCZKEM.OnEnrollFinger += AddressOf ObjCZKEM_OnEnrollFinger
                          objCZKEM.OnFinger += AddressOf ObjCZKEM_OnFinger
                          objCZKEM.OnAttTransactionEx += New _IZKEMEvents_OnAttTransactionExEventHandler(AddressOf zkemClient_OnAttTransactionEx)
                      End If
  
                      Return True
                  End If
  
                  Return False
              End Function
  
  ''''''''''''''''''''''''''''
  </code></pre>
  
  <p>''''''''''''''''''''''''</p>
  
  <p>But:
  I get this error:</p>
  
  <blockquote>
    <p>Error 4   Operator '+' is not defined for types 'Object' and
    'Void'.   C:\Users\PC50\Documents\Visual Studio
    2010\Projects\Ref_Con\Ref_Con\Utilities\ZkemClient.vb</p>
  </blockquote>