代码拉取完成,页面将自动刷新
using Chinese;
using System;
using System.IO;
using System.Windows.Forms;
namespace SuperWenZiToolBox
{
public partial class frmPinyin : Sunny.UI.UIForm
{
public frmPinyin()
{
InitializeComponent();
}
private void button4_Click(object sender, EventArgs e)
{
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
StreamReader sd = new StreamReader(openFileDialog1.FileName, System.Text.Encoding.GetEncoding(0));
richTextBox1.Text = sd.ReadToEnd();
}
}
private void button3_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(textBox1.Text))
{
MessageBox.Show("请先转换");
}
else
{
saveFileDialog1.Filter = "文本文档 | *.txt";
string autosave = IniManager.getString("Set", "AutoSave", "", Set.INIpath);
if (autosave == "True")
{
string filesavepath = IniManager.getString("Set", "FileSavePath", "", Set.INIpath);
if (filesavepath != "")
{
string nowtime = DateTime.Now.ToShortTimeString().ToString();
StreamWriter sw = new StreamWriter(filesavepath + "\\" + Guid.NewGuid().ToString() + ".txt");
sw.Write(textBox1.Text);
sw.Flush();
sw.Close();
}
else
{
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
StreamWriter sw = new StreamWriter(saveFileDialog1.FileName);
sw.Write(textBox1.Text);
sw.Flush();
sw.Close();
}
}
}
else
{
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
StreamWriter sw = new StreamWriter(saveFileDialog1.FileName);
sw.Write(textBox1.Text);
sw.Flush();
sw.Close();
}
}
}
}
private void button1_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(richTextBox1.Text))
{
MessageBox.Show("请输入文本");
}
else
{
toolStripStatusLabel1.Text = "正在转换";
textBox1.Text = Pinyin.GetString(richTextBox1.Text, PinyinFormat.Phonetic);
}
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。