txt隨機(jī)生成器,用于隨機(jī)生成多個(gè)txt文本文件的小程序,可以自定義生成數(shù)量。
該軟件是用C#編寫(xiě)的,以下是程序源碼:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Threading;
namespace 隨機(jī)生成txt
{
public partial class FrmMain : Form
{
public FrmMain()
{
InitializeComponent();
}
int Num = 0;
private void Form1_Load(object sender, EventArgs e)
{
}
void CreateTxt()
{
for (int i = 0; i < Num; i++)
{
StreamWriter sw = new StreamWriter(i.ToString() + ".txt");
sw.WriteLine(i.ToString() + " " + DateTime.Now.ToString());
sw.Close();
}
MessageBox.Show("生成完畢!");
}
private void button1_Click(object sender, EventArgs e)
{
Num = Convert.ToInt32(numUd.Value);
Thread t = new Thread(CreateTxt);
t.Start();
}
}
}
- PC官方版
- 安卓官方手機(jī)版
- IOS官方手機(jī)版