How to generate words randomly

Discussion in 'ASP .Net' started by Raghuram, Aug 22, 2005.

  1. Raghuram

    Raghuram Guest

    I want to generate some set of chars which are more than 4 chars randomly. .
    .. how can i do that
     
    Raghuram, Aug 22, 2005
    #1
    1. Advertisements

  2. Guid!

    Guid MyGuid = Guid.NewGuid();

    Now MyGuid.ToString() will be a random generated string.

    You can break this down to be the desired length as well
     
    Grant Merwitz, Aug 22, 2005
    #2
    1. Advertisements

  3. Raghuram

    Karl Seguin Guest

    Karl Seguin, Aug 22, 2005
    #3
  4. Grant Merwitz, Aug 22, 2005
    #4
  5. Raghuram

    Lucas Tam Guest


    You use the Random classes in .NET to generate the password length, plus
    generate the random character:
    http://www.brettb.com/RandomNumbersInDotNet.asp

    To select the character, you would use the function:

    Convert.ToChar(i).ToString() where i is an integer (take a look at an ASCII
    table for the corresponding character).


    Here is an example:
    http://www.codeproject.com/csharp/randpassgen.asp
     
    Lucas Tam, Aug 22, 2005
    #5
  6. Raghuram

    Raghuram Guest

    Raghuram, Aug 22, 2005
    #6
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.