14 Mai 2019 08:40
14 Mai 2019 13:50
#include "FiveWin.ch"
function Main()
FW_DotNet( "test.dll", "dllNamespace.dllClass", "ShowMsg", "C# from FWH" )
FW_DotNet( "test.dll", "dllNamespace.dllClass", "ShowMsg", "yes!!!" )
return nil
14 Mai 2019 13:59
14 Mai 2019 14:16
14 Mai 2019 14:27
André Corrêa escreveu:A CAPICOM ainda funciona, mas foi descontinuada há muito tempo e não possui alguns recursos interessantes,como a possibilidade de acessar um certificado em nuvem.
14 Mai 2019 15:19
JoséQuintas escreveu:André Corrêa escreveu:A CAPICOM ainda funciona, mas foi descontinuada há muito tempo e não possui alguns recursos interessantes,como a possibilidade de acessar um certificado em nuvem.
Tem certeza?
14 Mai 2019 16:22
André Corrêa escreveu:Não totalmente. Acredita que haja essa possibilidade com CAPICOM?
15 Mai 2019 09:14
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;
namespace TesteCSharpHarbour
{
[ClassInterface(ClassInterfaceType.AutoDual)]
[ProgId("TesteCSharpHarbour.Teste")]
[ComVisible(true)]
public class Teste
{
public Teste() { }
public String[] ListaCertificados()
{
X509Store stores = new X509Store(StoreName.My, StoreLocation.CurrentUser);
String[] listaDeCertificados;
int contador = 0;
try
{
// Abre o Store
stores.Open(OpenFlags.ReadOnly);
// Obtém a coleção dos certificados da Store
X509Certificate2Collection certificados = stores.Certificates;
listaDeCertificados = new String[certificados.Count];
// percorre a coleção de certificados
foreach (X509Certificate2 certificado in certificados)
{
listaDeCertificados[contador] = certificado.ToString();
contador++;
}
return listaDeCertificados;
}
finally
{
stores.Close();
}
}
}
}
LOCAL oDotNetDll
LOCAL a01
TRY
oDotNetDll := GetActiveObject( "TesteCSharpHarbour.Teste" )
CATCH
TRY
oDotNetDll := CreateObject( "TesteCSharpHarbour.Teste" )
CATCH
Alert( Ole2TxtError() )
RETURN .F.
END
END
a01 := oDotNetDll:ListaCertificados()
LogDebug( a01 )
15 Mai 2019 10:26