Imports OpenControl.PhoneLib
Imports Microsoft.VisualBasic
Imports System.Net
Imports Microsoft.Win32
Imports System.IO.ports
Imports System.Windows.Forms
Imports System.Threading
Public Class frmOptions
Inherits System.Windows.Forms.Form
Private m_SelectionModified As Boolean = False
Private m_Loading As Boolean = False
Private m_SelectedTabIndex As Integer = 0
Private m_SelectedItemIndex As Integer = 0
Public m_VncManualStop As Boolean = False
Delegate Sub statusDelegate()
Protected stsDelegate As statusDelegate
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
End Sub
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
MyBase.Dispose(disposing)
End Sub
Friend WithEvents pbBack As System.Windows.Forms.PictureBox
Friend WithEvents btnDefaults As System.Windows.Forms.Button
Friend WithEvents PictureBox2 As System.Windows.Forms.PictureBox
Friend WithEvents Panel5 As System.Windows.Forms.Panel
Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox
Friend WithEvents Label6 As System.Windows.Forms.Label
Friend WithEvents Panel4 As System.Windows.Forms.Panel
Friend WithEvents Panel6 As System.Windows.Forms.Panel
Friend WithEvents Panel7 As System.Windows.Forms.Panel
Friend WithEvents PictureBox8 As System.Windows.Forms.PictureBox
Friend WithEvents tabDynDNS As System.Windows.Forms.TabPage
Friend WithEvents chkEnableDynDNS As System.Windows.Forms.CheckBox
Friend WithEvents Label10 As System.Windows.Forms.Label
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents Label13 As System.Windows.Forms.Label
Friend WithEvents Label11 As System.Windows.Forms.Label
Friend WithEvents txtDDNS_Domain As System.Windows.Forms.TextBox
Friend WithEvents txtDDNS_Password As System.Windows.Forms.TextBox
Friend WithEvents txtDDNS_User As System.Windows.Forms.TextBox
Friend WithEvents clmName As System.Windows.Forms.ColumnHeader
Friend WithEvents clmStatus As System.Windows.Forms.ColumnHeader
Friend WithEvents Panel1 As System.Windows.Forms.Panel
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents btnDDNS_Update As System.Windows.Forms.Button
Friend WithEvents tabMain As System.Windows.Forms.TabPage
Friend WithEvents Panel11 As System.Windows.Forms.Panel
Friend WithEvents Panel12 As System.Windows.Forms.Panel
Friend WithEvents PictureBox7 As System.Windows.Forms.PictureBox
Friend WithEvents txtWAN_Name As System.Windows.Forms.TextBox
Friend WithEvents Panel13 As System.Windows.Forms.Panel
Private WithEvents Label51 As System.Windows.Forms.Label
Friend WithEvents Panel14 As System.Windows.Forms.Panel
Friend WithEvents chkMaintainWan As System.Windows.Forms.CheckBox
Private WithEvents Label48 As System.Windows.Forms.Label
Friend WithEvents btnApplyWAN As System.Windows.Forms.Button
Friend WithEvents pnlMain As System.Windows.Forms.Panel
Friend WithEvents InputPanel1 As Microsoft.WindowsCE.Forms.InputPanel
Friend WithEvents pnlScroll As System.Windows.Forms.Panel
Friend WithEvents tabVNC As System.Windows.Forms.TabPage
Friend WithEvents btnStartStopVNC As System.Windows.Forms.Button
Friend WithEvents pnlVNC As System.Windows.Forms.Panel
Friend WithEvents txtVNCPort As System.Windows.Forms.TextBox
Friend WithEvents chkAutoStartVNC As System.Windows.Forms.CheckBox
Friend WithEvents Label9 As System.Windows.Forms.Label
Friend WithEvents Tabs As System.Windows.Forms.TabControl
Friend WithEvents ComboBox23 As System.Windows.Forms.ComboBox
Friend WithEvents TextBox21 As System.Windows.Forms.TextBox
Friend WithEvents Label21 As System.Windows.Forms.Label
Friend WithEvents Label22 As System.Windows.Forms.Label
Friend WithEvents Label23 As System.Windows.Forms.Label
Friend WithEvents Panel2 As System.Windows.Forms.Panel
Friend WithEvents Label24 As System.Windows.Forms.Label
Friend WithEvents Label25 As System.Windows.Forms.Label
Friend WithEvents Label26 As System.Windows.Forms.Label
Friend WithEvents Label27 As System.Windows.Forms.Label
Friend WithEvents Label28 As System.Windows.Forms.Label
Friend WithEvents Label29 As System.Windows.Forms.Label
Friend WithEvents Panel3 As System.Windows.Forms.Panel
Friend WithEvents Label30 As System.Windows.Forms.Label
Friend WithEvents Label31 As System.Windows.Forms.Label
Private WithEvents ListView1 As System.Windows.Forms.ListView
Friend WithEvents pnlStatus As System.Windows.Forms.Panel
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.
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmOptions))
Me.pnlStatus = New System.Windows.Forms.Panel
Me.pbBack = New System.Windows.Forms.PictureBox
Me.ComboBox23 = New System.Windows.Forms.ComboBox
Me.TextBox21 = New System.Windows.Forms.TextBox
Me.Label21 = New System.Windows.Forms.Label
Me.Label22 = New System.Windows.Forms.Label
Me.Label23 = New System.Windows.Forms.Label
Me.Panel2 = New System.Windows.Forms.Panel
Me.Label24 = New System.Windows.Forms.Label
Me.Label25 = New System.Windows.Forms.Label
Me.Label26 = New System.Windows.Forms.Label
Me.Label27 = New System.Windows.Forms.Label
Me.Label28 = New System.Windows.Forms.Label
Me.Label29 = New System.Windows.Forms.Label
Me.Panel3 = New System.Windows.Forms.Panel
Me.Label30 = New System.Windows.Forms.Label
Me.Label31 = New System.Windows.Forms.Label
Me.ListView1 = New System.Windows.Forms.ListView
Me.tabVNC = New System.Windows.Forms.TabPage
Me.Panel5 = New System.Windows.Forms.Panel
Me.PictureBox1 = New System.Windows.Forms.PictureBox
Me.Label6 = New System.Windows.Forms.Label
Me.Panel4 = New System.Windows.Forms.Panel
Me.pnlVNC = New System.Windows.Forms.Panel
Me.txtVNCPort = New System.Windows.Forms.TextBox
Me.btnStartStopVNC = New System.Windows.Forms.Button
Me.Label9 = New System.Windows.Forms.Label
Me.chkAutoStartVNC = New System.Windows.Forms.CheckBox
Me.Tabs = New System.Windows.Forms.TabControl
Me.tabMain = New System.Windows.Forms.TabPage
Me.Panel11 = New System.Windows.Forms.Panel
Me.Panel12 = New System.Windows.Forms.Panel
Me.Panel13 = New System.Windows.Forms.Panel
Me.Label51 = New System.Windows.Forms.Label
Me.PictureBox8 = New System.Windows.Forms.PictureBox
Me.Panel14 = New System.Windows.Forms.Panel
Me.btnApplyWAN = New System.Windows.Forms.Button
Me.txtWAN_Name = New System.Windows.Forms.TextBox
Me.chkMaintainWan = New System.Windows.Forms.CheckBox
Me.PictureBox7 = New System.Windows.Forms.PictureBox
Me.Label48 = New System.Windows.Forms.Label
Me.tabDynDNS = New System.Windows.Forms.TabPage
Me.Panel6 = New System.Windows.Forms.Panel
Me.Label4 = New System.Windows.Forms.Label
Me.PictureBox2 = New System.Windows.Forms.PictureBox
Me.Panel1 = New System.Windows.Forms.Panel
Me.txtDDNS_Domain = New System.Windows.Forms.TextBox
Me.txtDDNS_User = New System.Windows.Forms.TextBox
Me.txtDDNS_Password = New System.Windows.Forms.TextBox
Me.btnDDNS_Update = New System.Windows.Forms.Button
Me.Label1 = New System.Windows.Forms.Label
Me.Label2 = New System.Windows.Forms.Label
Me.Label3 = New System.Windows.Forms.Label
Me.chkEnableDynDNS = New System.Windows.Forms.CheckBox
Me.Panel7 = New System.Windows.Forms.Panel
Me.btnDefaults = New System.Windows.Forms.Button
Me.pnlScroll = New System.Windows.Forms.Panel
Me.pnlMain = New System.Windows.Forms.Panel
Me.InputPanel1 = New Microsoft.WindowsCE.Forms.InputPanel
Me.Label10 = New System.Windows.Forms.Label
Me.Label5 = New System.Windows.Forms.Label
Me.Label13 = New System.Windows.Forms.Label
Me.Label11 = New System.Windows.Forms.Label
Me.clmName = New System.Windows.Forms.ColumnHeader
Me.clmStatus = New System.Windows.Forms.ColumnHeader
Me.pnlStatus.SuspendLayout()
Me.Panel2.SuspendLayout()
Me.Panel3.SuspendLayout()
Me.tabVNC.SuspendLayout()
Me.Panel5.SuspendLayout()
Me.pnlVNC.SuspendLayout()
Me.Tabs.SuspendLayout()
Me.tabMain.SuspendLayout()
Me.Panel11.SuspendLayout()
Me.Panel13.SuspendLayout()
Me.Panel14.SuspendLayout()
Me.tabDynDNS.SuspendLayout()
Me.Panel6.SuspendLayout()
Me.Panel1.SuspendLayout()
Me.Panel7.SuspendLayout()
Me.pnlScroll.SuspendLayout()
Me.pnlMain.SuspendLayout()
Me.SuspendLayout()
'
'pnlStatus
'
Me.pnlStatus.BackColor = System.Drawing.Color.White
Me.pnlStatus.Controls.Add(Me.pbBack)
Me.pnlStatus.Location = New System.Drawing.Point(0, 270)
Me.pnlStatus.Name = "pnlStatus"
Me.pnlStatus.Size = New System.Drawing.Size(240, 24)
'
'pbBack
'
Me.pbBack.Image = CType(resources.GetObject("pbBack.Image"), System.Drawing.Image)
Me.pbBack.Location = New System.Drawing.Point(222, 5)
Me.pbBack.Name = "pbBack"
Me.pbBack.Size = New System.Drawing.Size(18, 18)
'
'ComboBox23
'
Me.ComboBox23.Location = New System.Drawing.Point(69, 149)
Me.ComboBox23.Name = "ComboBox23"
Me.ComboBox23.Size = New System.Drawing.Size(165, 22)
Me.ComboBox23.TabIndex = 17
'
'TextBox21
'
Me.TextBox21.Font = New System.Drawing.Font("Arial", 9.0!, System.Drawing.FontStyle.Regular)
Me.TextBox21.Location = New System.Drawing.Point(69, 127)
Me.TextBox21.Name = "TextBox21"
Me.TextBox21.Size = New System.Drawing.Size(165, 20)
Me.TextBox21.TabIndex = 15
'
'Label21
'
Me.Label21.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular)
Me.Label21.Location = New System.Drawing.Point(7, 152)
Me.Label21.Name = "Label21"
Me.Label21.Size = New System.Drawing.Size(35, 14)
Me.Label21.Text = "Type"
'
'Label22
'
Me.Label22.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Bold)
Me.Label22.Location = New System.Drawing.Point(3, 109)
Me.Label22.Name = "Label22"
Me.Label22.Size = New System.Drawing.Size(206, 17)
Me.Label22.Text = "Communications Channel Number X."
'
'Label23
'
Me.Label23.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular)
Me.Label23.Location = New System.Drawing.Point(7, 131)
Me.Label23.Name = "Label23"
Me.Label23.Size = New System.Drawing.Size(35, 17)
Me.Label23.Text = "Name"
'
'Panel2
'
Me.Panel2.Controls.Add(Me.Label24)
Me.Panel2.Controls.Add(Me.Label25)
Me.Panel2.Controls.Add(Me.Label26)
Me.Panel2.Controls.Add(Me.Label27)
Me.Panel2.Controls.Add(Me.Label28)
Me.Panel2.Controls.Add(Me.Label29)
Me.Panel2.Location = New System.Drawing.Point(0, 176)
Me.Panel2.Name = "Panel2"
Me.Panel2.Size = New System.Drawing.Size(241, 74)
'
'Label24
'
Me.Label24.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular)
Me.Label24.Location = New System.Drawing.Point(130, 5)
Me.Label24.Name = "Label24"
Me.Label24.Size = New System.Drawing.Size(32, 20)
Me.Label24.Text = "Parity"
'
'Label25
'
Me.Label25.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular)
Me.Label25.Location = New System.Drawing.Point(5, 52)
Me.Label25.Name = "Label25"
Me.Label25.Size = New System.Drawing.Size(48, 20)
Me.Label25.Text = "H'shake"
'
'Label26
'
Me.Label26.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular)
Me.Label26.Location = New System.Drawing.Point(130, 52)
Me.Label26.Name = "Label26"
Me.Label26.Size = New System.Drawing.Size(50, 18)
Me.Label26.Text = "Stop Bits"
'
'Label27
'
Me.Label27.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular)
Me.Label27.Location = New System.Drawing.Point(130, 29)
Me.Label27.Name = "Label27"
Me.Label27.Size = New System.Drawing.Size(50, 18)
Me.Label27.Text = "Data Bits"
'
'Label28
'
Me.Label28.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular)
Me.Label28.Location = New System.Drawing.Point(6, 26)
Me.Label28.Name = "Label28"
Me.Label28.Size = New System.Drawing.Size(32, 18)
Me.Label28.Text = "Baud"
'
'Label29
'
Me.Label29.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular)
Me.Label29.Location = New System.Drawing.Point(6, 5)
Me.Label29.Name = "Label29"
Me.Label29.Size = New System.Drawing.Size(47, 18)
Me.Label29.Text = "Port"
'
'Panel3
'
Me.Panel3.Controls.Add(Me.Label30)
Me.Panel3.Controls.Add(Me.Label31)
Me.Panel3.Location = New System.Drawing.Point(0, 176)
Me.Panel3.Name = "Panel3"
Me.Panel3.Size = New System.Drawing.Size(241, 74)
'
'Label30
'
Me.Label30.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular)
Me.Label30.Location = New System.Drawing.Point(7, 34)
Me.Label30.Name = "Label30"
Me.Label30.Size = New System.Drawing.Size(44, 18)
Me.Label30.Text = "IP Port"
'
'Label31
'
Me.Label31.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular)
Me.Label31.Location = New System.Drawing.Point(6, 13)
Me.Label31.Name = "Label31"
Me.Label31.Size = New System.Drawing.Size(46, 21)
Me.Label31.Text = "Address"
'
'ListView1
'
Me.ListView1.Location = New System.Drawing.Point(0, 0)
Me.ListView1.Name = "ListView1"
Me.ListView1.Size = New System.Drawing.Size(241, 106)
Me.ListView1.TabIndex = 27
Me.ListView1.View = System.Windows.Forms.View.Details
'
'tabVNC
'
Me.tabVNC.BackColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(128, Byte), Integer))
Me.tabVNC.Controls.Add(Me.Panel5)
Me.tabVNC.Controls.Add(Me.Panel4)
Me.tabVNC.Controls.Add(Me.pnlVNC)
Me.tabVNC.Location = New System.Drawing.Point(0, 0)
Me.tabVNC.Name = "tabVNC"
Me.tabVNC.Size = New System.Drawing.Size(240, 248)
Me.tabVNC.Text = "VNC Server"
'
'Panel5
'
Me.Panel5.BackColor = System.Drawing.Color.White
Me.Panel5.Controls.Add(Me.PictureBox1)
Me.Panel5.Controls.Add(Me.Label6)
Me.Panel5.Location = New System.Drawing.Point(0, 0)
Me.Panel5.Name = "Panel5"
Me.Panel5.Size = New System.Drawing.Size(240, 22)
'
'PictureBox1
'
Me.PictureBox1.Image = CType(resources.GetObject("PictureBox1.Image"), System.Drawing.Image)
Me.PictureBox1.Location = New System.Drawing.Point(7, 4)
Me.PictureBox1.Name = "PictureBox1"
Me.PictureBox1.Size = New System.Drawing.Size(22, 18)
'
'Label6
'
Me.Label6.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Bold)
Me.Label6.ForeColor = System.Drawing.SystemColors.ControlDarkDark
Me.Label6.Location = New System.Drawing.Point(27, 4)
Me.Label6.Name = "Label6"
Me.Label6.Size = New System.Drawing.Size(210, 17)
Me.Label6.Text = "VNC Server Configuration"
'
'Panel4
'
Me.Panel4.BackColor = System.Drawing.Color.White
Me.Panel4.Location = New System.Drawing.Point(0, 122)
Me.Panel4.Name = "Panel4"
Me.Panel4.Size = New System.Drawing.Size(240, 126)
'
'pnlVNC
'
Me.pnlVNC.BackColor = System.Drawing.Color.White
Me.pnlVNC.Controls.Add(Me.txtVNCPort)
Me.pnlVNC.Controls.Add(Me.btnStartStopVNC)
Me.pnlVNC.Controls.Add(Me.Label9)
Me.pnlVNC.Controls.Add(Me.chkAutoStartVNC)
Me.pnlVNC.Location = New System.Drawing.Point(0, 23)
Me.pnlVNC.Name = "pnlVNC"
Me.pnlVNC.Size = New System.Drawing.Size(240, 98)
'
'txtVNCPort
'
Me.txtVNCPort.Font = New System.Drawing.Font("Arial", 9.0!, System.Drawing.FontStyle.Regular)
Me.txtVNCPort.Location = New System.Drawing.Point(68, 30)
Me.txtVNCPort.Multiline = True
Me.txtVNCPort.Name = "txtVNCPort"
Me.txtVNCPort.Size = New System.Drawing.Size(44, 20)
Me.txtVNCPort.TabIndex = 10
Me.txtVNCPort.Text = "5900"
Me.txtVNCPort.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
'
'btnStartStopVNC
'
Me.btnStartStopVNC.BackColor = System.Drawing.Color.LightSteelBlue
Me.btnStartStopVNC.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Regular)
Me.btnStartStopVNC.Location = New System.Drawing.Point(27, 59)
Me.btnStartStopVNC.Name = "btnStartStopVNC"
Me.btnStartStopVNC.Size = New System.Drawing.Size(99, 20)
Me.btnStartStopVNC.TabIndex = 108
Me.btnStartStopVNC.Text = "Start VNC Server"
'
'Label9
'
Me.Label9.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular)
Me.Label9.ForeColor = System.Drawing.SystemColors.ControlDarkDark
Me.Label9.Location = New System.Drawing.Point(27, 32)
Me.Label9.Name = "Label9"
Me.Label9.Size = New System.Drawing.Size(45, 16)
Me.Label9.Text = "IP Port"
'
'chkAutoStartVNC
'
Me.chkAutoStartVNC.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular)
Me.chkAutoStartVNC.Location = New System.Drawing.Point(27, 5)
Me.chkAutoStartVNC.Name = "chkAutoStartVNC"
Me.chkAutoStartVNC.Size = New System.Drawing.Size(210, 23)
Me.chkAutoStartVNC.TabIndex = 1
Me.chkAutoStartVNC.Text = "Start VNC Server with System"
'
'Tabs
'
Me.Tabs.Controls.Add(Me.tabMain)
Me.Tabs.Controls.Add(Me.tabVNC)
Me.Tabs.Controls.Add(Me.tabDynDNS)
Me.Tabs.Location = New System.Drawing.Point(0, 0)
Me.Tabs.Name = "Tabs"
Me.Tabs.SelectedIndex = 0
Me.Tabs.Size = New System.Drawing.Size(240, 271)
Me.Tabs.TabIndex = 20
'
'tabMain
'
Me.tabMain.Controls.Add(Me.Panel11)
Me.tabMain.Location = New System.Drawing.Point(0, 0)
Me.tabMain.Name = "tabMain"
Me.tabMain.Size = New System.Drawing.Size(240, 248)
Me.tabMain.Text = "Connect Rules"
'
'Panel11
'
Me.Panel11.BackColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(128, Byte), Integer))
Me.Panel11.Controls.Add(Me.Panel12)
Me.Panel11.Controls.Add(Me.Panel13)
Me.Panel11.Controls.Add(Me.Panel14)
Me.Panel11.Location = New System.Drawing.Point(1, 0)
Me.Panel11.Name = "Panel11"
Me.Panel11.Size = New System.Drawing.Size(239, 249)
'
'Panel12
'
Me.Panel12.Location = New System.Drawing.Point(0, 108)
Me.Panel12.Name = "Panel12"
Me.Panel12.Size = New System.Drawing.Size(239, 141)
'
'Panel13
'
Me.Panel13.Controls.Add(Me.Label51)
Me.Panel13.Controls.Add(Me.PictureBox8)
Me.Panel13.Location = New System.Drawing.Point(-1, 1)
Me.Panel13.Name = "Panel13"
Me.Panel13.Size = New System.Drawing.Size(240, 23)
'
'Label51
'
Me.Label51.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Bold)
Me.Label51.Location = New System.Drawing.Point(40, 4)
Me.Label51.Name = "Label51"
Me.Label51.Size = New System.Drawing.Size(180, 18)
Me.Label51.Text = "Persistent Internet"
'
'PictureBox8
'
Me.PictureBox8.Image = CType(resources.GetObject("PictureBox8.Image"), System.Drawing.Image)
Me.PictureBox8.Location = New System.Drawing.Point(7, 4)
Me.PictureBox8.Name = "PictureBox8"
Me.PictureBox8.Size = New System.Drawing.Size(22, 18)
'
'Panel14
'
Me.Panel14.Controls.Add(Me.btnApplyWAN)
Me.Panel14.Controls.Add(Me.txtWAN_Name)
Me.Panel14.Controls.Add(Me.chkMaintainWan)
Me.Panel14.Controls.Add(Me.PictureBox7)
Me.Panel14.Controls.Add(Me.Label48)
Me.Panel14.Location = New System.Drawing.Point(-1, 25)
Me.Panel14.Name = "Panel14"
Me.Panel14.Size = New System.Drawing.Size(240, 81)
'
'btnApplyWAN
'
Me.btnApplyWAN.BackColor = System.Drawing.Color.LightSteelBlue
Me.btnApplyWAN.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Regular)
Me.btnApplyWAN.Location = New System.Drawing.Point(188, 52)
Me.btnApplyWAN.Name = "btnApplyWAN"
Me.btnApplyWAN.Size = New System.Drawing.Size(46, 19)
Me.btnApplyWAN.TabIndex = 174
Me.btnApplyWAN.Text = "Apply"
'
'txtWAN_Name
'
Me.txtWAN_Name.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Regular)
Me.txtWAN_Name.Location = New System.Drawing.Point(96, 26)
Me.txtWAN_Name.Name = "txtWAN_Name"
Me.txtWAN_Name.Size = New System.Drawing.Size(138, 19)
Me.txtWAN_Name.TabIndex = 164
'
'chkMaintainWan
'
Me.chkMaintainWan.Checked = True
Me.chkMaintainWan.CheckState = System.Windows.Forms.CheckState.Checked
Me.chkMaintainWan.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Regular)
Me.chkMaintainWan.Location = New System.Drawing.Point(40, 5)
Me.chkMaintainWan.Name = "chkMaintainWan"
Me.chkMaintainWan.Size = New System.Drawing.Size(193, 18)
Me.chkMaintainWan.TabIndex = 169
Me.chkMaintainWan.Text = "Internet Connection Always On"
'
'PictureBox7
'
Me.PictureBox7.Image = CType(resources.GetObject("PictureBox7.Image"), System.Drawing.Image)
Me.PictureBox7.Location = New System.Drawing.Point(7, 3)
Me.PictureBox7.Name = "PictureBox7"
Me.PictureBox7.Size = New System.Drawing.Size(20, 20)
'
'Label48
'
Me.Label48.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular)
Me.Label48.Location = New System.Drawing.Point(4, 28)
Me.Label48.Name = "Label48"
Me.Label48.Size = New System.Drawing.Size(95, 20)
Me.Label48.Text = "Connection Name"
'
'tabDynDNS
'
Me.tabDynDNS.BackColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(128, Byte), Integer))
Me.tabDynDNS.Controls.Add(Me.Panel6)
Me.tabDynDNS.Controls.Add(Me.Panel1)
Me.tabDynDNS.Controls.Add(Me.Panel7)
Me.tabDynDNS.Location = New System.Drawing.Point(0, 0)
Me.tabDynDNS.Name = "tabDynDNS"
Me.tabDynDNS.Size = New System.Drawing.Size(240, 248)
Me.tabDynDNS.Text = "DynDNS"
'
'Panel6
'
Me.Panel6.BackColor = System.Drawing.Color.White
Me.Panel6.Controls.Add(Me.Label4)
Me.Panel6.Controls.Add(Me.PictureBox2)
Me.Panel6.Location = New System.Drawing.Point(0, 0)
Me.Panel6.Name = "Panel6"
Me.Panel6.Size = New System.Drawing.Size(240, 22)
'
'Label4
'
Me.Label4.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Bold)
Me.Label4.ForeColor = System.Drawing.SystemColors.ControlDarkDark
Me.Label4.Location = New System.Drawing.Point(26, 4)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(211, 17)
Me.Label4.Text = "Dyn DNS Configuration"
'
'PictureBox2
'
Me.PictureBox2.Image = CType(resources.GetObject("PictureBox2.Image"), System.Drawing.Image)
Me.PictureBox2.Location = New System.Drawing.Point(7, 2)
Me.PictureBox2.Name = "PictureBox2"
Me.PictureBox2.Size = New System.Drawing.Size(22, 18)
'
'Panel1
'
Me.Panel1.BackColor = System.Drawing.Color.White
Me.Panel1.Controls.Add(Me.txtDDNS_Domain)
Me.Panel1.Controls.Add(Me.txtDDNS_User)
Me.Panel1.Controls.Add(Me.txtDDNS_Password)
Me.Panel1.Controls.Add(Me.btnDDNS_Update)
Me.Panel1.Controls.Add(Me.Label1)
Me.Panel1.Controls.Add(Me.Label2)
Me.Panel1.Controls.Add(Me.Label3)
Me.Panel1.Controls.Add(Me.chkEnableDynDNS)
Me.Panel1.Location = New System.Drawing.Point(1, 23)
Me.Panel1.Name = "Panel1"
Me.Panel1.Size = New System.Drawing.Size(238, 136)
'
'txtDDNS_Domain
'
Me.txtDDNS_Domain.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular)
Me.txtDDNS_Domain.Location = New System.Drawing.Point(75, 32)
Me.txtDDNS_Domain.Name = "txtDDNS_Domain"
Me.txtDDNS_Domain.Size = New System.Drawing.Size(155, 19)
Me.txtDDNS_Domain.TabIndex = 30
'
'txtDDNS_User
'
Me.txtDDNS_User.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular)
Me.txtDDNS_User.Location = New System.Drawing.Point(75, 57)
Me.txtDDNS_User.Name = "txtDDNS_User"
Me.txtDDNS_User.Size = New System.Drawing.Size(155, 19)
Me.txtDDNS_User.TabIndex = 31
'
'txtDDNS_Password
'
Me.txtDDNS_Password.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular)
Me.txtDDNS_Password.Location = New System.Drawing.Point(75, 82)
Me.txtDDNS_Password.Name = "txtDDNS_Password"
Me.txtDDNS_Password.Size = New System.Drawing.Size(155, 19)
Me.txtDDNS_Password.TabIndex = 32
'
'btnDDNS_Update
'
Me.btnDDNS_Update.BackColor = System.Drawing.Color.LightSteelBlue
Me.btnDDNS_Update.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Regular)
Me.btnDDNS_Update.Location = New System.Drawing.Point(141, 110)
Me.btnDDNS_Update.Name = "btnDDNS_Update"
Me.btnDDNS_Update.Size = New System.Drawing.Size(89, 20)
Me.btnDDNS_Update.TabIndex = 117
Me.btnDDNS_Update.Text = "Force Update"
'
'Label1
'
Me.Label1.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular)
Me.Label1.ForeColor = System.Drawing.SystemColors.ControlDarkDark
Me.Label1.Location = New System.Drawing.Point(4, 33)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(74, 18)
Me.Label1.Text = "Domain Name"
'
'Label2
'
Me.Label2.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular)
Me.Label2.ForeColor = System.Drawing.SystemColors.ControlDarkDark
Me.Label2.Location = New System.Drawing.Point(6, 84)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(65, 17)
Me.Label2.Text = "Password"
'
'Label3
'
Me.Label3.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular)
Me.Label3.ForeColor = System.Drawing.SystemColors.ControlDarkDark
Me.Label3.Location = New System.Drawing.Point(4, 59)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(65, 17)
Me.Label3.Text = "User Name"
'
'chkEnableDynDNS
'
Me.chkEnableDynDNS.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular)
Me.chkEnableDynDNS.Location = New System.Drawing.Point(19, 3)
Me.chkEnableDynDNS.Name = "chkEnableDynDNS"
Me.chkEnableDynDNS.Size = New System.Drawing.Size(211, 23)
Me.chkEnableDynDNS.TabIndex = 1
Me.chkEnableDynDNS.Text = "Enable Pocket PC DynDNS Updater"
'
'Panel7
'
Me.Panel7.BackColor = System.Drawing.Color.White
Me.Panel7.Controls.Add(Me.btnDefaults)
Me.Panel7.Location = New System.Drawing.Point(1, 161)
Me.Panel7.Name = "Panel7"
Me.Panel7.Size = New System.Drawing.Size(238, 87)
'
'btnDefaults
'
Me.btnDefaults.BackColor = System.Drawing.Color.LightSteelBlue
Me.btnDefaults.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Regular)
Me.btnDefaults.Location = New System.Drawing.Point(141, 52)
Me.btnDefaults.Name = "btnDefaults"
Me.btnDefaults.Size = New System.Drawing.Size(89, 20)
Me.btnDefaults.TabIndex = 117
Me.btnDefaults.Text = "Default Settings"
'
'pnlScroll
'
Me.pnlScroll.Controls.Add(Me.pnlMain)
Me.pnlScroll.Controls.Add(Me.pnlStatus)
Me.pnlScroll.Location = New System.Drawing.Point(0, 0)
Me.pnlScroll.Name = "pnlScroll"
Me.pnlScroll.Size = New System.Drawing.Size(320, 294)
'
'pnlMain
'
Me.pnlMain.BackColor = System.Drawing.Color.White
Me.pnlMain.Controls.Add(Me.Tabs)
Me.pnlMain.Location = New System.Drawing.Point(0, 0)
Me.pnlMain.Name = "pnlMain"
Me.pnlMain.Size = New System.Drawing.Size(240, 274)
'
'Label10
'
Me.Label10.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Bold)
Me.Label10.ForeColor = System.Drawing.SystemColors.ControlDarkDark
Me.Label10.Location = New System.Drawing.Point(0, 6)
Me.Label10.Name = "Label10"
Me.Label10.Size = New System.Drawing.Size(235, 18)
'
'Label5
'
Me.Label5.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular)
Me.Label5.ForeColor = System.Drawing.SystemColors.ControlDarkDark
Me.Label5.Location = New System.Drawing.Point(4, 79)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(65, 17)
'
'Label13
'
Me.Label13.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular)
Me.Label13.ForeColor = System.Drawing.SystemColors.ControlDarkDark
Me.Label13.Location = New System.Drawing.Point(6, 104)
Me.Label13.Name = "Label13"
Me.Label13.Size = New System.Drawing.Size(65, 17)
'
'Label11
'
Me.Label11.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular)
Me.Label11.ForeColor = System.Drawing.SystemColors.ControlDarkDark
Me.Label11.Location = New System.Drawing.Point(4, 53)
Me.Label11.Name = "Label11"
Me.Label11.Size = New System.Drawing.Size(74, 18)
'
'clmName
'
Me.clmName.Text = "Application Name"
Me.clmName.Width = 99
'
'clmStatus
'
Me.clmStatus.Text = "Status"
Me.clmStatus.Width = 74
'
'frmOptions
'
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None
Me.BackColor = System.Drawing.Color.LightSteelBlue
Me.ClientSize = New System.Drawing.Size(240, 293)
Me.Controls.Add(Me.pnlScroll)
Me.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular)
Me.MinimizeBox = False
Me.Name = "frmOptions"
Me.Text = "Options"
Me.TopMost = True
Me.pnlStatus.ResumeLayout(False)
Me.Panel2.ResumeLayout(False)
Me.Panel3.ResumeLayout(False)
Me.tabVNC.ResumeLayout(False)
Me.Panel5.ResumeLayout(False)
Me.pnlVNC.ResumeLayout(False)
Me.Tabs.ResumeLayout(False)
Me.tabMain.ResumeLayout(False)
Me.Panel11.ResumeLayout(False)
Me.Panel13.ResumeLayout(False)
Me.Panel14.ResumeLayout(False)
Me.tabDynDNS.ResumeLayout(False)
Me.Panel6.ResumeLayout(False)
Me.Panel1.ResumeLayout(False)
Me.Panel7.ResumeLayout(False)
Me.pnlScroll.ResumeLayout(False)
Me.pnlMain.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub frmOptions_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
Try
If Not ProgramExiting Then
e.Cancel = True
GetGUIValues()
SaveConfig()
Me.InputPanel1.Enabled = False
fMain.Visible = True
fMain.Focus()
Me.Hide()
End If
Catch ex As Exception
OnEx(ex)
End Try
End Sub
Private Sub frm_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Resize
If Me.Width > Me.Height Then
'---landscape mode---
pnlScroll.AutoScroll = True
Else
'---portrait mode---
pnlScroll.AutoScroll = False
End If
End Sub
Public Sub SetGUIValues()
chkMaintainWan.Checked = DDNS_Configuration.PersistentGPRS
txtWAN_Name.Text = DDNS_Configuration.GPRS_ConnectionName
chkAutoStartVNC.Checked = DDNS_Configuration.StartVNC
txtVNCPort.Text = DDNS_Configuration.VNC_ClientPort.ToString
chkEnableDynDNS.Checked = DDNS_Configuration.DDNS_Enabled
txtDDNS_Domain.Text = DDNS_Configuration.DDNS_Domain
txtDDNS_User.Text = DDNS_Configuration.DDNS_User
txtDDNS_Password.Text = DDNS_Configuration.DDNS_Password
End Sub
Public Sub GetGUIValues()
If DDNS_Configuration.PersistentGPRS <> chkMaintainWan.Checked Then
DDNS_Configuration.PersistentGPRS = chkMaintainWan.Checked
End If
DDNS_Configuration.GPRS_ConnectionName = txtWAN_Name.Text
DDNS_Configuration.StartVNC = chkAutoStartVNC.Checked
DDNS_Configuration.VNC_ClientPort = CInt(txtVNCPort.Text)
DDNS_Configuration.DDNS_Enabled = chkEnableDynDNS.Checked
DDNS_Configuration.DDNS_Domain = txtDDNS_Domain.Text
DDNS_Configuration.DDNS_User = txtDDNS_User.Text
DDNS_Configuration.DDNS_Password = txtDDNS_Password.Text
End Sub
Private Sub btnStartStopVNC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStartStopVNC.Click
' If vncIntPtr = IntPtr.Zero Then
Try
If Me.btnStartStopVNC.Text = "Start VNC Server" Then
StartVNC()
Else
m_VncManualStop = True
StopVNC()
End If
Catch ex As Exception
Debug.WriteLine("Error at btnStartStopVNC_Click " & ex.Message)
End Try
End Sub
Public Sub StartVNC()
VNC_Process = New Process()
If OpenControl.PhoneLib.Win32.FindWindow(Nothing, "RFB Server") = IntPtr.Zero Then
VNC_Process.StartInfo.Arguments = "/port:" & DDNS_Configuration.VNC_ClientPort.ToString '& '& "/hidetray:true"
VNC_Process.StartInfo.FileName = AppPath & "CompactVNC.exe"
If System.IO.File.Exists(AppPath & "CompactVNC.exe") Then
If VNC_Process.Start() Then
vncIntPtr = VNC_Process.MainWindowHandle
btnStartStopVNC.Text = "Stop VNC Server"
End If
End If
End If
End Sub
Public Sub StopVNC()
Try
'If Not OpenControl.PhoneLib.Win32.FindWindow(Nothing, "RFB Server") = IntPtr.Zero Then
' IPC_MessageSender.Send_Message("RFB Server", 2, IntPtr.Zero, IntPtr.Zero)
' vncIntPtr = IntPtr.Zero
'End If
If Not VNC_Process Is Nothing Then
Try
VNC_Process.CloseMainWindow()
Catch ex As Exception
Debug.WriteLine("Error at StopVNC caught")
End Try
Dim stopstart As DateTime = Now
While stopstart.AddSeconds(4) > Now
If Not VNC_Process Is Nothing Then
Exit While
End If
If VNC_Process.HasExited Then
Exit While
End If
End While
Thread.Sleep(500)
End If
If Not VNC_Process Is Nothing Then
If Not VNC_Process.HasExited Then
Try
VNC_Process.Kill()
Catch ex As Exception
Debug.WriteLine("Error at StopVNC caught")
End Try
End If
End If
Me.btnStartStopVNC.Text = "Start VNC Server"
Catch ex As Exception
OnEx(ex)
End Try
vncIntPtr = IntPtr.Zero
VNC_Process = Nothing
End Sub
Private Sub btnDDNS_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
doDDNS_Update()
End Sub
Public Sub doDDNS_Update()
If Not CurrentWAN_IP = "0.0.0.0" And Not CurrentWAN_IP = "" Then
If DDNS_Configuration.DDNS_Enabled And Not DDNS_Configuration.DDNS_Domain = "" _
And Not DDNS_Configuration.DDNS_User = "" And Not DDNS_Configuration.DDNS_Password = "" Then
DDNS_Configuration.LastUpdateResult = DynDNS.UpdateDDNS(DDNS_Configuration.DDNS_Domain, _
CurrentWAN_IP, DDNS_Configuration.DDNS_User, DDNS_Configuration.DDNS_Password _
, "Code Project-Compact DDNS-v1.0")
fMain.txtLastDDNS_Result.Text = DDNS_Configuration.LastUpdateResult
Debug.WriteLine("UpdateDDNS = " & DDNS_Configuration.LastUpdateResult)
If DDNS_Configuration.LastUpdateResult.StartsWith("good") Or DDNS_Configuration.LastUpdateResult.StartsWith("noch") Then
DDNS_UpdateOK = True
DDNS_Configuration.LastUpdateTime = Now
fMain.txtLastDDNS_Time.Text = DDNS_Configuration.LastUpdateTime
DDNS_Configuration.LastUpdateIP = CurrentWAN_IP
fMain.txtLastUpdateAddress.Text = CurrentWAN_IP
fMain.pbDDNS_OK.Image = IconHash("led_green2")
Exit Sub
End If
End If
End If
DDNS_UpdateOK = False
fMain.pbDDNS_OK.Image = IconHash("led_red2")
End Sub
Private Sub chkMaintainWan_CheckStateChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkMaintainWan.CheckStateChanged
If ProgramStarted Then
DDNS_Configuration.PersistentGPRS = chkMaintainWan.Checked
DDNS_Configuration.GPRS_ConnectionName = txtWAN_Name.Text
If DDNS_Configuration.GPRS_ConnectionName <> "" Then
SetPersistentWan(txtWAN_Name.Text, chkMaintainWan.Checked)
End If
End If
End Sub
Public Function SetPersistentWan(ByVal ConnectionName As String, ByVal Persist As Boolean, Optional ByVal ResetPrompt As Boolean = True) As Boolean
'return false if connection does not exist
If Not GPRS_Settings.DoesConnectionExist(ConnectionName) Then
Return False
End If
If DDNS_Configuration.PersistentGPRS Then
If GPRS_Settings.DoesConnectionExist(ConnectionName) Then
GPRS_Settings.PersistentGPRS(ConnectionName, True)
If ResetPrompt Then
MsgBox("Reset Required to Effect Changes", MsgBoxStyle.OkOnly, "Persistent WAN Enabled")
End If
Else
Return True
End If
Else
If GPRS_Settings.IsPersistentGPRSEnabled(ConnectionName) Then
GPRS_Settings.PersistentGPRS(ConnectionName, False)
If ResetPrompt Then
MsgBox("Reset Required to Effect Changes", MsgBoxStyle.OkOnly, "Persistent WAN Disabled")
End If
End If
End If
End Function
Private Sub txtDDNS_GotFocus(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtDDNS_Domain.GotFocus, _
txtDDNS_User.GotFocus, txtDDNS_Password.GotFocus, txtWAN_Name.GotFocus
Me.InputPanel1.Enabled = True
Me.pnlScroll.AutoScroll = True
End Sub
Private Sub txtVNCPort_GotFocus(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtVNCPort.GotFocus
Me.InputPanel1.Enabled = True
End Sub
Private Sub chkEnableDynDNS_CheckStateChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkEnableDynDNS.CheckStateChanged
DDNS_Configuration.DDNS_Enabled = chkEnableDynDNS.Checked
End Sub
Private Sub pbBack_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pbBack.Click
GetGUIValues()
SaveConfig()
Me.InputPanel1.Enabled = False
Me.Hide()
fMain.Visible = True
fMain.Focus()
End Sub
Private Sub btnDDNS_Update_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDDNS_Update.Click
doDDNS_Update()
End Sub
Private Sub btnDefaults_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDefaults.Click
If System.IO.File.Exists(ConfigFile) Then
System.IO.File.Delete(ConfigFile)
End If
If System.IO.File.Exists(AppPath + "ConfigurationInfo.bak") Then
System.IO.File.Copy(AppPath + "ConfigurationInfo.bak", ConfigFile)
LoadConfig()
SetGUIValues()
Else
MsgBox("Could Not Locate Default Config." & vbCr & "Resinstall Application!")
fMain.ExitProgram()
End If
End Sub
End Class