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
#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