更新时间:2023-11-23 10:09:28
没有,没有等同于mkdtemp。***的办法是使用 GetTempPath 和GetRandomFileName.
No, there is no equivalent to mkdtemp. The best option is to use a combination of GetTempPath and GetRandomFileName.
您将需要code与此类似:
You would need code similar to this:
public string GetTemporaryDirectory()
{
string tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
Directory.CreateDirectory(tempDirectory);
return tempDirectory;
}