Advertisement
Fhernd

UsoGetRandomFileName.cs

Jul 21st, 2015
1,660
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.73 KB | None | 0 0
  1. // OrtizOL - xCSw - http://ortizol.blogspot.com
  2.  
  3. using System;
  4. using System.IO;
  5.  
  6. namespace Receta.CSharp.R0521
  7. {
  8.     public class UsoGetRandomFileName
  9.     {
  10.         public static void Main()
  11.         {
  12.             Console.WriteLine(Environment.NewLine);
  13.            
  14.             string cadenaAleatoria = Path.GetRandomFileName();
  15.            
  16.             for (int i = 1; i <= 25; ++i)
  17.             {
  18.                 Console.WriteLine("Nombre de archivo aleatorio (criptográficamente fuerte): {0}",
  19.                               cadenaAleatoria);
  20.                
  21.                 cadenaAleatoria = Path.GetRandomFileName();
  22.             }
  23.            
  24.             Console.WriteLine(Environment.NewLine);
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement