Visual Basic - me pueden a ayudar a pasar esta funcion a VB ya actualmente esta en c#

Life is soft - evento anual de software empresarial
 
Vista:

me pueden a ayudar a pasar esta funcion a VB ya actualmente esta en c#

Publicado por D.GF (1 intervención) el 13/05/2019 20:39:12
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Security.Cryptography;
using System.IO;
 
 
namespace ConsoleApp3
{
    class Program
    {
        static void Main()
        {
            string retorno;
            string nombre = "";
            retorno = Encrypt(nombre);
            Console.WriteLine("Valor DESPUES de encriptar es " + retorno);
            Console.ReadKey();
        }
 
        public static string Encrypt(string clearText)
        {
            string EncryptionKey = "";
            byte[] clearBytes = Encoding.Unicode.GetBytes(clearText);
            using (Aes encryptor = Aes.Create())
            {
                Rfc2898DeriveBytes pdb = new Rfc2898DeriveBytes(EncryptionKey, new byte[] { 0x49, 0x76, 0x61, 0x6e, 0x20, 0x4d, 0x65, 0x64, 0x76, 0x65, 0x64, 0x65, 0x76 }, 1000);
                encryptor.Key = pdb.GetBytes(32);
                encryptor.IV = pdb.GetBytes(16);
                using (MemoryStream ms = new MemoryStream())
                {
                    using (CryptoStream cs = new CryptoStream(ms, encryptor.CreateEncryptor(), CryptoStreamMode.Write))
                    {
                        cs.Write(clearBytes, 0, clearBytes.Length);
                        cs.Close();
                    }
                    clearText = Convert.ToBase64String(ms.ToArray());
                }
            }
            return clearText;
        }
 
    }
}
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
sin imagen de perfil
Val: 250
Ha mantenido su posición en Visual Basic (en relación al último mes)
Gráfica de Visual Basic

me pueden a ayudar a pasar esta funcion a VB ya actualmente esta en c#

Publicado por Cesar (123 intervenciones) el 13/05/2019 20:45:20
Hola.

No dupliques temas.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
sin imagen de perfil
Val: 109
Ha aumentado 1 puesto en Visual Basic (en relación al último mes)
Gráfica de Visual Basic

me pueden a ayudar a pasar esta funcion a VB ya actualmente esta en c#

Publicado por Yamil Bracho (226 intervenciones) el 13/05/2019 20:52:37
Code Converter
http://converter.telerik.com/
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar