22 lines
343 B
C#
22 lines
343 B
C#
namespace PacketIO;
|
|
|
|
public class TempFile : IDisposable
|
|
{
|
|
public string FileName { get; }
|
|
|
|
public TempFile()
|
|
{
|
|
FileName = Path.GetTempFileName();
|
|
}
|
|
|
|
public Stream Open(FileMode mode)
|
|
{
|
|
return new FileStream(FileName, mode);
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
File.Delete(FileName);
|
|
}
|
|
}
|