هیچ کاری بزرگی نیست مگر ایده ای قبل آن باشد

کد تایید صحت کد ملی در سی شارپ

نویسنده :Niko Bellic
تاریخ:یکشنبه 9 آذر 1393-11:50 ق.ظ

احتمالا میدونید که کد ملی الگوریتم داره,  شما میتونید با استفاده از این الگوریتم تشخیص بدید کد ملی درسته یا تصادفی وارد شده.
این کد بیشتر در فرم های ثبت نام بدرد میخوره.

در ضمن میتونید با استفاده از کد ملی صحیح به محل صدور شناسنامه طرف پی ببرید.

در کد زیر کاربرد کد ملی رو در RegTxtNationalCode وارد میکنه
و در صورت صحیح بودن قالب کد ملی متغیر باینری res برابر True میشه.


bool res = false;
                string code = RegTxtNationalcode.Text;
                int L = RegTxtNationalcode.TextLength;
                if (L < 8 || int.Parse(RegTxtNationalcode.Text) == 0) res = false;

                code = ("0000" + code).Substring(L + 4 - 10);
                if (int.Parse(code.Substring(3, 6)) == 0) res = false;

                var c = int.Parse(code.Substring(9, 1));
                var s = 0;
                for (var i = 0; i < 9; i++)
                    s += int.Parse(code.Substring(i, 1)) * (10 - i);
                s = s % 11;
                res = (s < 2 && c == s) || (s >= 2 && c == (11 - s));



Premium Grade CBD Reviews
سه شنبه 22 بهمن 1398 04:29 ب.ظ
Good blog! I truly love how it is simple on my eyes and the data
are well written. I'm wondering how I could be notified when a
new post has been made. I have subscribed to your feed which must
do the trick! Have a nice day!
Blue Power Male Enhancement
یکشنبه 13 بهمن 1398 08:10 ب.ظ
Thanks for sharing superb informations. Your web-site is very cool.
I am impressed by the details that you've on this site.
It reveals how nicely you understand this subject. Bookmarked this website page, will come back
for extra articles. You, my pal, ROCK! I found just the info I already searched all over the place and simply could
not come across. What a perfect site.
Diamond 247 Keto Review
چهارشنبه 20 آذر 1398 12:57 ق.ظ
Way cool! Some very valid points! I appreciate you penning this write-up and the rest of the website is also really good.
http://duhism.com/a/?_keto_body_tone_reviews_811833
یکشنبه 28 مهر 1398 09:32 ب.ظ
As soon as I noticed this internet site I went on reddit to share some of the
love with them.
http://Dxampmaleenhancement.org/
یکشنبه 28 مهر 1398 07:32 ب.ظ
I always was interested in this topic and stock still am,
thank you for posting.
http://ketoprimerx.net/
شنبه 9 شهریور 1398 08:28 ق.ظ
hi!,I like your writing very much! percentage
we be in contact extra about your article
on AOL? I need an expert on this house to resolve my problem.
Maybe that is you! Looking forward to see you.
http://blacklineedgemaleformula.com/
دوشنبه 14 مرداد 1398 06:39 ق.ظ
Touche. Outstanding arguments. Keep up the great spirit.
RXZ Male Enhancement - Try RXZ For An Easy Fix! | Special Offer!
یکشنبه 13 مرداد 1398 06:48 ق.ظ
I've read some excellent stuff here. Definitely price bookmarking for
revisiting. I surprise how much effort you set to create any such fantastic
informative site.
Activator Pro Testosterone Reviews
چهارشنبه 26 تیر 1398 11:42 ق.ظ
Hello, just wanted to tell you, I liked this post.

It was helpful. Keep on posting!
https://speakerdeck.com/weiss97rivera
چهارشنبه 5 تیر 1398 11:52 ب.ظ
I am constantly thought about this, regards for putting up.
https://www.datafilehost.com/d/716df323
چهارشنبه 5 تیر 1398 11:52 ب.ظ
After I initially commented I appear to have
clicked on the -Notify me when new comments are
added- checkbox and from now on every time a comment is added I get 4 emails with the exact same comment.
Perhaps there is an easy method you can remove me from that service?
Cheers!
viagra china
شنبه 18 خرداد 1398 07:00 ق.ظ

Attractive part of content. I just stumbled upon your website and in accession capital to claim that I acquire actually loved account your blog posts. Anyway I will be subscribing for your feeds or even I success you get right of entry to constantly quickly.
https://led-displays.ru/azs
سه شنبه 3 اردیبهشت 1398 12:01 ق.ظ
ロレックス デイトジャスト 116231 コピー 時計
https://www.sheetplantassociation.com/user
سه شنبه 27 فروردین 1398 11:00 ب.ظ
楽天ブランドコピー 代引き激安市場/ブランドコピーバッグ/財布スーパーコピー 代引き激安
http://www.camping-lacoscolleda.com/en/services
سه شنبه 27 فروردین 1398 10:58 ب.ظ
ブランド(AICOPY56 BRAND)スーパーコピーバッグ通販専門店、弊社はブランドバッグコピーを販売するネットショップでございます,製造技術がかなり成熟し偽物
http://www.vistaprops.com/fr/availability/office
یکشنبه 18 فروردین 1398 04:19 ق.ظ
ブランドコピー 代引き 国内発送
Can Pilates make you look taller?
شنبه 14 مرداد 1396 12:00 ب.ظ
I don't even know how I ended up here, but I thought this post
was good. I do not know who you are but definitely you're going
to a famous blogger if you are not already ;) Cheers!
Foot Issues
شنبه 7 مرداد 1396 11:36 ق.ظ
Saved as a favorite, I love your site!
 
لبخندناراحتچشمک
نیشخندبغلسوال
قلبخجالتزبان
ماچتعجبعصبانی
عینکشیطانگریه
خندهقهقههخداحافظ
سبزقهرهورا
دستگلتفکر








شبکه اجتماعی فارسی کلوب | Buy Website Traffic