長沙做網站官方站點精彩分享 美攻壮受大胸奶汁(高h),91秒拍福利视频,日本黄色aaa

国产成人精品日本亚洲999I久久资源在线I亚洲88avI久久久av免费观看I99re6热在线精品视频播放速度I91成人精品I夫妻avI五月天综合婷婷I五月色综合I久操视频在线播放Iwww.亚洲色图I国产一级免费观看I幸福花园动漫完整版双男主

學做網站論壇

首頁 » 做網站交流 » 做網站常見問題解答 » 讓網站實現簡體和繁體轉換代碼
boke - 2014/11/26 10:31:00
如果我們的網站有港澳臺的用戶,那么網站最好是能支持文字簡繁互轉,這樣做能方便不同用戶更好的閱讀網站內容。要實現簡繁互轉可以使用以下方法輕松實現。

  方法一:用js實現讓網站實現簡體和繁體轉換代碼

  js簡體,繁體轉換,IE7通過,Firefox不通過,可能原因是var obj=document.body.childNodes

  Firefox不能識別。希望以后能修正。js使用了jquery,請下載jquery,js代碼請下載/Files/genson/transfroms.rar
頁面代碼:
                            <span id="spanT">
                            |<A  href="#" class="topMenu" >繁體中文</A>
                            </span> 
                            <span id="spanS">
                            |<A  href="#" class="topMenu" >簡體中文</A>     
                            </span>   

  方法二:.net代碼實現讓網站實現簡體和繁體轉換代碼
//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 button1_Click(object sender, EventArgs e)
{
EncodeRobert edControl = new EncodeRobert();//創建一個簡繁轉換對象
txtResult.Text= edControl.SCTCConvert(ConvertType.Simplified, ConvertType.Traditional,txtSource.Text);//進行簡繁轉換
}
}
}


注意:using EncodeMy;并非.net自帶的類庫,在Encode.dll中。要引用一下的。
請到http://download.csdn.net/source/617532
http://download.csdn.net/user/farawayplace613下載(不需要資源分的)該實例的代碼。Encode.dll在Debug的文件夾內。


//Form1.Designer.cs
namespace TestEnCode
{
partial class Form1
{
/// <summary>
/// 必需的設計器變量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的資源。
/// </summary>
/// <param name="disposing">如果應釋放托管資源,為 true;否則為 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows 窗體設計器生成的代碼
/// <summary>
/// 設計器支持所需的方法 - 不要
/// 使用代碼編輯器修改此方法的內容。
/// </summary>
private void InitializeComponent()
{
this.txtSource = new System.Windows.Forms.TextBox();
this.txtResult = 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.txtSource.Location = new System.Drawing.Point(75, 26);
this.txtSource.Name = "txtSource";
this.txtSource.Size = new System.Drawing.Size(100, 22);
this.txtSource.TabIndex = 0;
//
// txtResult
//
this.txtResult.Location = new System.Drawing.Point(75, 126);
this.txtResult.Name = "txtResult";
this.txtResult.Size = new System.Drawing.Size(100, 22);
this.txtResult.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 = "簡繁轉換";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_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 = "轉換源";
//
// 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 = "轉換結果";
//
// 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.txtResult);
this.Controls.Add(this.txtSource);
this.Name = "Form1";
this.Text = "簡繁體轉換測試";
this.ResumeLayout(false);
this.PerformLayout();
}
#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;
}



注意了,上面下載地下載的是VS2008創建的項目.
可能需要你把代碼拷貝到你自己的環境中。下載中重要的是Encode.dll。
1
查看完整版本: 讓網站實現簡體和繁體轉換代碼
主站蜘蛛池模板: 欧美国产日韩二区 | 欧美洲69xxxxx| www.天堂av| 日韩成人高清视频 | 日本视频在线观看免费 | va在线| 国产一级在线播放 | 热久久中文 | 国产精品久久久久久久久久久免费看 | 亚洲视频区 | 激情久久婷婷 | 黄色网址在线播放 | 亚洲av成人无码久久精品老人 | 成年人网站在线免费看 | 女人和拘做爰正片视频 | 精品少妇爆乳无码av无码专区 | 德国经典free性复古xxxx | 色.www| 男女无遮挡做爰猛烈视频 | 91视频小说 | 精品中文字幕av | 国内自拍视频一区 | 中文字幕一区二区三区人妻在线视频 | 在线观看www视频 | 99久久久无码国产精品 | 污污的网站在线免费观看 | 三级视频网 | 日韩欧美操 | 国产片在线观看视频 | 久久精品一区二区三区不卡牛牛 | 欧美在线www| 操操操视频 | 免费黄色一级大片 | 成人在线h| 国产毛片一区二区三区va在线 | 日韩国产第一页 | 极品人妻一区二区 | 国产在线精品自拍 | 综合一区在线 | 欧美精品在欧美一区二区 | 一区二区www |