Csharp - Convertir de tipo byte[] a string

Written by lopezatienza on 28 Octubre 2008 – 13:41 -

Para convertir de tipo Array de byte[] a string debemos utilizar la clase System.Text, ya que tanto la clase String como la función Convert.. no permiten cambiar el tipo:

System.Text.Encoding enc = System.Text.Encoding.ASCII; 'Creamos un tipo System.Text.Encoding para poder llamar a la función
string myString = enc.GetString(myByteArray);
'Creamos un tipo string que almacenará la cadena pasada a ASCII


Tags: ,
Posted in CSharp | No Comments »

Visual Basic - Cuadro de texto personalizado

Written by lopezatienza on 24 Octubre 2008 – 16:01 -



Dim Fuente As New Font (New FontFamily(“Arial”), tamaño) 'Le damos la fuente que deseemos y el tamaño

Dim Colores As New HatchBrush(HatchBrush.FUERZA, color.Aqua, color.Green) 'Le damos el color que deseemos

   SolidBrush(color.Aqua) 'Estilo del color

   PathGradientBrush(puntos) 'Dimensiones

DrawString(texto, Fuente, Colores) 'Propiedades

DrawImage(archivoBitmap, x, y, ancho, alto)
'Lo dibujamos


Tags:
Posted in Visual Basic .NET | No Comments »

Visual Basic - System.Drawing

Written by lopezatienza on 21 Octubre 2008 – 17:35 -


Graphics 'Especifica el entorno en el ke se va a dibujar el dibujo

Pen 'Que tipo de trazo se utilizara para dibujar

Brush 'Tipo de color y relleno que vamos a usar

Dim grafico As Graphics = me.graphics

Dim lapiz As New Pen(color, grosor)

Dim rectangulo As New Rectangle(x1,y1,x2,y2) 'de arriba izquierda a abajoderecha

Read more »


Tags:
Posted in Visual Basic .NET | No Comments »

Visual Basic - Archivos

Written by lopezatienza on 11 Octubre 2008 – 18:30 -


Unidades de almacenamiento:

System Environment.GetlogicalDrives 'Recorrer unidades logicas del sistema

Dim unidades() As String 'Se crea un array tipo string para contener las unidades

unidades = System Environment.GetlogicalDrives 'Se toman las unidades del sistema

Read more »


Tags:
Posted in Visual Basic .NET | No Comments »

Visual Basic - Recursividad

Written by lopezatienza on 11 Octubre 2008 – 17:44 -


1. DOS VALORES ENTEROS SON O NO IGUALES

Public Class Form1

Function iguales(ByVal x As Integer, ByVal y As Integer) As Boolean

If x = y Then

Return True

Read more »


Tags:
Posted in Visual Basic .NET | No Comments »
RSS