运行前截图:
运行后截图:
//=================程序代码===================================
using System;
using System.Windows.Forms;
using System.IO;
using System.Threading;
namespace textbox_Output
{
public partial class Form1 : Form
{
int count = 10;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
textBox1.Clear();
string name = textBox2.Text;
string path = textBox3.Text;
StreamWriter sw = File.CreateText(path+ name +".txt");
string[,] str = new string[count, count];
double[] VDD = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
double[] freq = { 25.000001, 25.000002, 25.000003, 25.000004, 25.000005, 25.000006, 25.000007, 25.000008, 25.000009, 25.000010 };
for (int i = 0; i < 10; i++)
{
string Vcc= Convert.ToString(VDD[i]);
string Fr= Convert.ToString(freq[i]);
sw.WriteLine(Vcc+ " "+ Fr + "\r\n");
textBox1.AppendText (Vcc + " " + Fr + "\r\n");
Thread.Sleep(1000);
}
sw.Flush();
sw.Close();
}
}
}