Click here to Skip to main content
15,887,676 members
Home / Discussions / C#
   

C#

 
AnswerRe: display both in console and text file PinPopular
OriginalGriff19-Jul-12 21:19
mveOriginalGriff19-Jul-12 21:19 
QuestionHow to generate an own barcode generator without using using third party libraries? Pin
Akshay_8819-Jul-12 19:12
Akshay_8819-Jul-12 19:12 
AnswerRe: How to generate an own barcode generator without using using third party libraries? Pin
Wayne Gaylard19-Jul-12 19:46
professionalWayne Gaylard19-Jul-12 19:46 
AnswerRe: How to generate an own barcode generator without using using third party libraries? Pin
_Amy19-Jul-12 21:24
professional_Amy19-Jul-12 21:24 
AnswerRe: How to generate an own barcode generator without using using third party libraries? Pin
Pete O'Hanlon19-Jul-12 22:20
mvePete O'Hanlon19-Jul-12 22:20 
AnswerRe: Same question, same answer Pin
Luc Pattyn20-Jul-12 2:09
sitebuilderLuc Pattyn20-Jul-12 2:09 
AnswerRe: How to generate an own barcode generator without using using third party libraries? Pin
jschell20-Jul-12 7:42
jschell20-Jul-12 7:42 
GeneralRandom Selection Pin
ASPnoob19-Jul-12 7:22
ASPnoob19-Jul-12 7:22 
Hi all, I am trying to randomly select a character set from a list to be used in my function but I can't get it to work, below is what I have thus far.

public const string myChars1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
public const string myChars2 = "abcdefghijklmnopqrstuvwxyz";
public const string myChars3 = "0123456789";

private string RandomString()
{

char[] buffer = new char[24];
int i = 0;
while (i < 23)
{
int k = 0;
string S = "";
Random myRandomNum = new Random();
Random myRandomNum2 = new Random();
k= myRandNum2.Next(1,3);
S = Convert.ToChar(k);
buffer[i] = myChars+S[myRandNum.Next(myChars+S.Length)];
i++;

}
return new string(buffer);
}
I am trying to tack S to the end of myChars so that I will get myChars1, myChars2, or myChars3 randomly but it's not working. How could I achieve this? Any suggestions is greatly appreciated, thanks in advance for your help.

modified 19-Jul-12 13:32pm.

GeneralRe: Random Selection Pin
Luc Pattyn19-Jul-12 7:39
sitebuilderLuc Pattyn19-Jul-12 7:39 
GeneralMessage Removed Pin
19-Jul-12 7:42
professionalN_tro_P19-Jul-12 7:42 
AnswerRe: Random Selection Pin
Luc Pattyn19-Jul-12 7:54
sitebuilderLuc Pattyn19-Jul-12 7:54 
GeneralMessage Removed Pin
19-Jul-12 7:57
professionalN_tro_P19-Jul-12 7:57 
AnswerRe: Random Selection Pin
Luc Pattyn19-Jul-12 8:02
sitebuilderLuc Pattyn19-Jul-12 8:02 
GeneralRe: Random Selection Pin
ASPnoob19-Jul-12 7:46
ASPnoob19-Jul-12 7:46 
GeneralRe: Random Selection Pin
Dave Kreskowiak19-Jul-12 7:59
mveDave Kreskowiak19-Jul-12 7:59 
AnswerRe: Random Selection Pin
Luc Pattyn19-Jul-12 7:59
sitebuilderLuc Pattyn19-Jul-12 7:59 
GeneralMessage Closed Pin
19-Jul-12 8:14
WebMaster19-Jul-12 8:14 
GeneralRe: Random Selection Pin
ASPnoob19-Jul-12 8:56
ASPnoob19-Jul-12 8:56 
Questionhow to set the aspx text box value in console app Pin
Member 916988718-Jul-12 23:21
Member 916988718-Jul-12 23:21 
AnswerRe: how to set the aspx text box value in console app Pin
Karthik Harve18-Jul-12 23:44
professionalKarthik Harve18-Jul-12 23:44 
QuestionC# Installer Custom Actions Pin
glennPattonWork318-Jul-12 22:32
professionalglennPattonWork318-Jul-12 22:32 
AnswerRe: C# Installer Custom Actions Pin
Pete O'Hanlon18-Jul-12 22:41
mvePete O'Hanlon18-Jul-12 22:41 
GeneralRe: C# Installer Custom Actions Pin
glennPattonWork318-Jul-12 23:10
professionalglennPattonWork318-Jul-12 23:10 
GeneralRe: C# Installer Custom Actions Pin
Pete O'Hanlon18-Jul-12 23:19
mvePete O'Hanlon18-Jul-12 23:19 
GeneralRe: C# Installer Custom Actions Pin
glennPattonWork318-Jul-12 23:30
professionalglennPattonWork318-Jul-12 23:30 

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.