?
Solved

Need to convert a snippet from VB to C#

Posted on 2011-09-09
5
Medium Priority
?
243 Views
Last Modified: 2013-12-17
Hey Guys!!

I need to convert the following code to C#.net.

With charge1

  .LoggingLevel = 3
  .MaxLogSize = 3
 
   .Device = DeviceType_ppdVerifone_Mx870
    .ComPort = "COM5"
    .Baud = "115200"
    .DataBits = "8"
    .Parity = "N"
'    .MxCommSetting = MxCommType_IP
'    .MxPort = "9001"
'    .MxIPAddress = "10.64.106.119"

    .InitalizePinPad
       
    If .InitalizePinPad = True Then
   
       MsgBox "initialized"
          .ChangeForm ("WELCOME")
    Else
        MsgBox "Not initialized"
    End If
End With


Thanks a bunch!!

Jerry
0
Comment
Question by:JDL129
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 1

Expert Comment

by:Temizh
ID: 36514076
With ... End With Block helps you by calling the object only with a dot. so here is your C# code:

   charge1.LoggingLevel = 3;
   charge1.MaxLogSize = 3;

   charge1.Device = DeviceType_ppdVerifone_Mx870;
   charge1.ComPort = "COM5";
   charge1.Baud = "115200";
   charge1.DataBits = "8";
   charge1.Parity = "N";
   charge1.InitalizePinPad // not sure here. if it is a function than use charge1.InitalizePinPad

if(charge1.InitalizePinPad == true)
{
      MsgBox.Show("initialized");
      charge1.ChangeForm("WELCOME");
}
else
{
      MsgBox.Show("Now initialized);
}
0
 

Author Comment

by:JDL129
ID: 36514965
Temizh:!!!!!!
Thanks for the response!!!!!

All of the ='s have red squigly's under them with error messages that indicate: Invalid Token '=' in class, struct or interface member declaration.

Perhaps I should have indicated the following: Dim WithEvents charge1 As SIM.Charge that needs to be converted as well.

Sorry,
Jerry
0
 
LVL 1

Accepted Solution

by:
Temizh earned 500 total points
ID: 36515490
You shall give me all codes. And before this code you shoud have this:

var charge1 = new charge1(); or var vharge1 = value;
0
 

Author Closing Comment

by:JDL129
ID: 36526185
Thanks for the response!!!

Jerry
0
 
LVL 1

Expert Comment

by:Temizh
ID: 36527471
You're welcome.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question