Torna indietro   Hardware Upgrade Forum > Software > Programmazione

Gigabyte MO32U24 OLED: il 4K a 240Hz su un pannello OLED ideale per il gaming
Gigabyte MO32U24 OLED: il 4K a 240Hz su un pannello OLED ideale per il gaming
Pannello QD-OLED da 32 pollici con risoluzione 4K, frequenza di aggiornamento a 240Hz e tempi di risposta rapidissimi: il Gigabyte MO32U24 evolve il progetto del suo predecessore MO32U e alza ulteriormente l'asticella delle prestazioni. È ancora una volta un monitor indirizzato ai giocatori più esigenti
Recensione realme 16 5G: lo smartphone con Selfie Mirror ha una batteria da 6550mAh
Recensione realme 16 5G: lo smartphone con Selfie Mirror ha una batteria da 6550mAh
realme 16 5G è un nuovo smartphone con sensore Sony IMX 852 da 50MP sul retro e uno specchio selfie fisico integrato nella camera bar, una prima nel segmento di mercato. Batteria da 6550mAh in un corpo da 8,1mm e 183g, certificazione IP69K e ricarica da 45W completano un pacchetto aggressivo per la fascia media, per uno dei prodotti più interessanti del produttore sul piano commerciale
Come rispettare tutte le nuove regole per i monopattini elettrici? La guida per non rischiare sanzioni
Come rispettare tutte le nuove regole per i monopattini elettrici? La guida per non rischiare sanzioni
Sono ormai definitive le nuove norme del Codice della Strada per i monopattini elettrici. Non solo targa e assicurazione, le regole sono tante e riguardano diversi aspetti, vi spieghiamo come evitare sanzioni che possono essere salate
Tutti gli articoli Tutte le news

Vai al Forum
Rispondi
 
Strumenti
Old 17-02-2011, 13:08   #1
2oceano
Junior Member
 
Iscritto dal: Feb 2011
Messaggi: 1
encrypt per Access in visualbasic

Ciao Ragazzi sono nuovo e spero di non sbagliare sezione o impostazione del messaggio,

Vi spiego il mio problema, ho utilizzato un codice che mi permette di criptare e decriptare uno specifico campo, funziona perfettamente ma l'unico inconveniente è che nel criptare il campo utilizza codici asci ad esempio codificando un codice fiscale mi dà come risultato
¸©ª¬´©™–g¸—–©––˜¸ siccome lo esporto in xml nell'importazione non riconoscono questi caratteri e creano problemi di accettazione.

vi è un modo che permetta di codificare con caratteri "non ascii"? ho provato a cercare altri comandi da sostituire ad ASC ma non penso che sia questo il problema,
spero di essere stato chiaro vi incollo il codice per vedere se si può modificare per ottenere il risultato richiesto.

grazie a tutti

Codice:
    Option Compare Database
    Option Explicit
    Const PASSWORD_KEY = "f"
    'modificare la chiave con una a piacimento

    '================================================
    ' Function: encrypt
    '
    ' Purpose: To encrypt or decrypt a string using
    ' a predefined key value stored as
    ' the constant PASSWORD_KEY. The same
    ' string encrypted twice won't always
    ' look the same because the function
    ' chooses a random starting position
    ' within the key to encrypt values.
    '
    ' Call: gResult = encryt("Hello World", true)
    '
    ' In: strFull - String containing the
    ' text to encrypt/decrypt
    '
    ' fEncrypt - Boolean set to TRUE to
    ' encrypt the string, FALSE
    ' to decrypt it.
    '
    ' Out: none
    '
    ' Returns: String - The encrypted/decrypted
    ' value if successful, ""
    ' otherwise
    '
    ' History: 98/06/10 created by Dima Mnushkin
    '
    '================================================
    Public Function encrypt(strFull As String, _
    fEncrypt As Boolean) As String
    On Error GoTo Err_encrypt

    Dim intInputPos As Integer
    Dim intPassKeyPos As Integer
    Dim strOutput As String
    Dim intTemp As Integer
    Dim strStartingPos As String

    If strFull = "" Then GoTo Exit_encrypt

    ' Encrypt a value
    If fEncrypt Then
    ' Initialize the random function
    Randomize

    ' Determine the starting position to use in
    ' the encryption string
    intPassKeyPos = Int(Len(PASSWORD_KEY) * _
    Rnd + 1)

    ' Encrypt the starting position used in
    ' preparation to storing it in the middle of
    ' the encrypted result
    intTemp = intPassKeyPos + _
    Asc(Left(PASSWORD_KEY, 1))
    If intTemp > 255 Then intTemp = intTemp - 255
    strStartingPos = Chr(intTemp)

    ' Encrypt the full string
    For intInputPos = 1 To Len(strFull)
    intPassKeyPos = intPassKeyPos + 1

    ' Wrap to the beginning of the key if we have
    ' have used up the last character.
    If intPassKeyPos > Len(PASSWORD_KEY) Then
    intPassKeyPos = 1
    End If

    ' Add the value of the character to be
    ' encrypted to the value of the character
    ' stored at the current position in the key
    intTemp = Asc(Mid(strFull, intInputPos, 1) _
    ) + Asc(Mid(PASSWORD_KEY, _
    intPassKeyPos, 1))
    If intTemp > 255 Then intTemp = intTemp - 255

    ' If we are at middle of the result string,
    ' insert our encrypted starting position so
    ' we can decrypt this string later.
    If CInt(Len(strFull) / 2) + 1 = intInputPos _
    Then strOutput = strOutput & strStartingPos

    strOutput = strOutput & Chr(intTemp)

    Next intInputPos

    ' Decrypt a value
    Else
    ' Retrieve the encrypted starting position from
    ' the middle of the string to be decrypted
    intPassKeyPos = Asc(Mid(strFull, _
    CInt((Len(strFull) - 1) / 2) + 1, 1)) - _
    Asc(Left(PASSWORD_KEY, 1))

    If intPassKeyPos < 0 Then _
    intPassKeyPos = intPassKeyPos + 255

    ' Decrypt the full string
    For intInputPos = 1 To Len(strFull)
    intPassKeyPos = intPassKeyPos + 1

    If intPassKeyPos > Len(PASSWORD_KEY) Then _
    intPassKeyPos = 1

    ' Decrypt each character by subtracting the
    ' value of the corresponding character stored
    ' in the key.
    intTemp = Asc(Mid(strFull, intInputPos, 1)) - _
    Asc(Mid(PASSWORD_KEY, intPassKeyPos, 1))

    If intTemp <= 0 Then intTemp = intTemp + 255

    ' If we are looking at the middle character,
    ' ignore it since its the encrypted starting
    ' position.
    If intInputPos = CInt((Len(strFull) - 1) / 2) + _
    1 Then
    intPassKeyPos = intPassKeyPos - 1

    Else
    strOutput = strOutput & Chr(intTemp)

    End If

    Next intInputPos

    End If

    encrypt = strOutput

    Exit_encrypt:
    Exit Function

    Err_encrypt:
    encrypt = ""
    MsgBox Error
    Resume Exit_encrypt

    End Function
2oceano è offline   Rispondi citando il messaggio o parte di esso
 Rispondi


Gigabyte MO32U24 OLED: il 4K a 240Hz su un pannello OLED ideale per il gaming Gigabyte MO32U24 OLED: il 4K a 240Hz su un panne...
Recensione realme 16 5G: lo smartphone con Selfie Mirror ha una batteria da 6550mAh Recensione realme 16 5G: lo smartphone con Selfi...
Come rispettare tutte le nuove regole per i monopattini elettrici? La guida per non rischiare sanzioni Come rispettare tutte le nuove regole per i mono...
DLSS 4.5: con Dynamic Frame Generation e MFG 6X NVIDIA alza la posta DLSS 4.5: con Dynamic Frame Generation e MFG 6X ...
Plaud NotePin S, il registratore IA si fa indossabile (ma è facile da perdere) Plaud NotePin S, il registratore IA si fa indoss...
Intel prepara 'Raptor Lake Next'? Nel 20...
Una telefonata del CEO di Amazon dietro ...
Grazie a GLIMPSE-17775 il telescopio spa...
Samsung Galaxy A27 5G è ufficiale...
TCL aggiorna la sua gamma di monitor per...
Anche OPPO avrà uno smartphone co...
La Radeon RX 9070 XT appare su Steam e m...
L'America si ribella ai datacenter: bloc...
'Artificial General Engineer': l'IA di J...
Il drone NASA Dragonfly, che voler&agrav...
Stop immediato a Fable 5 e Mythos 5: il ...
"Prime Day Amazon il 23-26 giugno": sì e...
Oggi 2 super MacBook Pro M5 e M5 Pro, 24...
Tineco Floor One Station S9 Artist: il s...
Raggiunte nuove altitudine e velocit&agr...
Chromium
GPU-Z
OCCT
LibreOffice Portable
Opera One Portable
Opera One 106
CCleaner Portable
CCleaner Standard
Cpu-Z
Driver NVIDIA GeForce 546.65 WHQL
SmartFTP
Trillian
Google Chrome Portable
Google Chrome 120
VirtualBox
Tutti gli articoli Tutte le news Tutti i download

Strumenti

Regole
Non Puoi aprire nuove discussioni
Non Puoi rispondere ai messaggi
Non Puoi allegare file
Non Puoi modificare i tuoi messaggi

Il codice vB è On
Le Faccine sono On
Il codice [IMG] è On
Il codice HTML è Off
Vai al Forum


Tutti gli orari sono GMT +1. Ora sono le: 07:40.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Served by www3v