c# - EDITED: Where and how should download temp files? -


says that I want to run an XE from the Web, well, clearly I'll call it a temporary folder I want to download in There, and remove it (or the OS does this) Are there any such conventions to do this, while overwriting existing files, without permission issues?

Thank you.

Edit I recommend the desktop application. BTW, I have a lot of speculation, but I'm wondering what has been accepted.

I know that I can use the Path.GetTempFile , but then it has already made the file to me, which helps me to think that he It can also add to some DB, and keep an eye on it - so I can not remove it and can not replace it with my own file.

I know I can also use it Path.TempDirectory (or something similar) and path. RandomFileName , but later adds a random extension for the filename, while I need an XK, obviously it can be very solan easily, but I think MS is already for us Have tried to write whether I feel strange to re-write.

"post-text" itemprop = "text">

I needed to write a Windows update to auto update and I found myself in a similar booth where I got the latest installer temporarily There was a need to download before executing it in place. There is not much information about best practices in this field, so I trust "Tools" which was offered to ASP.Net / C #.

I created the absolute path to the downloaded file using Path.GetTempPath () and the downloaded file name. Here are some sample codes:

  string url = "http://www.domain.com/install.exe"; String path = path. GetTempPath (); String filename = path. GetFileName (url); String tmpFile = Path.Combine (path, fileName);  

The bottom line I think is your viewpoint about using System.IO.Path temp * functions - although I can not find a document to support it. . / P>


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -