代码拉取完成,页面将自动刷新
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)
{
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。