Get/open temp file in .NET

后端 未结 4 1061
青春惊慌失措
青春惊慌失措 2021-01-17 12:01

I would like to do something like the below. What function returns me an unique file that is opened? so i can ensure it is mine and i wont overwrite anything or write a comp

4条回答
  •  失恋的感觉
    2021-01-17 12:34

    Another alternative is the TempFileCollection class. It provides an IDisposable wrapper much like what is suggested in the docs for Path.GetTempFileName().

提交回复
热议问题