Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- Exemplo de uso da DLL SismaisERPLib no Python
- """
- import sys
- import os
- import ctypes
- def main():
- path = os.path.dirname(os.path.realpath(__file__))
- is_64bits = sys.maxsize > 2**32
- if is_64bits:
- #dll_name = 'D:\\Sismais\\SismaisERPLib\\SismaisERPLibx64.dll'
- dll_name = path + '\SismaisERPLibx64.dll'
- else:
- dll_name = 'D:\\Sismais\\SismaisERPLib\\SismaisERPLibx32.dll'
- dll = ctypes.windll.LoadLibrary(dll_name)
- funcao = dll.EncryptUserPassword
- funcao.restype = ctypes.c_wchar_p
- funcao.argtypes = [ctypes.c_wchar_p, ctypes.c_wchar_p]
- #usuario = ctypes.c_wchar_p('usuario')
- #senha = ctypes.c_wchar_p('senha')
- #r = funcao(_usuario, _senha)
- r = funcao('usuario', 'senha')
- # resultado esperado:
- if r == 'senha_criptografada':
- print('Retorno da função EncryptUserPassword está correto:')
- else:
- print('Retorno da função EncryptUserPassword está ERRADO!')
- print(r)
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement