The following example will demonstrates , How to generates the GUIDs.
class Program
{
static void Main(string[] args)
{
try
{
System.IO.StreamWriter file = new System.IO.StreamWriter("C:\\testGuID.txt");
for (int i = 0; i < 10; i++)
{
Guid guId = new Guid();
guId = Guid.NewGuid();
file.WriteLine(guId);
//Console.WriteLine(guId.ToString());
}
file.Close();
Console.ReadLine();
}
catch (Exception ex)
{
// exception
}
}
}
class Program
{
static void Main(string[] args)
{
try
{
System.IO.StreamWriter file = new System.IO.StreamWriter("C:\\testGuID.txt");
for (int i = 0; i < 10; i++)
{
Guid guId = new Guid();
guId = Guid.NewGuid();
file.WriteLine(guId);
//Console.WriteLine(guId.ToString());
}
file.Close();
Console.ReadLine();
}
catch (Exception ex)
{
// exception
}
}
}
0 comments:
Post a Comment