Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Need to convert a snippet from VB to C#

Posted on 2011-09-09
5
Medium Priority
?
248 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

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

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

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

650 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