Skip to content

Instantly share code, notes, and snippets.

@Fhernd
Created July 21, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fhernd/049a710862a31288c4bf to your computer and use it in GitHub Desktop.
Save Fhernd/049a710862a31288c4bf to your computer and use it in GitHub Desktop.
Uso del método Path.GetRandomFileName en C#.
// 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