作业帮 > 综合 > 作业

c# 中文转拼音

来源:学生作业帮 编辑:搜搜做题作业网作业帮 分类:综合作业 时间:2024/04/30 02:23:33
c# 中文转拼音
c# 中文转拼音
C# GUI的:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication22
{
public partial class Form1 :Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender,EventArgs e)
{
string str = textBox1.Text;
MessageBox.Show(GetPYString(str));
}
public string GetPYString(string str)
{
string tempStr = "";
foreach (char c in str)//当前在text里的中文
{
if ((int)c >= 33 && (int)c