Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
SynHost 2 - Form1.vb

Form1.vb

Caricato da:
Scarica il programma completo

  1. Imports System
  2. Imports System.Net
  3. Imports System.Net.Sockets
  4. Imports System.Diagnostics
  5. Public Class Form1
  6.     Inherits System.Windows.Forms.Form
  7.     Dim Port As IPEndPoint
  8.     Dim Socket As Socket
  9. #Region " Windows Form Designer generated code "
  10.  
  11.     Public Sub New()
  12.         MyBase.New()
  13.  
  14.         'This call is required by the Windows Form Designer.
  15.         InitializeComponent()
  16.  
  17.         'Add any initialization after the InitializeComponent() call
  18.  
  19.     End Sub
  20.  
  21.     'Form overrides dispose to clean up the component list.
  22.     Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
  23.         If disposing Then
  24.             If Not (components Is Nothing) Then
  25.                 components.Dispose()
  26.             End If
  27.         End If
  28.         MyBase.Dispose(disposing)
  29.     End Sub
  30.  
  31.     'Required by the Windows Form Designer
  32.     Private components As System.ComponentModel.IContainer
  33.  
  34.     'NOTE: The following procedure is required by the Windows Form Designer
  35.     'It can be modified using the Windows Form Designer.  
  36.     'Do not modify it using the code editor.
  37.     Friend WithEvents Button1 As System.Windows.Forms.Button
  38.     Friend WithEvents Label1 As System.Windows.Forms.Label
  39.     Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
  40.     Friend WithEvents Label2 As System.Windows.Forms.Label
  41.     Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
  42.     Friend WithEvents NumericUpDown1 As System.Windows.Forms.NumericUpDown
  43.     Friend WithEvents Label3 As System.Windows.Forms.Label
  44.     Friend WithEvents Button2 As System.Windows.Forms.Button
  45.     Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu
  46.     Friend WithEvents MenuItem1 As System.Windows.Forms.MenuItem
  47.     Friend WithEvents MenuItem2 As System.Windows.Forms.MenuItem
  48.     Friend WithEvents Timer1 As System.Windows.Forms.Timer
  49.     Friend WithEvents MenuItem3 As System.Windows.Forms.MenuItem
  50.     Friend WithEvents MenuItem4 As System.Windows.Forms.MenuItem
  51.     Friend WithEvents MenuItem5 As System.Windows.Forms.MenuItem
  52.     Friend WithEvents MenuItem6 As System.Windows.Forms.MenuItem
  53.     <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
  54.         Me.components = New System.ComponentModel.Container
  55.         Me.Button1 = New System.Windows.Forms.Button
  56.         Me.Label1 = New System.Windows.Forms.Label
  57.         Me.TextBox1 = New System.Windows.Forms.TextBox
  58.         Me.Label2 = New System.Windows.Forms.Label
  59.         Me.TextBox2 = New System.Windows.Forms.TextBox
  60.         Me.NumericUpDown1 = New System.Windows.Forms.NumericUpDown
  61.         Me.Label3 = New System.Windows.Forms.Label
  62.         Me.Button2 = New System.Windows.Forms.Button
  63.         Me.MainMenu1 = New System.Windows.Forms.MainMenu
  64.         Me.MenuItem1 = New System.Windows.Forms.MenuItem
  65.         Me.MenuItem2 = New System.Windows.Forms.MenuItem
  66.         Me.MenuItem3 = New System.Windows.Forms.MenuItem
  67.         Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
  68.         Me.MenuItem4 = New System.Windows.Forms.MenuItem
  69.         Me.MenuItem5 = New System.Windows.Forms.MenuItem
  70.         Me.MenuItem6 = New System.Windows.Forms.MenuItem
  71.         CType(Me.NumericUpDown1, System.ComponentModel.ISupportInitialize).BeginInit()
  72.         Me.SuspendLayout()
  73.         '
  74.         'Button1
  75.         '
  76.         Me.Button1.Location = New System.Drawing.Point(8, 88)
  77.         Me.Button1.Name = "Button1"
  78.         Me.Button1.Size = New System.Drawing.Size(80, 24)
  79.         Me.Button1.TabIndex = 0
  80.         Me.Button1.Text = "Start"
  81.         '
  82.         'Label1
  83.         '
  84.         Me.Label1.Location = New System.Drawing.Point(8, 8)
  85.         Me.Label1.Name = "Label1"
  86.         Me.Label1.Size = New System.Drawing.Size(96, 24)
  87.         Me.Label1.TabIndex = 1
  88.         Me.Label1.Text = "Ip Address:"
  89.         '
  90.         'TextBox1
  91.         '
  92.         Me.TextBox1.Location = New System.Drawing.Point(8, 24)
  93.         Me.TextBox1.Name = "TextBox1"
  94.         Me.TextBox1.Size = New System.Drawing.Size(96, 22)
  95.         Me.TextBox1.TabIndex = 2
  96.         Me.TextBox1.Text = "127.0.0.1"
  97.         '
  98.         'Label2
  99.         '
  100.         Me.Label2.Location = New System.Drawing.Point(112, 8)
  101.         Me.Label2.Name = "Label2"
  102.         Me.Label2.Size = New System.Drawing.Size(64, 16)
  103.         Me.Label2.TabIndex = 3
  104.         Me.Label2.Text = "Port:"
  105.         '
  106.         'TextBox2
  107.         '
  108.         Me.TextBox2.Location = New System.Drawing.Point(112, 24)
  109.         Me.TextBox2.Name = "TextBox2"
  110.         Me.TextBox2.Size = New System.Drawing.Size(72, 22)
  111.         Me.TextBox2.TabIndex = 4
  112.         Me.TextBox2.Text = "80"
  113.         '
  114.         'NumericUpDown1
  115.         '
  116.         Me.NumericUpDown1.Location = New System.Drawing.Point(112, 56)
  117.         Me.NumericUpDown1.Maximum = New Decimal(New Integer() {1000, 0, 0, 0})
  118.         Me.NumericUpDown1.Minimum = New Decimal(New Integer() {1, 0, 0, 0})
  119.         Me.NumericUpDown1.Name = "NumericUpDown1"
  120.         Me.NumericUpDown1.Size = New System.Drawing.Size(72, 22)
  121.         Me.NumericUpDown1.TabIndex = 5
  122.         Me.NumericUpDown1.Value = New Decimal(New Integer() {1, 0, 0, 0})
  123.         '
  124.         'Label3
  125.         '
  126.         Me.Label3.Location = New System.Drawing.Point(8, 56)
  127.         Me.Label3.Name = "Label3"
  128.         Me.Label3.Size = New System.Drawing.Size(104, 24)
  129.         Me.Label3.TabIndex = 6
  130.         Me.Label3.Text = "Timer Interval:"
  131.         '
  132.         'Button2
  133.         '
  134.         Me.Button2.Location = New System.Drawing.Point(104, 88)
  135.         Me.Button2.Name = "Button2"
  136.         Me.Button2.Size = New System.Drawing.Size(80, 24)
  137.         Me.Button2.TabIndex = 7
  138.         Me.Button2.Text = "Stop"
  139.         '
  140.         'MainMenu1
  141.         '
  142.         Me.MainMenu1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem1, Me.MenuItem4})
  143.         '
  144.         'MenuItem1
  145.         '
  146.         Me.MenuItem1.Index = 0
  147.         Me.MenuItem1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem2, Me.MenuItem3})
  148.         Me.MenuItem1.Text = "File"
  149.         '
  150.         'MenuItem2
  151.         '
  152.         Me.MenuItem2.Index = 0
  153.         Me.MenuItem2.Text = "HostName To IP"
  154.         '
  155.         'MenuItem3
  156.         '
  157.         Me.MenuItem3.Index = 1
  158.         Me.MenuItem3.Text = "Exit"
  159.         '
  160.         'Timer1
  161.         '
  162.         Me.Timer1.Interval = 1
  163.         '
  164.         'MenuItem4
  165.         '
  166.         Me.MenuItem4.Index = 1
  167.         Me.MenuItem4.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem5, Me.MenuItem6})
  168.         Me.MenuItem4.Text = "Help"
  169.         '
  170.         'MenuItem5
  171.         '
  172.         Me.MenuItem5.Index = 0
  173.         Me.MenuItem5.Text = "Bug Report"
  174.         '
  175.         'MenuItem6
  176.         '
  177.         Me.MenuItem6.Index = 1
  178.         Me.MenuItem6.Text = "About"
  179.         '
  180.         'Form1
  181.         '
  182.         Me.AutoScaleBaseSize = New System.Drawing.Size(7, 15)
  183.         Me.ClientSize = New System.Drawing.Size(194, 120)
  184.         Me.Controls.Add(Me.Button2)
  185.         Me.Controls.Add(Me.Label3)
  186.         Me.Controls.Add(Me.NumericUpDown1)
  187.         Me.Controls.Add(Me.TextBox2)
  188.         Me.Controls.Add(Me.Label2)
  189.         Me.Controls.Add(Me.TextBox1)
  190.         Me.Controls.Add(Me.Label1)
  191.         Me.Controls.Add(Me.Button1)
  192.         Me.Font = New System.Drawing.Font("Arial", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
  193.         Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
  194.         Me.MaximizeBox = False
  195.         Me.Menu = Me.MainMenu1
  196.         Me.MinimizeBox = False
  197.         Me.Name = "Form1"
  198.         Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
  199.         Me.Text = "SynHost 2 By CiTyNoVa"
  200.         CType(Me.NumericUpDown1, System.ComponentModel.ISupportInitialize).EndInit()
  201.         Me.ResumeLayout(False)
  202.  
  203.     End Sub
  204.  
  205. #End Region
  206.  
  207.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  208.         Timer1.Interval = NumericUpDown1.Text
  209.         Timer1.Enabled = True
  210.     End Sub
  211.  
  212.     Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem2.Click
  213.         Dim Form2 As New Form2
  214.         Form2.ShowDialog()
  215.     End Sub
  216.  
  217.     Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
  218.         Port = New IPEndPoint(IPAddress.Parse(TextBox1.Text), Convert.ToInt32(TextBox2.Text))
  219.         Socket = New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
  220.         Socket.Connect(Port)
  221.         Socket.Close()
  222.     End Sub
  223.  
  224.     Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  225.         Timer1.Enabled = False
  226.         Socket.Close()
  227.     End Sub
  228.  
  229.     Private Sub MenuItem3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem3.Click
  230.         End
  231.     End Sub
  232.  
  233.     Private Sub MenuItem5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem5.Click
  234.         Process.Start("http://www.pierotofy.it/pages/conctat/writeus.php?mail=citynova@gmail.com")
  235.     End Sub
  236.  
  237.     Private Sub MenuItem6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem6.Click
  238.         MessageBox.Show("SynHost Version 2.0,Created by CiTyNoVa", "www.cityhack.altervista.org - www.pierotofy.it")
  239.     End Sub
  240. End Class