Simplified to traditional implementation code in asp.net

Source: Internet
Author: User

I 'd like to directly paste an example to illustrate it:
Copy codeThe Code is as follows:
// Form1.cs
Using System;
Using System. Collections. Generic;
Using System. ComponentModel;
Using System. Data;
Using System. Drawing;
Using System. Text;
Using System. Windows. Forms;
Using EncodeMy;
Namespace TestEnCode
{
Public partial class Form1: Form
{
Public Form1 ()
{
InitializeComponent ();
}
Private void button#click (object sender, EventArgs e)
{
EncodeRobert edControl = new EncodeRobert (); // creates a simplified conversion object.
TxtResult. Text = edControl. SCTCConvert (ConvertType. Simplified, ConvertType. Traditional, txtSource. Text); // perform Simplified Conversion
}
}
}

Note: using EncodeMy; is not a class library that comes with. net. It is in Encode. dll. To reference.
Please go to http://download.csdn.net/source/617532
Http://download.csdn.net/user/farawayplace613download the code of this instance (resource score is not required. Encode. dll is in the Debug folder.
Copy codeThe Code is as follows:
// Form1.Designer. cs
Namespace TestEnCode
{
Partial class Form1
{
/// <Summary>
/// Required designer variables.
/// </Summary>
Private System. ComponentModel. IContainer components = null;
/// <Summary>
/// Clear all resources in use.
/// </Summary>
/// <Param name = "disposing"> If the managed resource should be released, the value is true; otherwise, the value is false. </Param>
Protected override void Dispose (bool disposing)
{
If (disposing & (components! = Null ))
{
Components. Dispose ();
}
Base. Dispose (disposing );
}
# Region code generated by Windows Form Designer
/// <Summary>
/// The designer supports the required methods-do not
/// Use the code editor to modify the content of this method.
/// </Summary>
Private void InitializeComponent ()
{
This.txt Source = new System. Windows. Forms. TextBox ();
This.txt Result = new System. Windows. Forms. TextBox ();
This. button1 = new System. Windows. Forms. Button ();
This. label1 = new System. Windows. Forms. Label ();
This. label2 = new System. Windows. Forms. Label ();
This. SuspendLayout ();
//
// TxtSource
//
This.txt Source. Location = new System. Drawing. Point (75, 26 );
This.txt Source. Name = "txtSource ";
This.txt Source. Size = new System. Drawing. Size (100, 22 );
This.txt Source. TabIndex = 0;
//
// TxtResult
//
This.txt Result. Location = new System. Drawing. Point (75,126 );
This.txt Result. Name = "txtResult ";
This.txt Result. Size = new System. Drawing. Size (100, 22 );
This.txt Result. TabIndex = 1;
//
// Button1
//
This. button1.Location = new System. Drawing. Point (75, 78 );
This. button1.Name = "button1 ";
This. button1.Size = new System. Drawing. Size (75, 23 );
This. button1.TabIndex = 2;
This. button1.Text = "simplified conversion ";
This. button1.UseVisualStyleBackColor = true;
This. button1.Click + = new System. EventHandler (this. button#click );
//
// Label1
//
This. label1.AutoSize = true;
This. label1.Location = new System. Drawing. Point (23, 29 );
This. label1.Name = "label1 ";
This. label1.Size = new System. Drawing. Size (41, 12 );
This. label1.TabIndex = 3;
This. label1.Text = "conversion source ";
//
// Label2
//
This. label2.AutoSize = true;
This. label2.Location = new System. Drawing. Point (12,136 );
This. label2.Name = "label2 ";
This. label2.Size = new System. Drawing. Size (53, 12 );
This. label2.TabIndex = 4;
This. label2.Text = "Conversion Result ";
//
// Form1
//
This. AutoScaleDimensions = new System. Drawing. SizeF (6F, 12F );
This. AutoScaleMode = System. Windows. Forms. AutoScaleMode. Font;
This. ClientSize = new System. Drawing. Size (320,277 );
This. Controls. Add (this. label2 );
This. Controls. Add (this. label1 );
This. Controls. Add (this. button1 );
This.Controls.Add(this.txt Result );
This.Controls.Add(this.txt Source );
This. Name = "Form1 ";
This. Text = "simplified and traditional conversion test ";
This. ResumeLayout (false );
This. initialize mlayout ();
}
# Endregion
Private System. Windows. Forms. TextBox txtSource;
Private System. Windows. Forms. TextBox txtResult;
Private System. Windows. Forms. Button button1;
Private System. Windows. Forms. Label label1;
Private System. Windows. Forms. Label label2;
}
}

Note that the project created in VS2008 is downloaded.
You may need to copy the code to your own environment. Encode. dll is important for downloading.
Haha, It's easy. Just two sentences will solve the transformation between simplified and Traditional Chinese.
Author: Cheng
From: http://blog.csdn.net/farawayplace613/archive/2008/09/10/2910527.aspx

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.