troubleshooting Question

Need this visual basic code converted to C#

Avatar of tatton777
tatton777Flag for United States of America asked on
.NET ProgrammingC#Visual Basic.NET
8 Comments1 Solution646 ViewsLast Modified:
My credit card processor provided a VB DLL for me to use in sending data to and receiving data from them. My website is in C# so I need to figure out how to incorporate this DLL into it.

In the example from the credit card processor I am to add a reference to SendPmt.dll within the VB project and then use this code

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

        ' Initialize string
        Dim strData As String
        Dim strReturn As String

        Dim objSendPmt As SendPmt.clsSendPmt
        objSendPmt = CreateObject("SendPmt.clsSendPmt")

        strData = Replace(txtInput.Text, vbCrLf, Chr(10))

        strReturn = objSendPmt.SendPayment(strData, "test")

    End Sub

So far in my C# attempt I have added a reference to the SendPmt.dll from the processor and a reference to Microsoft.VisualBasic.dll. I think I am on the right track using the Microsoft.VisualBasic.dll but I can't seem to get it to work.
Join our community to see this answer!
Unlock 1 Answer and 8 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros