Imports System.Net
Imports System.web
Imports System.io
Imports System.Data.OracleClient
Imports System.Drawing
Public Class smssender
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox
Friend WithEvents GroupBox3 As System.Windows.Forms.GroupBox
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents txtmodtager As System.Windows.Forms.TextBox
Friend WithEvents txtafsender As System.Windows.Forms.TextBox
Friend WithEvents txtbesked As System.Windows.Forms.TextBox
Friend WithEvents GroupBox4 As System.Windows.Forms.GroupBox
Friend WithEvents cmbGrupper As System.Windows.Forms.ComboBox
Friend WithEvents listgruppemedlemmer As System.Windows.Forms.ListView
Friend WithEvents Navn As System.Windows.Forms.ColumnHeader
Friend WithEvents Mobilnummer As System.Windows.Forms.ColumnHeader
Friend WithEvents GroupBox5 As System.Windows.Forms.GroupBox
Friend WithEvents addname As System.Windows.Forms.TextBox
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents addnummer As System.Windows.Forms.TextBox
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Button3 As System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(smssender))
Me.txtmodtager = New System.Windows.Forms.TextBox
Me.GroupBox1 = New System.Windows.Forms.GroupBox
Me.GroupBox2 = New System.Windows.Forms.GroupBox
Me.txtafsender = New System.Windows.Forms.TextBox
Me.GroupBox3 = New System.Windows.Forms.GroupBox
Me.txtbesked = New System.Windows.Forms.TextBox
Me.Button1 = New System.Windows.Forms.Button
Me.Button2 = New System.Windows.Forms.Button
Me.GroupBox4 = New System.Windows.Forms.GroupBox
Me.listgruppemedlemmer = New System.Windows.Forms.ListView
Me.Navn = New System.Windows.Forms.ColumnHeader
Me.Mobilnummer = New System.Windows.Forms.ColumnHeader
Me.cmbGrupper = New System.Windows.Forms.ComboBox
Me.GroupBox5 = New System.Windows.Forms.GroupBox
Me.addname = New System.Windows.Forms.TextBox
Me.Label1 = New System.Windows.Forms.Label
Me.addnummer = New System.Windows.Forms.TextBox
Me.Label2 = New System.Windows.Forms.Label
Me.Button3 = New System.Windows.Forms.Button
Me.GroupBox1.SuspendLayout()
Me.GroupBox2.SuspendLayout()
Me.GroupBox3.SuspendLayout()
Me.GroupBox4.SuspendLayout()
Me.GroupBox5.SuspendLayout()
Me.SuspendLayout()
'
'txtmodtager
'
Me.txtmodtager.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.txtmodtager.Location = New System.Drawing.Point(8, 16)
Me.txtmodtager.MaxLength = 8
Me.txtmodtager.Name = "txtmodtager"
Me.txtmodtager.Size = New System.Drawing.Size(176, 20)
Me.txtmodtager.TabIndex = 0
Me.txtmodtager.Text = ""
'
'GroupBox1
'
Me.GroupBox1.Controls.Add(Me.txtmodtager)
Me.GroupBox1.Location = New System.Drawing.Point(8, 8)
Me.GroupBox1.Name = "GroupBox1"
Me.GroupBox1.Size = New System.Drawing.Size(192, 42)
Me.GroupBox1.TabIndex = 1
Me.GroupBox1.TabStop = False
Me.GroupBox1.Text = "Modtager"
'
'GroupBox2
'
Me.GroupBox2.Controls.Add(Me.txtafsender)
Me.GroupBox2.Location = New System.Drawing.Point(8, 56)
Me.GroupBox2.Name = "GroupBox2"
Me.GroupBox2.Size = New System.Drawing.Size(192, 42)
Me.GroupBox2.TabIndex = 2
Me.GroupBox2.TabStop = False
Me.GroupBox2.Text = "Afsender"
'
'txtafsender
'
Me.txtafsender.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.txtafsender.Location = New System.Drawing.Point(8, 16)
Me.txtafsender.MaxLength = 10
Me.txtafsender.Name = "txtafsender"
Me.txtafsender.Size = New System.Drawing.Size(176, 20)
Me.txtafsender.TabIndex = 0
Me.txtafsender.Text = ""
'
'GroupBox3
'
Me.GroupBox3.Controls.Add(Me.txtbesked)
Me.GroupBox3.Location = New System.Drawing.Point(8, 104)
Me.GroupBox3.Name = "GroupBox3"
Me.GroupBox3.Size = New System.Drawing.Size(192, 176)
Me.GroupBox3.TabIndex = 3
Me.GroupBox3.TabStop = False
Me.GroupBox3.Text = "Besked"
'
'txtbesked
'
Me.txtbesked.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.txtbesked.Location = New System.Drawing.Point(8, 16)
Me.txtbesked.Multiline = True
Me.txtbesked.Name = "txtbesked"
Me.txtbesked.Size = New System.Drawing.Size(176, 152)
Me.txtbesked.TabIndex = 0
Me.txtbesked.Text = ""
'
'Button1
'
Me.Button1.Image = CType(resources.GetObject("Button1.Image"), System.Drawing.Image)
Me.Button1.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.Button1.Location = New System.Drawing.Point(108, 284)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(92, 42)
Me.Button1.TabIndex = 4
Me.Button1.Text = "Send"
'
'Button2
'
Me.Button2.Image = CType(resources.GetObject("Button2.Image"), System.Drawing.Image)
Me.Button2.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.Button2.Location = New System.Drawing.Point(8, 284)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(92, 42)
Me.Button2.TabIndex = 5
Me.Button2.Text = "Nulstil"
'
'GroupBox4
'
Me.GroupBox4.Controls.Add(Me.listgruppemedlemmer)
Me.GroupBox4.Controls.Add(Me.cmbGrupper)
Me.GroupBox4.Location = New System.Drawing.Point(208, 8)
Me.GroupBox4.Name = "GroupBox4"
Me.GroupBox4.Size = New System.Drawing.Size(304, 272)
Me.GroupBox4.TabIndex = 6
Me.GroupBox4.TabStop = False
Me.GroupBox4.Text = "Gruppe besked"
'
'listgruppemedlemmer
'
Me.listgruppemedlemmer.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.listgruppemedlemmer.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.Navn, Me.Mobilnummer})
Me.listgruppemedlemmer.Location = New System.Drawing.Point(8, 48)
Me.listgruppemedlemmer.Name = "listgruppemedlemmer"
Me.listgruppemedlemmer.Size = New System.Drawing.Size(287, 216)
Me.listgruppemedlemmer.TabIndex = 2
Me.listgruppemedlemmer.View = System.Windows.Forms.View.Details
'
'cmbGrupper
'
Me.cmbGrupper.Location = New System.Drawing.Point(8, 16)
Me.cmbGrupper.Name = "cmbGrupper"
Me.cmbGrupper.Size = New System.Drawing.Size(288, 21)
Me.cmbGrupper.TabIndex = 1
'
'GroupBox5
'
Me.GroupBox5.Controls.Add(Me.Button3)
Me.GroupBox5.Controls.Add(Me.addname)
Me.GroupBox5.Controls.Add(Me.addnummer)
Me.GroupBox5.Controls.Add(Me.Label2)
Me.GroupBox5.Controls.Add(Me.Label1)
Me.GroupBox5.Location = New System.Drawing.Point(208, 280)
Me.GroupBox5.Name = "GroupBox5"
Me.GroupBox5.Size = New System.Drawing.Size(304, 48)
Me.GroupBox5.TabIndex = 7
Me.GroupBox5.TabStop = False
Me.GroupBox5.Text = "Tilføj nummer til gruppe"
'
'addname
'
Me.addname.AutoSize = False
Me.addname.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.addname.Location = New System.Drawing.Point(48, 19)
Me.addname.Name = "addname"
Me.addname.Size = New System.Drawing.Size(56, 20)
Me.addname.TabIndex = 1
Me.addname.Text = ""
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(8, 22)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(32, 16)
Me.Label1.TabIndex = 2
Me.Label1.Text = "Navn"
'
'addnummer
'
Me.addnummer.AutoSize = False
Me.addnummer.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.addnummer.Location = New System.Drawing.Point(160, 19)
Me.addnummer.Name = "addnummer"
Me.addnummer.Size = New System.Drawing.Size(64, 20)
Me.addnummer.TabIndex = 3
Me.addnummer.Text = ""
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(112, 22)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(52, 16)
Me.Label2.TabIndex = 4
Me.Label2.Text = "Nummer"
'
'Button3
'
Me.Button3.Image = CType(resources.GetObject("Button3.Image"), System.Drawing.Image)
Me.Button3.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.Button3.Location = New System.Drawing.Point(232, 16)
Me.Button3.Name = "Button3"
Me.Button3.Size = New System.Drawing.Size(64, 26)
Me.Button3.TabIndex = 5
Me.Button3.Text = " Tilføj"
'
'smssender
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.BackColor = System.Drawing.SystemColors.Window
Me.ClientSize = New System.Drawing.Size(520, 334)
Me.Controls.Add(Me.GroupBox5)
Me.Controls.Add(Me.GroupBox4)
Me.Controls.Add(Me.Button2)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.GroupBox1)
Me.Controls.Add(Me.GroupBox2)
Me.Controls.Add(Me.GroupBox3)
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "smssender"
Me.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "SMS-Sender"
Me.GroupBox1.ResumeLayout(False)
Me.GroupBox2.ResumeLayout(False)
Me.GroupBox3.ResumeLayout(False)
Me.GroupBox4.ResumeLayout(False)
Me.GroupBox5.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub
#End Region
Public Function SendSMS()
Dim modtager As String = txtmodtager.Text
Dim afsender As String = txtafsender.Text
Dim besked As String = txtbesked.Text
Dim url As String = ""
'Dim url As String = "
http://s1.tge.dk:8080/ComSMS/Sender?msg=" & HttpUtility.UrlEncode(besked) & "&rec=" & modtager & "&sapid=274&oadc=" & afsender & ""
Dim req As HttpWebRequest = CType(WebRequest.Create(url), HttpWebRequest)
Dim resp As HttpWebResponse = CType(req.GetResponse, HttpWebResponse)
Dim stmrdr As StreamReader = New StreamReader(resp.GetResponseStream)
Dim html = stmrdr.ReadToEnd
stmrdr.Close()
resp.Close()
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
SendSMS()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
txtmodtager.Text = ""
txtafsender.Text = ""
txtbesked.Text = ""
End Sub
Private Sub smssender_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
cmbGrupper.Visible = False
Dim ds As DataSet = Util.FillDataSet("select * from smsgrupper", "SMSGrupper")
With cmbGrupper
.DataSource = ds.Tables("SMSGrupper")
.DisplayMember = "GRUPPENAVN"
.ValueMember = "GRUPPEID".Trim
End With
txtmodtager.Text = CType(cmbGrupper.SelectedValue, String)
cmbGrupper.SelectedIndex = 0
cmbGrupper.Visible = True
End Sub
End Class