2 Star 1 Fork 0

giser_km/Csharp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Form6.cs 2.18 KB
一键复制 编辑 原始数据 按行查看 历史
giser_km 提交于 2022-04-01 14:26 . form6
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.IO;
using System.Collections;
using Sunny.UI;
namespace Ui
{
public partial class Form6 : UIForm
{
public Form6()
{
InitializeComponent();
}
string row;
public int lenth=0;
int click=0;
private void button1_Click_1(object sender, EventArgs e)
{
click++;
if (click<lenth+1)
{
row += textBox1.Text + "%";
textBox1.Clear();
}
else
{
File.AppendAllLines(textBox2.Text,new string[] { "$"+row});
}
}
string[] vs2 = new string[10];
private void button2_Click(object sender, EventArgs e)
{
comboBox1.Items.Clear();
if (openFileDialog1.ShowDialog()==DialogResult.OK)
{
textBox2.Text = openFileDialog1.FileName.Trim();
List<string> list = new List<string>(File.ReadAllLines(openFileDialog1.FileName.Trim()));
foreach (string line in list)
{
if (line.Substring(0, 1) == "#")
{
//Console.WriteLine(line);
string[] vs = line.Substring(1, line.Length - 2).Split('!');
int n = 0;
foreach (var item in vs)
{
lenth++;
string[] vs1 = item.Split('@');
Console.WriteLine(vs1[1]);
comboBox1.Items.Add(vs1[0]);
vs2[n] = vs1[1];
n += 1;
}
}
}
}
}
private void comboBox1_SelectedValueChanged(object sender, EventArgs e)
{
label2.Text=vs2[comboBox1.SelectedIndex];
}
private void label4_Click(object sender, EventArgs e)
{
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/giser_km/csharp.git
git@gitee.com:giser_km/csharp.git
giser_km
csharp
Csharp
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385