Using DLL DotNet

iperutilityiperutility Member Posts: 18
edited 2014-12-03 in NAV Three Tier
Hello guys,

Ihave done a DLL with my visual studio 2013 C# language to send email by SMTP protocol with SSL encrypted system port 465, becouse Microsoft had told me the NAV2013 not support this procedure using codeunit 419.

Well I need know how register my codeunit on windows server 2012 R2, and how serch my DLL whe I will set a global variable.


thanks

Comments

  • ara3nara3n Member Posts: 9,255
    put your dll in addin folder in claasic/middle tier/ rtc and use it as global variable
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • iperutilityiperutility Member Posts: 18
    thanks, I did that but

    this below is my DLL, I tryed to declare one global var DotNet but I didn't find in the list and has gotten me this error

    interNET:eccezione, 'Impossibile caricare il file o l'assembly....

    , so I have tryed to put manualy :

    sgatePXY DotNet 'ClassLibrarySGATE'.SGATEProxy

    baut did'nt works.

    I have developed my DLL with Visual Studio 2013 professional using C#.

    Have you any idea?

    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Security.Cryptography;
    using System.Security.Cryptography.X509Certificates;

    namespace ClassLibrarySGATE
    {
    public class SGATEProxy
    {
    public X509Certificate certified;
    public SgateWebService ProxySgate;
    public string pathCertificati;
    public string username;
    public string password;
    public string url;

    public SGATEProxy(string pathCertificati, string url, string username, string password)
    {
    this.pathCertificati = pathCertificati;
    this.url = url;
    this.username = username;
    this.password = password;
    ProxySgate = new SgateWebService();
    }

    public bool CallSgateServer()
    {
    // Invio i certificati tramite il collegamento proxy web senza doverli registrare sul pc o server
    ProxySgate.ClientCertificates.Add(X509Certificate.CreateFromCertFile(pathCertificati + "SGATE.cer"));
    ProxySgate.ClientCertificates.Add(X509Certificate.CreateFromCertFile(pathCertificati + "GeoTrustPCA.cer"));
    ProxySgate.ClientCertificates.Add(X509Certificate.CreateFromCertFile(pathCertificati + "GeoTrustEV.cer"));
    ProxySgate.ClientCertificates.Add(new X509Certificate(pathCertificati + username, password));
    ProxySgate.Timeout = 360 * 1000;
    return false;
    }

    public tipoRispostaPresaInCaricoLotto RichiestaLotto(tipoRichiestaPresaInCaricoLotto request, int tentativo)
    {
    tipoRispostaPresaInCaricoLotto result = null;
    try
    {
    result = ProxySgate.PresaInCaricoLotto(request);
    }
    catch
    {
    if (tentativo < 5)
    result = RichiestaLotto(request, tentativo + 1);
    }
    return result;
    }

    }
    }
Sign In or Register to comment.