Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes Menú
Imports System.IO.Ports
Imports System.Threading
Public Class Form1
Sub enviarSMS(ByVal numero As String, ByVal mensaje As String, ByVal puerto As String)
Dim serialport As IO.Ports.SerialPort
Try
serialport = New IO.Ports.SerialPort
With serialport
.PortName = puerto ' Puerto de comunicaciones COM1, COM2...
.BaudRate = 9600 ' velocidad del puerto
.Parity = Parity.None ' Paridad
.StopBits = StopBits.One ' Bit de para
.DataBits = 8 ' Bits de datos
If .IsOpen = False Then ' Si el puerto no esta abierto
.Open() ' Abrir el puerto
End If
.Write("ATZ0" & vbCr)
.WriteLine("AT+CMGF=1" & vbCr) ' Configurando envio de SMS modo texto
Thread.Sleep(1000) ' Esperar 1 segundo
.Write("AT+CMGS=" & Chr(34) & numero & Chr(34) & vbCr) ' Numero al que se envia el SMS
.Write(mensaje & Chr(26) & vbCr)
Thread.Sleep(1000) ' Esperar 1 segundo
.Close()
MsgBox("Mensaje enviado")
End With
Catch Ex As IO.IOException
Console.WriteLine(Ex.Message)
End Try
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
enviarSMS("+595971888222", "Mensaje de prueba", "COM19")
End Sub
End Class
Sub xSave()
'-------------------ESTE ES EL PROBLEMA-------------------------------------------------------
Dim xStream As New MemoryStream
PictureBox1.Image.Save(xStream, System.Drawing.Imaging.ImageFormat.Jpeg)
Dim breader As New BinaryReader(xStream)
Dim imgbuffer(xStream.Length) As Byte
breader.Read(imgbuffer, 0, xStream.Length)
xStream.Close()
'----------------------------------------------------------------------------------------------------
strSQL = "INSERT INTO juegos (titulo,imagen) VALUES (@titulo,@imagen)"
strComando.CommandText = strSQL
strComando.Connection = strConexion
strComando.Parameters.AddWithValue("@titulo", txtTitulo.Text)
strComando.Parameters.AddWithValue("@imagen", imgbuffer)
strComando.ExecuteNonQuery()
strComando.Dispose()
MsgBox("Saved")
End Sub
ImageList1.Images.Add(dtEmp.Rows(i)("id").ToString(), New Bitmap(img_stream))
Dim fsreader As New FileStream("c:\xxx\4zm.jpg", FileMode.Open, FileAccess.Read)
Dim breader As New BinaryReader(fsreader)
Dim imgbuffer(fsreader.Length) As Byte
breader.Read(imgbuffer, 0, fsreader.Length)
fsreader.Close()
imglist.Images.Add(dtEmp.Rows(i)("id").ToString(), Image.FromFile("c:\xxx\4zm.jpg"))
Sub RECUPERAR()
ImageList1 = New ImageList
ImageList1.ImageSize = New Size(100, 100)
ImageList1.ColorDepth = ColorDepth.Depth32Bit
LF.LargeImageList = ImageList1
LF.Items.Clear()
strSQL = "SELECT * FROM juegos"
Dim daEmp As New OleDbDataAdapter(strSQL, strConexion)
Dim dtEmp As New DataTable
daEmp.Fill(dtEmp)
For i = 0 To dtEmp.Rows.Count - 1
Dim img_buffer As Byte()
img_buffer = DirectCast(dtEmp.Rows(i)("imagen"), Byte())
Dim img_stream As New MemoryStream(img_buffer, True)
img_stream.Write(img_buffer, 0, img_buffer.Length)
ImageList1.Images.Add(dtEmp.Rows(i)("id").ToString(), New Bitmap(img_stream))
img_stream.Close()
Dim item As New ListViewItem(Strings.Left(dtEmp.Rows(i)("titulo").ToString, xTitulo))
item.SubItems.Add(dtEmp.Rows(i)("plataforma").ToString)
item.ImageKey = dtEmp.Rows(i)("id").ToString
LF.Items.Add(item)
Next i
End Sub
Dim fsreader As New FileStream("c:\carpeta\foto1.jpg", FileMode.Open, FileAccess.Read)
Dim breader As New BinaryReader(fsreader)
Dim imgbuffer(fsreader.Length) As Byte
breader.Read(imgbuffer, 0, fsreader.Length)
fsreader.Close()
'closes the current stream and releases any resources
strSQL = "INSERT INTO juegos (titulo,imagen) values (@titulo,@imagen)"
strComando.CommandText = strSQL
strComando.Connection = strConexion
strComando.Parameters.AddWithValue("@titulo", "nuevo metodo")
strComando.Parameters.AddWithValue("@imagen", imgbuffer)
strComando.ExecuteNonQuery()
strComando.Dispose()
MsgBox("Saved")
If Clipboard.GetDataObject.GetDataPresent("Bitmap") Then
PictureBox1.Image = CType(Clipboard.GetDataObject.GetData("Bitmap"), Bitmap)
End If
Dim fsreader As New FileStream("el-problema-esta-aca-que-poner", FileMode.Open, FileAccess.Read)