GetRandomFileName Method

Path.GetRandomFileName Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Returns a random folder name or file name.

Namespace:  System.IO
Assembly:  mscorlib (in mscorlib.dll)

'Declaration
Public Shared Function GetRandomFileName As String

Return Value

Type: System.String
A random folder name or file name.

The GetRandomFileName method returns a cryptographically strong, random string that can be used as either a folder name or a file name. Unlike GetTempFileName, GetRandomFileName does not create a file. When the security of your file system is paramount, this method should be used instead of GetTempFileName.

Windows Phone OS

Supported in: 8.1, 8.0

Show:
© 2016 Microsoft