UnicoDetogb, you can convert Unicode strings into GB codes for easy development.

xiaoxiao2021-03-06  71

Public class form1 inherits system.windows.Forms.form

#Region "Windows Form Designer Generated Code"

Public Sub new () mybase.new ()

'This call is required for the Windows Form Designer. InitializeComponent ()

'Add any initialization after INITIALIZECOMPONENT ()

End Sub

'Form rewriting Dispose to clean up the list of components. Protected overloads overrides sub dispose (byval disposing as boolean) ing disponation kiln (Components Is Nothing) Then components.dispose () end if endiffs) End sub

'Windows Form Designer Supply Private Components as System.comPonentModel.icontainer

'Note: The following procedure is necessary to use the Windows Form Designer to modify this process using the Windows Form Designer. 'Don't modify it using the code editor. Friend WithEvents TextBox1 As System.Windows.Forms.TextBox Friend WithEvents TextBox2 As System.Windows.Forms.TextBox Private Sub InitializeComponent () Me.TextBox1 = New System.Windows.Forms.TextBox Me. TextBox2 = New System.Windows.Forms.TextBox Me.SuspendLayout () '' TextBox1 'Me.TextBox1.Location = New System.Drawing.Point (7, 7) Me.TextBox1.Multiline = True Me.TextBox1.Name = " TextBox1 "Me.TextBox1.ScrollBars = System.Windows.Forms.ScrollBars.Vertical Me.TextBox1.Size = New System.Drawing.Size (241, 121) Me.TextBox1.TabIndex = 0 Me.TextBox1.Text =" " ' 'TextBox2' Me.TextBox2.Location = New System.Drawing.Point (8, 136) Me.TextBox2.Multiline = True Me.TextBox2.Name = "TextBox2" Me.TextBox2.ScrollBars = System.Windows.Forms.ScrollBars. Vertical Me.TextBox2.size = new system.drawing.size (241, 112) Me.TextBox2.TabINDEX = 1 me.textbox2.text = "" 'FORM1' me.doscalebasesize = new system.drawing.size = new system.drawing.size (256, 255) Me.Controls.add (me.textbox2) me.controls.add (me.textbox1) me.name = "form1" me.text = "unicoidetogb" me.ResumeLayout (false) End Sub

#End region

Private sub textbox1_textchanged (Byval E AS System.EventArgs) Handles TextBox1.TextChangedend Sub

Private Sub TextBox1_KeyDown (ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown If e.KeyCode = Keys.Escape Then TextBox2.Text = UnicodeToGB (TextBox1.Text) End If If e.KeyCode = Keys.f1 Then TextBox1.text = "" TextBox2.text = "" End if End Sub

Private Function UnicoDetogb (Byval Strunicode As String) AS String Dim Gbcode As String Dim I, J AS Integer Dim C () AS String 'Temporary Variable Redim C (Strunicode.length / 4)' 2 bytes One Chinese

For J = 0 to strunicode.Length / 4 - 1 DIM D () As char = Strunicode.ToChararray (j * 4, 4) c (j) = "& H" & ctype (d, string) c (j) = chrw (VAL (c (j))) GBCODE = C (j) 'Returns the last result back Return GBCode End Function

Private Sub Form1_Load (Byval E AS System.Object, Byval E AS System.Eventargs) Handles MyBase.LOAD

End Subend Class

Posted on September 22, 2004 3:21 PM

Feedback # Reply: [Source] UnicoDetogb, can convert Unicode strings into GB code for easy development. 2004-09-30 1:20 PM Jimmyxing

Is there a decoding program for C # version? Jimmy@szgolds.com

# 回:: [Source] UnicoDetOGB, can convert Unicode strings to GB code for easy development. 2004-09-30 5:21 PM JimmyXing

Sorry, there is no C # version, if possible, I will be a release of the DLL, so that you can use it under. Net :)

# 回:: [Source] UnicoDetOGB, can convert Unicode strings to GB code for easy development. 2004-10-03 11:18 am jimmy@szgolds.com

What is the following two lines? c (j) = "& H" & ctype (d, string) c (j) = chrw (Val (c (j)))

# 回:: [Source] UnicoDetOGB, can convert Unicode strings to GB code for easy development. 2004-10-04 9:22 AM Hesicongc (j) = "& H" & ctype (d, string) turn a character array into a string C (j) = chrw (Val (c (j))) get this Unicode characters corresponding to strings

转载请注明原文地址:https://www.9cbs.com/read-109225.html

New Post(0)