My.Computer.FileSystem.GetTempFileName Method
Creates a uniquely named zero-byte temporary file on disk and returns the full path of that file.
' Usage
Dim value As String = My.Computer.FileSystem.GetTempFileName()
' Declaration
Public Function GetTempFileName() As String
Return Value
String that contains the full path of the temporary file.
Remarks
This method can be used to create a temporary file.
Example
This example creates a temp file and returns its path.
MsgBox("The file is located at " & _
My.Computer.FileSystem.GetTempFileName)
Requirements
Namespace:Microsoft.VisualBasic.MyServices
Class:FileSystemProxy (provides access to FileSystem)
Assembly: Visual Basic Runtime Library (in Microsoft.VisualBasic.dll)
Availability by Project Type
Project type |
Available |
---|---|
Windows Application |
Yes |
Class Library |
Yes |
Console Application |
Yes |
Windows Control Library |
Yes |
Web Control Library |
Yes |
Windows Service |
Yes |
Web Site |
Yes |
Permissions
The following permission may be required:
Permission |
Description |
---|---|
Controls the ability to access files and folders. Associated enumeration: Unrestricted. |
For more information, see Code Access Security and Requesting Permissions.
See Also
Reference
Other Resources
Creating, Deleting, and Moving Files and Directories in Visual Basic