Administrator

Administrator

  • Admin
  • 2.2k
  • 1.4m

How can I change these Vb.net code to c# and make it more efficently?

Apr 13 2003 12:53 AM
Public Class Form1 Inherits System.Windows.Forms.Form #Region " Windows ?????????? " Public Sub New() MyBase.New() '???? Windows ?????????? InitializeComponent() '? InitializeComponent() ??????????? End Sub '?????????????? 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 'Windows ????????? Private components As System.ComponentModel.IContainer '??:????? Windows ????????? '???? Windows ??????????? '????????????? Friend WithEvents Button1 As System.Windows.Forms.Button Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents Text1 As System.Windows.Forms.TextBox Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents Label3 As System.Windows.Forms.Label Friend WithEvents Text2 As System.Windows.Forms.TextBox Friend WithEvents Text3 As System.Windows.Forms.TextBox Friend WithEvents Text4 As System.Windows.Forms.TextBox Private Sub InitializeComponent() Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1)) Me.Text1 = New System.Windows.Forms.TextBox() Me.Button1 = 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.Text2 = New System.Windows.Forms.TextBox() Me.Text3 = New System.Windows.Forms.TextBox() Me.Text4 = New System.Windows.Forms.TextBox() Me.SuspendLayout() ' 'Text1 ' Me.Text1.Location = New System.Drawing.Point(80, 304) Me.Text1.Name = "Text1" Me.Text1.Size = New System.Drawing.Size(40, 21) Me.Text1.TabIndex = 0 Me.Text1.Text = "" ' 'Button1 ' Me.Button1.Location = New System.Drawing.Point(136, 344) Me.Button1.Name = "Button1" Me.Button1.Size = New System.Drawing.Size(152, 48) Me.Button1.TabIndex = 1 Me.Button1.Text = "??" ' 'Label1 ' Me.Label1.BackColor = System.Drawing.Color.Thistle Me.Label1.Location = New System.Drawing.Point(32, 64) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(408, 200) Me.Label1.TabIndex = 2 Me.Label1.TextAlign = System.Drawing.ContentAlignment.TopCenter ' 'Label2 ' Me.Label2.Location = New System.Drawing.Point(152, 8) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(144, 40) Me.Label2.TabIndex = 3 Me.Label2.Text = "????" Me.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'Label3 ' Me.Label3.Location = New System.Drawing.Point(8, 304) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(48, 16) Me.Label3.TabIndex = 4 Me.Label3.Text = "IP??:" ' 'Text2 ' Me.Text2.Location = New System.Drawing.Point(128, 304) Me.Text2.Name = "Text2" Me.Text2.Size = New System.Drawing.Size(40, 21) Me.Text2.TabIndex = 5 Me.Text2.Text = "" ' 'Text3 ' Me.Text3.Location = New System.Drawing.Point(176, 304) Me.Text3.Name = "Text3" Me.Text3.Size = New System.Drawing.Size(40, 21) Me.Text3.TabIndex = 6 Me.Text3.Text = "" ' 'Text4 ' Me.Text4.Location = New System.Drawing.Point(232, 304) Me.Text4.Name = "Text4" Me.Text4.Size = New System.Drawing.Size(40, 21) Me.Text4.TabIndex = 7 Me.Text4.Text = "" ' 'Form1 ' Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14) Me.BackColor = System.Drawing.Color.FromArgb(CType(128, Byte), CType(255, Byte), CType(255, Byte)) Me.ClientSize = New System.Drawing.Size(456, 485) Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.Text4, Me.Text3, Me.Text2, Me.Label3, Me.Label2, Me.Label1, Me.Button1, Me.Text1}) Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) Me.Name = "Form1" Me.Text = "??IP???" Me.ResumeLayout(False) End Sub #End Region 'details design stopped at 161,hongkong 202.066 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Select Case Text1.Text Case 24 Label1.Text = "??" Case 61 If Text2.Text = 8 Then Label1.Text = "??" ElseIf Text2.Text = 128 Then GoTo one End If Case 131 If Text2.Text = 230 Then Label1.Text = "?? ?????????" End If Case 132 If Text2.Text = 246 Then Label1.Text = "?? ?????" End If Case 137, 143, 147, 158, 161, 167, 192, 202 GoTo honkong Case 159 GoTo chineseteck Case 162 Label1.Text = "?? ?????" Case 166 GoTo education End Select one: Select Case Text2.Text Case 128 Label1.Text = "??163?169??" Case 129 Label1.Text = "??163?169??" Case 132 Label1.Text = "??163?169??" End Select honkong: Select Case Text2.Text Case 189, 89, 0.214, 8, 132, 182, 64, 216, 203, 207, 245, 112 Label1.Text = "???????" Case 0 Select Case Text3.Text Case 77, 100, 104, 112, 122 To 123, 128, 129, 130 To 147, 183 Label1.Text = "???????" End Select Case 1 Select Case Text3.Text Case 7 End Select Case 2 Select Case Text3.Text Case 32 To 51, 64 To 95 Label1.Text = "???????" End Select Case 4 Select Case Text3.Text Case 159 To 233 Label1.Text = "???????" End Select Case 7 Select Case Text3.Text Case 128 To 159 End Select Case 12 Select Case Text3.Text Case 4 To 7 Label1.Text = "???????" End Select Case 14 Select Case Text3.Text Case 67, 68, 80, 222 Label1.Text = "???????" End Select Case 20 Select Case Text3.Text Case 66, 89, 94, 95, 98, 100, 111, 117, 118, 125, 128 Label1.Text = "???????" End Select Case 40 Select Case Text3.Text Case 0 To 255 Label1.Text = "???????" End Select Case 45 Select Case Text3.Text Case 0 To 255 Label1.Text = "???????" End Select Case 52 Select Case Text3.Text Case 128 To 159 Label1.Text = "???????" End Select Case 57, 60 Select Case Text3.Text Case 224 To 255 Label1.Text = "???????" End Select Case 63 Select Case Text3.Text Case 0 To 31, 128 To 159 Label1.Text = "???????" End Select Case 64 Select Case Text3.Text Case 67, 68, 80, 222 Label1.Text = "???????" End Select Case 65 Select Case Text3.Text Case 0 To 31, 224 To 255 Label1.Text = "???????" End Select Case 207 Label1.Text = "?? ????" End Select chineseteck: Select Case Text2.Text Case 226 Select Case Text3.Text Case 120, 121 Label1.Text = "??? ????" Case 122, 123, 124 Label1.Text = "??? ???? " Case 125, 126, 127, 128 Label1.Text = "??? ????" Case 132, 133 Label1.Text = "??? ????" Case 134, 135 Label1.Text = "??? ????" Case 136, 137, 138 Label1.Text = "??? ????" Case 139 Label1.Text = "??? ????" Case 140, 141, 142, 143 Label1.Text = "??? ????" Case 144, 145, 146 Label1.Text = "??? ????" Case 148, 149 Label1.Text = "??? ???????" Case 150 Label1.Text = "??? ???????" Case 151 Label1.Text = "??? ???????" Case 153 Label1.Text = "??? ???????" Case 154 Label1.Text = "??? ?????" Case 156 Label1.Text = "??? ???????" Case 157 Label1.Text = "??? ????????" Case 158 Label1.Text = "??? ???????" Case 159 Label1.Text = "??? ???????" Case 160 Label1.Text = "??? ?????????" Case 152 If Text4.Text < 128 Then Label1.Text = "??? ????????" Else : Label1.Text = "??? ???????" End If Case 155 If Text4.Text < 128 Then Label1.Text = "??? ???????" Else : Label1.Text = "??? ???????" End If Case 177 Label1.Text = "?? ??????" Case 236 Label1.Text = "?? ????? " End Select End Select education: End Sub End Class

Answers (3)