textbox1.Text = textbox1.Text.Insert(0, "Iniciando captura " & i & Environment.NewLine)
viernes, 23 de junio de 2017
Insert texto siempre al principio de un textbox
lunes, 19 de junio de 2017
Warning IPHostEntry, GetHostByName is obsoleted
Dim ipv4Addresses As IPAddress() = Array.FindAll(Dns.GetHostEntry(String.Empty).AddressList, Function(a) a.AddressFamily = AddressFamily.InterNetwork) fuente: https://stackoverflow.com/questions/1059526/get-ipv4-addresses-from-dns-gethostentry
Etiquetas:
GetHostByName,
GetHostEntry,
IPHostEntry
lunes, 5 de junio de 2017
Serialización de una lista de enteros
Imports System.Runtime.Serialization.Formatters.Binary Imports System.IO Imports System.Runtime.Serialization Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim lista As New List(Of Integer) For i As Integer = 0 To 9 lista.Add(i + 1) Next Dim bin As New BinaryFormatter Dim mStream As New MemoryStream bin.Serialize(mStream, lista) lista.Clear() ' Para comprobar que se está serializando mStream.Close() Try Dim ms As Stream = New MemoryStream(mStream.ToArray) Dim myList As List(Of Integer) = DirectCast(bin.Deserialize(ms), List(Of Integer)) For i As Integer = 0 To 9 MessageBox.Show(myList(i)) Next ms.Close() Catch ex As Exception MessageBox.Show(ex.ToString) End Try End Sub
Etiquetas:
BinaryFormatter,
Deserialize,
DirectCast,
MemoryStream,
serializacion,
Serialize
viernes, 2 de junio de 2017
Transformar una lista de strings a un array de bytes
Dim dataAsBytes As Byte() = email.SelectMany(Function(s) System.Text.Encoding.UTF8.GetBytes(s)).ToArray()
Etiquetas:
Encoding,
GetBytes,
SelectMany
jueves, 1 de junio de 2017
Resetear la columna identidad
--Primero se deben borrar todos los registros
DELETE FROM buzon_in
USE [BD]
DBCC CHECKIDENT ('[buzon_in]',RESEED,0) --buzon_in es el nombre de la tabla
DELETE FROM buzon_in
USE [BD]
DBCC CHECKIDENT ('[buzon_in]',RESEED,0) --buzon_in es el nombre de la tabla
Suscribirse a:
Entradas (Atom)