Created
July 21, 2015 14:14
-
-
Save Fhernd/049a710862a31288c4bf to your computer and use it in GitHub Desktop.
Uso del método Path.GetRandomFileName en C#.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// OrtizOL - xCSw - http://ortizol.blogspot.com | |
using System; | |
using System.IO; | |
namespace Receta.CSharp.R0521 | |
{ | |
public class UsoGetRandomFileName | |
{ | |
public static void Main() | |
{ | |
Console.WriteLine(Environment.NewLine); | |
string cadenaAleatoria = Path.GetRandomFileName(); | |
for (int i = 1; i <= 25; ++i) | |
{ | |
Console.WriteLine("Nombre de archivo aleatorio (criptográficamente fuerte): {0}", | |
cadenaAleatoria); | |
cadenaAleatoria = Path.GetRandomFileName(); | |
} | |
Console.WriteLine(Environment.NewLine); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment