Click here to Skip to main content
15,921,660 members
Home / Discussions / C#
   

C#

 
AnswerRe: System.Diagnostics.Process.StartInfo Username= "default user"? Pin
kubben27-Mar-07 7:57
kubben27-Mar-07 7:57 
GeneralRe: System.Diagnostics.Process.StartInfo Username= "default user"? Pin
Austin Harris27-Mar-07 8:48
Austin Harris27-Mar-07 8:48 
GeneralRe: System.Diagnostics.Process.StartInfo Username= "default user"? Pin
kubben27-Mar-07 9:19
kubben27-Mar-07 9:19 
QuestionAuto generated number Pin
Neo_Shehpar27-Mar-07 6:44
Neo_Shehpar27-Mar-07 6:44 
AnswerRe: Auto generated number Pin
Leslie Sanford27-Mar-07 7:23
Leslie Sanford27-Mar-07 7:23 
GeneralRe: Auto generated number Pin
Christian Graus27-Mar-07 7:26
protectorChristian Graus27-Mar-07 7:26 
AnswerRe: Auto generated number Pin
Christian Graus27-Mar-07 7:24
protectorChristian Graus27-Mar-07 7:24 
AnswerRe: Auto generated number Pin
Austin Harris27-Mar-07 7:27
Austin Harris27-Mar-07 7:27 
Something like this do the trick?

<code>
public static string nextNumber(string num)
{
if (num == "")
num = "AAA-0000";
string[] parts = num.Split(new char[] { '-' }, System.StringSplitOptions.RemoveEmptyEntries);
if(parts.Length == 2) // else incorect format
{
string charPart = parts[0];
string intPart = parts[1];
int part = 0;
int.TryParse(intPart, out part);
if (part < 9999)
{
part++;
}
else
{
part = 0;
// we must now increment the char part.
bool incrementedChar = false;
int position = charPart.Length - 1;
while (!incrementedChar)
{
if (charPart[position] >= 'Z')
{
// set last char to A,
char[] chars = charPart.ToCharArray();// = charPart[position]+1;
chars[position] = 'A';
charPart = chars.ToString();
if (position > 0)
{--position;}
else
{
// we are at 'ZZZZ'
}
// and the next position to char++ (do this in the next iteration).
}
else
{
// we increment the char at this position
char[] chars = charPart.ToCharArray();// = charPart[position]+1;
++chars[position];
charPart = chars.ToString();
incrementedChar = true;
}
}

num = charPart + part.ToString("-0000");
}
}
return num;
}
</code>
AnswerRe: Auto generated number Pin
kubben27-Mar-07 7:42
kubben27-Mar-07 7:42 
GeneralRe: Auto generated number Pin
Austin Harris27-Mar-07 8:52
Austin Harris27-Mar-07 8:52 
GeneralRe: Auto generated number Pin
kubben27-Mar-07 9:13
kubben27-Mar-07 9:13 
AnswerRe: Auto generated number Pin
Neo_Shehpar29-Mar-07 11:02
Neo_Shehpar29-Mar-07 11:02 
Questionhow to get logged in user name Pin
Nkuttynasi27-Mar-07 6:40
Nkuttynasi27-Mar-07 6:40 
AnswerRe: how to get logged in user name Pin
Not Active27-Mar-07 6:46
mentorNot Active27-Mar-07 6:46 
QuestionTranspose - Converting columns to rows Pin
BanarasiBhaiya27-Mar-07 6:33
BanarasiBhaiya27-Mar-07 6:33 
QuestionQuickly need a listing of classes/methods/signatures - how? Pin
sherifffruitfly27-Mar-07 6:21
sherifffruitfly27-Mar-07 6:21 
AnswerRe: Quickly need a listing of classes/methods/signatures - how? Pin
Christian Graus27-Mar-07 6:30
protectorChristian Graus27-Mar-07 6:30 
AnswerRe: Quickly need a listing of classes/methods/signatures - how? Pin
Not Active27-Mar-07 6:30
mentorNot Active27-Mar-07 6:30 
GeneralRe: Quickly need a listing of classes/methods/signatures - how? Pin
sherifffruitfly27-Mar-07 6:53
sherifffruitfly27-Mar-07 6:53 
QuestionCan you compile in C# i.e. cntrl F7 Pin
LCI27-Mar-07 6:03
LCI27-Mar-07 6:03 
AnswerRe: Can you compile in C# i.e. cntrl F7 Pin
Not Active27-Mar-07 6:12
mentorNot Active27-Mar-07 6:12 
AnswerRe: Can you compile in C# i.e. cntrl F7 Pin
Christian Graus27-Mar-07 6:12
protectorChristian Graus27-Mar-07 6:12 
QuestionHow to get the data in the ListView? Pin
Khoramdin27-Mar-07 5:25
Khoramdin27-Mar-07 5:25 
AnswerRe: How to get the data in the ListView? Pin
Saikek27-Mar-07 7:01
Saikek27-Mar-07 7:01 
QuestionRe: How to get the data in the ListView? Pin
Khoramdin27-Mar-07 7:07
Khoramdin27-Mar-07 7:07 

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.