Click here to Skip to main content
15,910,787 members
Home / Discussions / C#
   

C#

 
QuestionHow to generate random number [modified] Pin
D i x y22-Feb-08 20:50
D i x y22-Feb-08 20:50 
GeneralRe: How to generate base64 random number Pin
Hesham Amin22-Feb-08 22:36
Hesham Amin22-Feb-08 22:36 
GeneralRe: How to generate base64 random number Pin
D i x y22-Feb-08 22:45
D i x y22-Feb-08 22:45 
GeneralRe: How to generate base64 random number Pin
Gareth H23-Feb-08 0:08
Gareth H23-Feb-08 0:08 
GeneralRe: How to generate base64 random number Pin
Christoph Menge23-Feb-08 0:17
Christoph Menge23-Feb-08 0:17 
GeneralRe: How to generate base64 random number Pin
Guffa23-Feb-08 0:25
Guffa23-Feb-08 0:25 
GeneralRe: How to generate base64 random number Pin
D i x y23-Feb-08 0:53
D i x y23-Feb-08 0:53 
GeneralRe: How to generate base64 random number Pin
Hesham Amin23-Feb-08 5:24
Hesham Amin23-Feb-08 5:24 
You can use GUIDs. or use Cryptography classes (as RNGCryptoServiceProvider) to generate the random value.
The advantage of using RNGCryptoServiceProvider is that you can select the length of the generated value.

Here is an example (I choosed the length = 50):
using System.Security.Cryptography;
.
.
.
byte[] data = new byte[50];
RNGCryptoServiceProvider rand = new RNGCryptoServiceProvider();

for (int i = 0; i < 50; i++)
{
    rand.GetBytes(data);

    string s = Convert.ToBase64String(data);

    Console.WriteLine(s);
}


Hesham A. Amin
My blog

GeneralC# windows service is not showing in Control panel services Pin
Satish - Developer22-Feb-08 20:12
Satish - Developer22-Feb-08 20:12 
AnswerRe: C# windows service is not showing in Control panel services Pin
Mohammed Shahab23-Feb-08 1:36
Mohammed Shahab23-Feb-08 1:36 
QuestionHow to get clear figure in windows application? Pin
Aravinthan22-Feb-08 19:25
Aravinthan22-Feb-08 19:25 
AnswerRe: How to get clear figure in windows application? Pin
Christian Graus22-Feb-08 19:41
protectorChristian Graus22-Feb-08 19:41 
GeneralRe: How to get clear figure in windows application? Pin
Aravinthan22-Feb-08 21:59
Aravinthan22-Feb-08 21:59 
NewsVTD-XML 2.3 Pin
Jimmy Zhang22-Feb-08 19:00
Jimmy Zhang22-Feb-08 19:00 
GeneralRe: VTD-XML 2.3 Pin
Christian Graus22-Feb-08 19:05
protectorChristian Graus22-Feb-08 19:05 
GeneralRe: VTD-XML 2.3 Pin
Jimmy Zhang22-Feb-08 19:16
Jimmy Zhang22-Feb-08 19:16 
GeneralFailed to load provider type Pin
paulb22-Feb-08 18:27
paulb22-Feb-08 18:27 
GeneralRe: Failed to load provider type Pin
Hesham Amin22-Feb-08 22:40
Hesham Amin22-Feb-08 22:40 
GeneralRe: Failed to load provider type Pin
paulb23-Feb-08 0:36
paulb23-Feb-08 0:36 
GeneralOpenVPN bandwidth controlling Pin
vikramspce198322-Feb-08 17:38
vikramspce198322-Feb-08 17:38 
GeneralAccessing Thunderbird data using C# Pin
Umer Sheikh22-Feb-08 16:20
Umer Sheikh22-Feb-08 16:20 
GeneralRe: Accessing Thunderbird data using C# Pin
N a v a n e e t h22-Feb-08 17:44
N a v a n e e t h22-Feb-08 17:44 
GeneralRe: Accessing Thunderbird data using C# Pin
Umer Sheikh23-Feb-08 6:02
Umer Sheikh23-Feb-08 6:02 
GeneralRe: Accessing Thunderbird data using C# Pin
situ2113-Apr-11 20:15
situ2113-Apr-11 20:15 
GeneralDataTables Problem Pin
Xmen Real 22-Feb-08 14:46
professional Xmen Real 22-Feb-08 14:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.