日期:2014-05-18 浏览次数:21071 次
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
string filename = "c:\\random.dat";
Random r = new Random(Guid.NewGuid().ToString().GetHashCode());
int size = r.Next(1000, 2000) * 1024; // size = 1~2MB
byte[] buffer = new byte[size];
r.NextBytes(buffer);
using (System.IO.FileStream fs = new System.IO.FileStream(filename, System.IO.FileMode.Create))
{
fs.Write(buffer, 0, size);
}
}
}
}
------解决方案--------------------
这...我想问问你是做啥滴