1 Star 3 Fork 0

齐博文/SuperTextToolBox

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
frmPinyin.cs 2.83 KB
一键复制 编辑 原始数据 按行查看 历史
齐博文 提交于 2023-07-10 14:51 . 2.0.8.0
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);
}
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/Qibowen2008/SuperTextToolBox.git
[email protected]:Qibowen2008/SuperTextToolBox.git
Qibowen2008
SuperTextToolBox
SuperTextToolBox
main

搜索帮助

0d507c66 1850385 C8b1a773 1850385