Click here to Skip to main content
15,912,329 members
Home / Discussions / C#
   

C#

 
QuestionClassic ASP and C# syntax Pin
vanikanc14-Feb-13 8:11
vanikanc14-Feb-13 8:11 
AnswerRe: Classic ASP and C# syntax Pin
vanikanc14-Feb-13 10:54
vanikanc14-Feb-13 10:54 
Questionalphanumeric counter Pin
Angela Scheuvront14-Feb-13 7:41
Angela Scheuvront14-Feb-13 7:41 
I saw the previous post on this same type of question however it wasn't much help

Here is what I need to do
Start at
A0001... A9999 to B0000...Z9999 to AA000...ZZZZZ

I found this code but it didn't explain what to put in the the variables your passing to it.

C#
string base36Characters = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";

string toBase36(int x, int digits)
{
   char[] result = new char[digits];
    for (int i = digits - 1; i >= 0; --i)
    {
        result[i] = base36Characters[x % 36];
        x /= 36;
    }
    return new string(result);
}

IEnumerable<string> base36Counter()
{
    for (int n = 0; n < 36 * 36 * 36 * 36; ++n)
    {
        yield return toBase36(n, 4);
    }
}

void Run()
{
    foreach (string s in base36Counter())
        Console.WriteLine(s);
}

AnswerRe: alphanumeric counter Pin
Jibesh14-Feb-13 9:04
professionalJibesh14-Feb-13 9:04 
GeneralRe: alphanumeric counter Pin
Matt T Heffron14-Feb-13 9:28
professionalMatt T Heffron14-Feb-13 9:28 
GeneralRe: alphanumeric counter Pin
Jibesh14-Feb-13 9:29
professionalJibesh14-Feb-13 9:29 
GeneralRe: alphanumeric counter Pin
Matt T Heffron14-Feb-13 9:13
professionalMatt T Heffron14-Feb-13 9:13 
QuestionRe: alphanumeric counter Pin
Matt T Heffron14-Feb-13 9:52
professionalMatt T Heffron14-Feb-13 9:52 
AnswerRe: alphanumeric counter Pin
Angela Scheuvront14-Feb-13 10:15
Angela Scheuvront14-Feb-13 10:15 
GeneralRe: alphanumeric counter Pin
Matt T Heffron14-Feb-13 10:25
professionalMatt T Heffron14-Feb-13 10:25 
GeneralRe: alphanumeric counter Pin
Angela Scheuvront15-Feb-13 1:45
Angela Scheuvront15-Feb-13 1:45 
AnswerRe: alphanumeric counter Pin
Richard Deeming15-Feb-13 1:37
mveRichard Deeming15-Feb-13 1:37 
GeneralRe: alphanumeric counter Pin
Matt T Heffron15-Feb-13 7:39
professionalMatt T Heffron15-Feb-13 7:39 
QuestionStreamWriter.WriteAsync Pin
wizardzz14-Feb-13 6:15
wizardzz14-Feb-13 6:15 
AnswerRe: StreamWriter.WriteAsync Pin
Dave Kreskowiak14-Feb-13 7:31
mveDave Kreskowiak14-Feb-13 7:31 
GeneralRe: StreamWriter.WriteAsync Pin
wizardzz14-Feb-13 8:33
wizardzz14-Feb-13 8:33 
GeneralRe: StreamWriter.WriteAsync Pin
wizardzz14-Feb-13 8:55
wizardzz14-Feb-13 8:55 
Questionsingle selection of radio buttons in a table Pin
Member 258173814-Feb-13 4:36
Member 258173814-Feb-13 4:36 
AnswerRe: single selection of radio buttons in a table Pin
Richard MacCutchan14-Feb-13 4:58
mveRichard MacCutchan14-Feb-13 4:58 
AnswerRe: single selection of radio buttons in a table Pin
Alan Balkany14-Feb-13 5:04
Alan Balkany14-Feb-13 5:04 
QuestionBetter code Pin
ali_heidari_14-Feb-13 3:57
ali_heidari_14-Feb-13 3:57 
AnswerRe: Better code Pin
Alan Balkany14-Feb-13 4:50
Alan Balkany14-Feb-13 4:50 
GeneralRe: Better code Pin
Manfred Rudolf Bihy14-Feb-13 5:28
professionalManfred Rudolf Bihy14-Feb-13 5:28 
QuestionRe: Better code Pin
ali_heidari_14-Feb-13 5:40
ali_heidari_14-Feb-13 5:40 
AnswerRe: Better code Pin
Alan Balkany14-Feb-13 5:50
Alan Balkany14-Feb-13 5:50 

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.