Click here to Skip to main content
15,889,724 members
Home / Discussions / C#
   

C#

 
AnswerRe: how to separate date and time from a string Pin
Pete O'Hanlon29-Mar-11 3:17
mvePete O'Hanlon29-Mar-11 3:17 
GeneralRe: how to separate date and time from a string Pin
Thomas Krojer29-Mar-11 3:30
Thomas Krojer29-Mar-11 3:30 
GeneralRe: how to separate date and time from a string [modified] Pin
Pete O'Hanlon29-Mar-11 3:34
mvePete O'Hanlon29-Mar-11 3:34 
AnswerRe: how to separate date and time from a string Pin
RobCroll29-Mar-11 14:45
RobCroll29-Mar-11 14:45 
AnswerRe: how to separate date and time from a string Pin
PIEBALDconsult29-Mar-11 15:05
mvePIEBALDconsult29-Mar-11 15:05 
AnswerRe: how to separate date and time from a string Pin
ascap5-Apr-11 20:14
ascap5-Apr-11 20:14 
AnswerRe: how to separate date and time from a string Pin
Ganesh Kumar Kaki13-Apr-11 2:20
Ganesh Kumar Kaki13-Apr-11 2:20 
QuestionSystem.Math.Max(System.Threading.Interlocked.Increment(ref i), i - 1); functionality Pin
Pierre besquent29-Mar-11 1:19
Pierre besquent29-Mar-11 1:19 
Hi,
I get a program c# when googling that validates the IBAN :
static bool isIban (string code_iban)
		{
			// 1. Enlever les caractères indésirables (espaces, tirets, ...)=> Seuls les lettres majuscules et les chiffres sont autorisés
			code_iban = code_iban.ToUpper () ;
			StringBuilder    sb = new StringBuilder ();
			foreach ( char car in code_iban)
			{
				if (char.IsDigit (car) || char.IsLetter (car))
				     sb.Append (car);
			}
			code_iban = sb.ToString ();
			if (code_iban.Length < 15 || code_iban.Length > 34)
				return false;
			// 2. Déplacer les 4 premiers caractères à droite
			string iban  = code_iban.Substring(4, code_iban.Length - 4) + code_iban.Substring(0, 4);
			// 3. Convertir les lettres en chiffres via une table de conversion (A=10, B=11, C=12 etc.)
			StringBuilder    sb2 = new StringBuilder ();
			foreach (char c in iban)
			{
				int entier;
				if (char.IsLetter(c))
					entier = Convert.ToChar (c) - Convert.ToChar ("A") + 10;
				else
					entier = Convert.ToChar (c) - Convert.ToChar ("0");
				sb2.Append (entier);
			}
			string checkSumString = sb2.ToString();
			// 4. Diviser le nombre ainsi obtenu par 97. 
			int  checksum = int.Parse(checkSumString.Substring(0, 1));
			int  i = 1;
			while (i < checkSumString.Length)
			{
				int v = int.Parse(checkSumString.Substring(i, 1));
				checksum *= 10;
				checksum += v;
				checksum = checksum % 97;
				System.Math.Max(System.Threading.Interlocked.Increment(ref i), i - 1);
			}
			if (checksum == 1)
				return true;
			else 
				return false;
		}
	}

I understand all only the functionality of System.Math.Max(System.Threading.Interlocked.Increment(ref i), i - 1);
ty
AnswerRe: System.Math.Max(System.Threading.Interlocked.Increment(ref i), i - 1); functionality Pin
Pete O'Hanlon29-Mar-11 1:24
mvePete O'Hanlon29-Mar-11 1:24 
GeneralRe: System.Math.Max(System.Threading.Interlocked.Increment(ref i), i - 1); functionality Pin
Pierre besquent29-Mar-11 1:29
Pierre besquent29-Mar-11 1:29 
GeneralRe: System.Math.Max(System.Threading.Interlocked.Increment(ref i), i - 1); functionality PinPopular
Pete O'Hanlon29-Mar-11 2:16
mvePete O'Hanlon29-Mar-11 2:16 
GeneralRe: System.Math.Max(System.Threading.Interlocked.Increment(ref i), i - 1); functionality Pin
DaveyM6929-Mar-11 7:40
professionalDaveyM6929-Mar-11 7:40 
AnswerRe: System.Math.Max(System.Threading.Interlocked.Increment(ref i), i - 1); functionality Pin
Rob Philpott29-Mar-11 1:38
Rob Philpott29-Mar-11 1:38 
AnswerRe: System.Math.Max(System.Threading.Interlocked.Increment(ref i), i - 1); functionality Pin
Luc Pattyn29-Mar-11 1:52
sitebuilderLuc Pattyn29-Mar-11 1:52 
AnswerCross post Pin
Not Active29-Mar-11 2:27
mentorNot Active29-Mar-11 2:27 
GeneralRe: Cross post Pin
Luc Pattyn29-Mar-11 3:32
sitebuilderLuc Pattyn29-Mar-11 3:32 
GeneralRe: Cross post Pin
Not Active29-Mar-11 3:42
mentorNot Active29-Mar-11 3:42 
GeneralRe: Cross post Pin
Luc Pattyn29-Mar-11 4:20
sitebuilderLuc Pattyn29-Mar-11 4:20 
QuestionEvent-Based programming Pin
reversing28-Mar-11 22:06
reversing28-Mar-11 22:06 
AnswerRe: Event-Based programming Pin
Pete O'Hanlon28-Mar-11 22:13
mvePete O'Hanlon28-Mar-11 22:13 
GeneralRe: Event-Based programming Pin
reversing28-Mar-11 22:19
reversing28-Mar-11 22:19 
GeneralRe: Event-Based programming Pin
Pete O'Hanlon28-Mar-11 22:46
mvePete O'Hanlon28-Mar-11 22:46 
AnswerRe: Event-Based programming Pin
PIEBALDconsult29-Mar-11 2:45
mvePIEBALDconsult29-Mar-11 2:45 
QuestionC# Warnings Pin
karthikgowda28-Mar-11 21:04
karthikgowda28-Mar-11 21:04 
AnswerRe: C# Warnings Pin
Pritesh Aryan28-Mar-11 21:14
Pritesh Aryan28-Mar-11 21:14 

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.