📜  以唯一名称保存文件 c# 代码示例

📅  最后修改于: 2022-03-11 14:49:10.360000             🧑  作者: Mango

代码示例1
public string GenerateFileName(string context)
{
    return context + "_" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + "_" + Guid.NewGuid().ToString("N");
}

filename1 = GenerateFileName("MeasurementData");
filename2 = GenerateFileName("Image");