zoukankan      html  css  js  c++  java
  • 一般 武胜

    DataTable dt = new DataTable("Users");
                dt.Columns.Add("PK", typeof(int));
                dt.Columns.Add("#", typeof(int));

    row1["Popularity"]=0;
                dt.Rows.Add(row1);

    ublic static Color[] colors=new Color[]{Color.White, Color.SandyBrown,
                Color.LightGray, Color.Gold, Color.LightBlue};

    //临时文件

    System.Environment.GetEnvironmentVariable( "TEMP ");

    string windowsTempPath = Path.GetTempPath();
    string randomFileName = Path.GetRandomFileName();
    using System.IO;

    public class TempFile : IDisposable
    {
    private readonly string _tmpfile;

    public TempFile()
    : this(string.Empty)
    { }

    public TempFile(string extension)
    {
    _tmpfile = Path.GetTempFileName();
    if (!string.IsNullOrEmpty(extension))
    {
    string newTmpFile = _tmpfile + extension;

    // create tmp-File with new extension ...
    File.Create(newTmpFile, 0);
    // delete old tmp-File
    File.Delete(_tmpfile);

    // use new tmp-File
    _tmpfile = newTmpFile;
    }
    }

    public string FullPath
    {
    get { return _tmpfile; }
    }

    void IDisposable.Dispose()
    {
    if (!string.IsNullOrEmpty(_tmpfile) && File.Exists(_tmpfile))
    File.Delete(_tmpfile);
    }
    }

    //Example Use
    using(TempFile tmp = new TempFile(".png"))
    {
    string filename = tmp.FullPath;
    // use the file
    }

  • 相关阅读:
    Angular Material Starter App
    缺少标识符、字符串或数字
    jquery ajax post 传递数组 ,多checkbox 取值
    Circular dependencies cannot exist in RelativeLayout
    第二次作业
    第一次作业
    第一次作业
    软工实践个人总结
    第01组 Beta版本演示
    第01组 Beta冲刺(4/5)
  • 原文地址:https://www.cnblogs.com/zeroone/p/1898655.html
Copyright © 2011-2022 走看看