zoukankan      html  css  js  c++  java
  • 文件创建与文件格式的修改

    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);
    }

    只有不断学习,才可进步。
  • 相关阅读:
    Codeforces 798C
    Codeforces 798B
    Codeforces 798A
    HDU
    HDU
    HDU
    加速cin的技巧
    Codeforces Gym
    Codeforces Gym
    Solutions to an Equation LightOJ
  • 原文地址:https://www.cnblogs.com/onlyforliu/p/5767621.html
Copyright © 2011-2022 走看看