标签:
string[] file = Directory.GetFiles("E://VSProject//Url_Filter//Url_Filter//bin//Debug");
//先创建几个文件
string type = "mp3|mp4|doc|rmvb|txt|xls|exe|avi";
string path = System.AppDomain.CurrentDomain.BaseDirectory;
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
Random rand = new Random();
string[] ts = type.Split(‘|‘);
for (int i = 0; i < 1; i++)
{
File.Create(Path.Combine(path, Path.ChangeExtension(i.ToString(), ts[rand.Next(ts.Length)])));
}
string[] files = Directory.GetFiles(path, "*.dll");
foreach(string s in files)
{
Console.WriteLine(s);
}
标签:
原文地址:http://www.cnblogs.com/onlyforliu/p/5767621.html