DLL

Last post 10-18-2009 7:17 AM by Liquid Snake. 21 replies.

Sort Posts:

  • DLL

    03-09-2008, 6:52 PM
    • Member
      198 point Member
    • Zahyea
    • Member since 10-16-2007, 1:06 AM
    • Posts 176

    Dear All.

    Have a nice day.

    I have one asp file please can you convert it in asp.net c#

     <html>
    <%Dim product,price,qty,total,name,address,postal ' Declaration of variables

    product = request.Form("product")
    price   = request.Form("price")
    qty     = request.Form("qty")
    total   = request.Form("total")
    name    = request.Form("name")
    address = request.Form("address")
    postal  = request.Form("postal")

    Dim MyObj
    Set MyObj          = Server.CreateObject("e24PaymentPipe.e24PaymentPipe.1") ' Create an instance of the dll object
    MyObj.Action       = "1"            ' Purchase Transaction
    MyObj.Amt          = total          ' The amount of purchase
    MyObj.Currency     = "414"          ' KD Currency
    MyObj.Language     = "USA"          ' Payment Page Language
    MyObj.ResponseURL  = "https://www.knetpaytest.com.kw/ASP/response.asp" ' Your response URL where you will be notified with of transaction response
    MyObj.ErrorURL     = "https://www.knetpaytest.com.kw/ASP/error.asp" ' URL to redirect customer in case of error
    MyObj.TrackID      = "1234" ' You should create a new unique track ID for each transaction
    MyObj.ResourcePath = "D:\\secureCommerce\\Apps\\CommerceGateway\\Resource\\Demo\\"

    MyObj.Alias    = "demo"
    MyObj.Udf1         = "User Defined Field 1"
    MyObj.Udf2         = "User Defined Field 2"
    MyObj.Udf3         = "User Defined Field 3"
    MyObj.Udf4         = "User Defined Field 4"
    MyObj.Udf5         = "User Defined Field 5"

    Dim TransVal, varPaymentID, varPaymentPage, varErrorMsg, varRawResponse

    TransVal = MyObj.PerformInitTransaction 
    varRawResponse = MyObj.RawResponse
    varPaymentID   = MyObj.PaymentID
    varPaymentPage = MyObj.PaymentPage
    varErrorMsg    = MyObj.ErrorMsg

    if TransVal <> 0 Then
       response.redirect("error.asp")
    Else
     response.redirect (varPaymentPage & "?PaymentID=" & varPaymentID) ' Redirects user to KNET Payment Page with parameter PaymentID
    End if
    %>

    </html>

     

    thanks

    Zahyea

    Zahyea
  • Re: DLL

    03-10-2008, 7:34 AM
    Answer
    try http://labs.developerfusion.co.uk/convert/vb-to-csharp.aspx

    string
    product;
    string price;
    string qty;
    string total;
    string name;
    string address;
    string postal;

    product = request.Form("product");
    price = request.Form(
    "price");
    qty = request.Form(
    "qty");
    total = request.Form(
    "total");
    name = request.Form(
    "name");
    address = request.Form(
    "address");
    postal = request.Form(
    "postal");

    object MyObj;

    MyObj = Server.CreateObject("e24PaymentPipe.e24PaymentPipe.1");
    // Create an instance of the dll object
    MyObj.Action = "1";
    // Purchase Transaction
    MyObj.Amt = total;
    // The amount of purchase
    MyObj.Currency = "414";
    // KD Currency
    MyObj.Language = "USA";
    // Payment Page Language
    MyObj.ResponseURL = https://www.knetpaytest.com.kw/ASP/response.asp;
    // Your response URL where you will be notified with of transaction response
    MyObj.ErrorURL = "https://www.knetpaytest.com.kw/ASP/error.asp";

    // URL to redirect customer in case of error
    MyObj.TrackID = "1234";
    // You should create a new unique track ID for each transaction
    MyObj.ResourcePath = "D:\\\\secureCommerce\\\\Apps\\\\CommerceGateway\\\\Resource\\\\Demo\\\\";

    MyObj.Alias = "demo";
    MyObj.Udf1 =
    "User Defined Field 1";
    MyObj.Udf2 =
    "User Defined Field 2";
    MyObj.Udf3 =
    "User Defined Field 3";
    MyObj.Udf4 =
    "User Defined Field 4";
    MyObj.Udf5 =
    "User Defined Field 5";

    string TransVal;
    string varPaymentID;
    string varPaymentPage;
    string varErrorMsg;
    string varRawResponse;

    TransVal = MyObj.PerformInitTransaction;

    varRawResponse = MyObj.RawResponse;
    varPaymentID = MyObj.PaymentID;
    varPaymentPage = MyObj.PaymentPage;

    varErrorMsg = MyObj.ErrorMsg;

    if (TransVal != 0)
    {
            response.redirect(
    "error.asp");
    }
    else
    {
            response.redirect(varPaymentPage +
    "?PaymentID=" + varPaymentID);
           
    // Redirects user to KNET Payment Page with parameter PaymentID
    }

    My Books:

    Professional Enterprise .NET
    Check out my book on learning all about enterprise programming, including TDD, Mocking, DDD, Dependecy Injection, Inversion of Control, Dependency Inversion, NHibernate, MVC & MVP. Check out the code on the projects codeplex site.

    NHibernate with ASP.net Problem-Design-Solution
    Learn all about NHibernate with ASP.net.
  • Re: DLL

    03-10-2008, 7:40 PM
    Answer
    • Member
      198 point Member
    • Zahyea
    • Member since 10-16-2007, 1:06 AM
    • Posts 176

    Hello Scott.

    Thank you very very much. Please can you solve my one more problem. I am using the above code in shoping site. Payment gateway company gave me One DLL , the above code creating the Object of that dll so it is writing

    object MyObj;

     

    MyObj = Server.CreateObject("e24PaymentPipe.e24PaymentPipe.1");

    // Create an instance of the dll object

    MyObj.Action = "1";

     

    // Purchase Transaction

    MyObj.Amt = total;

     DLL name is e24PaymentPipe.dll , i registered the DLL in my computer but as i type MyObj and press dot the (Action) also (Amt) is not coming. As the above code has 

    MyObj.Action = "1";

     

    // Purchase Transaction

    MyObj.Amt = total;

    Please can you assist me how to confirm DLL is register in my computer and also in server. ?

    I also did the following instruction but i am still getting error.

    you must register the e24PaymentPipe dll within your windows server as follows:
    - Save e24PaymentPipe.dll under <Windows Directory>\system32
    - from the DOS command prompt, enter: regsvr32 e24paymentpipe.dll
    - restart your server

    for the E24PaymentPipe to work properly under .NET platform, perform the following:

    - Allow full control to authenticated users over e24paymentpipe.dll
    - Allow application pool to run under local services instead of network services

    thank you very much for helping.

    Zahyea

     

    Zahyea
  • Re: DLL

    03-10-2008, 7:49 PM
    Answer
    • All-Star
      21,582 point All-Star
    • gunteman
    • Member since 07-11-2007, 12:57 PM
    • Norrköping, Sweden
    • Posts 3,169

     You should use "Add Reference.../COM" to create a .NET wrapper around the COM object, and use that instead.

    -- "Mark As Answer" if my reply helped you --
  • Re: DLL

    03-10-2008, 8:37 PM
    • Member
      198 point Member
    • Zahyea
    • Member since 10-16-2007, 1:06 AM
    • Posts 176

    Hi Scott.

     I added DLL through add refrence , now how can i call this namespace. but in the code above if you see there are

    MyObj = Server.CreateObject("e24PaymentPipe.e24PaymentPipe.1");

    This line was in asp can i use same line code in asp.net if i use same then (MyObj.Amt) not coming. please can you assist me as you solved my many big problem so far.

     Thanks in Adance.

    Zahyea.

    Zahyea
  • Re: DLL

    03-11-2008, 3:46 PM
    Answer
    • All-Star
      21,582 point All-Star
    • gunteman
    • Member since 07-11-2007, 12:57 PM
    • Norrköping, Sweden
    • Posts 3,169
    You have declare and instantiate it using the wrapped class (which was created when you added the reference). It's probably something like this.

    e24PaymentPipe.e24PaymentPipe MyObj;

    MyObj = new e24PaymentPipe.e24PaymentPipe();



     
    -- "Mark As Answer" if my reply helped you --
  • Re: DLL

    03-13-2008, 4:25 PM
    • Member
      198 point Member
    • Zahyea
    • Member since 10-16-2007, 1:06 AM
    • Posts 176

    Dear Scott.

     I am receiving error on above code where

    TransVal = MyObj.PerformInitTransaction();

    Compiler Error Message: CS0029: Cannot implicitly convert type 'short' to 'string'

    Source Error:

    Line 61: 
    Line 62: 
    Line 63:                 TransVal = MyObj.PerformInitTransaction();
    Line 64: 
    Line 65:                 varRawResponse = MyObj.RawResponse;

    then i changed code to

     TransVal = Convert.ToString(MyObj.PerformInitTransaction());

     

    Now i am receiving error.

     

    The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Runtime.InteropServices.COMException: The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))

    Source Error:

    Line 61: 
    Line 62: 
    Line 63:                 TransVal = Convert.ToString(MyObj.PerformInitTransaction());
    Line 64: 
    Line 65:                 varRawResponse = MyObj.RawResponse;

    Please can you assist me why it is coming error , may be DLL error but DLL objects now corrects. please can you assist me.

     

    Thanks.

    Zahyea.

    Zahyea
  • Re: DLL

    10-14-2008, 8:45 AM
    • Member
      2 point Member
    • lagidi.raju
    • Member since 10-14-2008, 12:40 PM
    • Posts 1

    Please declare TransVal as short...

    C#

    ---

    short TransVal;

  • Re: DLL

    12-24-2008, 1:10 AM
    • Member
      6 point Member
    • tebrym
    • Member since 12-24-2008, 6:05 AM
    • Posts 3

    if you still having this problem email me on: tebrym@yahoo.com

    just tell me in mail the problem you are facing and name of your company

    inn sha2 allah i have the solution for your prob.

     

    Filed under:
  • Re: DLL

    01-07-2009, 11:42 AM
    • Member
      2 point Member
    • peyote
    • Member since 01-07-2009, 4:05 PM
    • Posts 1

    Hi all, I'm experiencing the same problem as Zahyea.

    I had pasted this code into my application and followed all the instructions you kindly posted, but it's not working. I get lots of errors, could someone please help me?

    Thanks in advance,

    Peyo

  • Re: DLL

    01-10-2009, 12:47 PM
    • Member
      198 point Member
    • Zahyea
    • Member since 10-16-2007, 1:06 AM
    • Posts 176

    Dear Peyote,

     My site is working good.

    If possible, Please past your code and error so i can assist.

     

    Zahyea
  • Re: DLL

    02-19-2009, 9:57 AM
    • Member
      4 point Member
    • Marbash
    • Member since 02-19-2009, 12:56 PM
    • Posts 2

     Zaheya if you can post the code that worked with you under asp.net please

  • Re: DLL

    02-20-2009, 3:39 AM
    • Member
      4 point Member
    • Marbash
    • Member since 02-19-2009, 12:56 PM
    • Posts 2

     Thanks I solved my problem .

  • Re: DLL

    05-12-2009, 3:18 AM
    • Member
      10 point Member
    • testsantu
    • Member since 05-12-2009, 7:10 AM
    • Posts 6

    Hi ,

    I  all , i stuck up with problem using the e24paymentpipe.dll in asp.net c#. so can u please help me out. to solve the problem. the error masg what iam getting is "!ERROR!-PY20000-Missing required data."

    I have registerd the dll, and added the reference of the dll in the application.  The client gave the ASP plugins..

    Created the instance of the class

    e24PaymentPipeCtlClass Myobject = new e24PaymentPipeCtlClass();

    Myobject.Action = ConfigurationSettings.AppSettings["TranAction"];

    Myobject.ResourcePath = ConfigurationSettings.AppSettings["resourcepath"];

    Myobject.Alias=ConfigurationSettings.AppSettings["terminalalias"];

    Myobject.Currency = ConfigurationSettings.AppSettings["TranCurrency"];

    Myobject.Language = ConfigurationSettings.AppSettings["ConsumerLanguage"];

    Myobject.ResponseUrl = ConfigurationSettings.AppSettings["MerchantReceiptURL"];

    Myobject.ErrorUrl = ConfigurationSettings.AppSettings["errorURL"];tractid = "BRT"+"-"+ Convert.ToString(RandomNumber());

    Myobject.TrackId = tractid;

    Myobject.Udf1 =
    PG_Id

    Myobject.Udf2 = Email_id;

    Myobject.Udf3 = Mobileno;

    Myobject.Udf4 =
    "software Services";

    Myobject.Udf5 = "company name.";

    Int16 TransVal;

    string varPaymentPage;

    string varErrorMsg;string varRawResponse;

    TransVal = Myobject.PerformInitTransaction();

    varRawResponse = Myobject.RawResponse;

    varPaymentId = Myobject.PaymentId;

    varPaymentPage = Myobject.PaymentPage;

    varErrorMsg = Myobject.ErrorMsg;

    Session[
    "Paymentid"] = varPaymentId;

    But ,the problem is its not returning redirect page its going to error page. 

    Myobject.PerformInitTransaction() returning =======-1

    Can any one plz help me to solve this problem....

    Thank you & regards

     

    Filed under:
  • Re: DLL

    05-12-2009, 4:02 AM
    • Member
      6 point Member
    • tebrym
    • Member since 12-24-2008, 6:05 AM
    • Posts 3
    Did you opened the security permisions for all users on that DLL?? and if so, When clicking, the error page come up directly or it takes a little time before it raising up?
Page 1 of 2 (22 items) 1 2 Next >