Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace WindowsFormsApplication1
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- }
- public static string code(string numeroUtilisateur)
- {
- string str = "";
- int num = 0;
- for (int i = 0; i < numeroUtilisateur.Length; i++)
- {
- if (numeroUtilisateur[i] != '-')
- {
- str = str + "BCDFGHJKMPQRTVWXY2346789"[Convert.ToInt16((int)(numeroUtilisateur[i] + i)) % 0x17];
- num++;
- if ((num % 3) == 0)
- {
- str = str + "-";
- }
- }
- }
- if (str.LastIndexOf('-') == (str.Length - 1))
- {
- str = str.Substring(0, str.Length - 1);
- }
- return str;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement