Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

markimvinny

Server.createobject De Uma Dll Criada Por Mim

Recommended Posts

Eu criei a dll, registrei pelo regsvr32, mas nao consigo utiliza-la...

o codigo da DLL é o seguinte:

 

Public Function CriptoSimples(Texto As String, Valor As Byte) As StringDim i As IntegerDim indchave As IntegerDim chartmp As IntegerDim Strtmp As StringDim ChaveMin As String  ChaveMin = LCase(chave)  CriptoSimples = ""  indchave = 1  For i = 1 To Len(Texto)	 chartmp = Asc(Mid(Texto, i, 1)) + Asc(Mid(ChaveMin, indchave, 1)) + Valor	 Strtmp = Strtmp & Chr$(chartmp)	 indchave = indchave + 1	 If indchave > Len(ChaveMin) Then		indchave = 1	 End If  Next i  CriptoSimples = StrtmpEnd FunctionPublic Function DesCriptoSimples(Texto As String, Valor As Byte) As StringDim i As IntegerDim indchave As IntegerDim chartmp As IntegerDim Strtmp As StringDim ChaveMin As String  ChaveMin = LCase(chave)  DesCriptoSimples = ""  indchave = 1  For i = 1 To Len(Texto)	 chartmp = Asc(Mid(Texto, i, 1)) - Asc(Mid(ChaveMin, indchave, 1)) - Valor	 Strtmp = Strtmp & Chr$(chartmp)	 indchave = indchave + 1	 If indchave > Len(ChaveMin) Then		indchave = 1	 End If  Next i  DesCriptoSimples = StrtmpEnd Function
O nome do projeto é CriptoASP e o nome da Class é clsCryptASP e ai depois que criei esse codigo, no VB6.0(SP5), criei a DLL clicando em File->Make CriptoASP.dll...

 

depois colei o arquivo no diretorio systen32 e no CMD dei o comando:

C:\>regsvr32 CriptoASP.dll
e apareceu o alert dizendo que foi registrado com sucesso.

 

Depois criei o codigo em asp, que é o seguinte:

<html><head><title>Criptografia</title></head><body bgcolor="#FFFFFF" text="#000000"><center><%set objCrypt = server.CreateObject("CriptoASP.clsCryptASP")teste = objCrypt.CriptoSimples("senha",0)response.write teste&"<br>"response.write objCrypt.DesCriptoSimples(teste,0)%></form></center></body></html>
só que a pagina está retornando o seguinte erro:

Error Type:CriptoASP (0x800A0005)Invalid procedure call or argument/teste.asp, line 9
será que alguem pode me ajudar a fazer essa DLL funcionar???

 

abraços!

e obrigado desde já!!! hehehe

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.