All pastes #431317 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-04-09 16:15 UTC
rendered paste body
Imports System.IO.Ports
Imports System.Text

Public Class Form1

    

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        'setting port stuff
        Dim comport As New IO.Ports.SerialPort
        Dim i As String
        comport.PortName = "COM3"
        comport.DataBits = 8
        comport.StopBits = 1
        comport.Parity = Parity.None
        comport.BaudRate = 115200
        comport.WriteBufferSize = 65536
        comport.ReadBufferSize = 65536
        comport.WriteTimeout = 10000
        comport.ReadTimeout = 10000
        comport.Open()
        comport.Write("ATZ" + Chr(13))
        i = comport.ReadLine.ToString
        i = i + comport.ReadLine.ToString
        comport.Write("AT+CMGF=1" + Chr(13))
        i = i + comport.ReadLine.ToString
        i = i + comport.ReadLine.ToString
        comport.Write("AT+CMGS=" + Chr(34) + "919446628" + Chr(34) + Chr(13))
        i = i + comport.ReadLine.ToString
        'i = comport.ReadLine
        comport.Write("just testing this piece of shitz0rz" + Chr(13))
        i = i + comport.ReadLine.ToString
        ' i = comport.ReadLine
        comport.Write(Chr(13))
        i = i + comport.ReadLine.ToString
        ' i = comport.ReadLine
        comport.Write(Chr(26))
        i = i + comport.ReadLine.ToString
        i = i + comport.ReadLine.ToString
        'i = comport.ReadLine
        'MsgBox(comport.ReadExisting)

        comport.Close()
        TextBox1.Text = i
    End Sub
End Class