libKimlik 1.0.0
dotnet add package libKimlik --version 1.0.0
NuGet\Install-Package libKimlik -Version 1.0.0
<PackageReference Include="libKimlik" Version="1.0.0" />
paket add libKimlik --version 1.0.0
#r "nuget: libKimlik, 1.0.0"
// Install libKimlik as a Cake Addin #addin nuget:?package=libKimlik&version=1.0.0 // Install libKimlik as a Cake Tool #tool nuget:?package=libKimlik&version=1.0.0
Türkçe
libKimlik Kütüphanesi
libKimlik
kütüphanesi, Türkiye Cumhuriyeti Kimlik Numarasını (TC Kimlik No) doğrulama ve kontrol işlemleri yapmak için kullanılır. Bu belge, kütüphanenin işlevselliğini ve kullanımını anlatmaktadır.
TCKimlikNo Sınıfı
TCKimlikNo
sınıfı, TC Kimlik Numarasını temsil eden bir C# sınıfıdır. Aşağıda sınıfın özellikleri ve yöntemleri açıklanmıştır:
Özellikler
KimlikNo
- Türkiye Cumhuriyeti Kimlik Numarasını temsil eden long türünde bir özelliktir.
BirinciHane
, IkinciHane
, UcuncuHane
, DorduncuHane
, BesinciHane
, AltinciHane
, YedinciHane
, SekizinciHane
, DokuzuncuHane
, OnuncuHane
, OnbirinciHane
- TC Kimlik Numarasının her bir hanesini temsil eden int özellikleridir.
Yapıcı Metod
TCKimlikNo(long kimlikNo)
- Bu yapıcı metod, bir TC Kimlik Numarasını kabul eder ve numarayı analiz ederek sınıfın özelliklerini doldurur. Eğer verilen numara 11 haneli değilse bir exception fırlatılır.
Metodlar
Kontrol()
- TC Kimlik Numarasının doğruluğunu kontrol eder ve geçerli bir numara ise
true
, aksi haldefalse
döner.
async Task<bool> NVIKontrolAsync(string ad, string soyad, int dogumYili)
- Bu metod, TC Kimlik Numarasını, ad, soyad ve doğum yılı ile Nüfus ve Vatandaşlık İşleri Genel Müdürlüğü (NVİ) web servisi üzerinden doğrular. Eğer numara geçerliyse
true
, aksi haldefalse
döner.
Örnek Kullanım
Aşağıda TCKimlikNo
sınıfının nasıl kullanılacağına dair basit bir örnek bulunmaktadır:
long kimlikNo = 12345678901; // TC Kimlik Numarası
TCKimlikNo tcKimlik = new TCKimlikNo(kimlikNo);
if (tcKimlik.Kontrol())
{
Console.WriteLine("TC Kimlik Numarası geçerlidir.");
string ad = "John";
string soyad = "Doe";
int dogumYili = 1990;
bool dogrulamaSonucu = await tcKimlik.NVIKontrolAsync(ad, soyad, dogumYili);
if (dogrulamaSonucu)
{
Console.WriteLine("Kimlik doğrulama başarılı.");
}
else
{
Console.WriteLine("Kimlik doğrulama başarısız.");
}
}
else
{
Console.WriteLine("TC Kimlik Numarası geçersiz.");
}
Bu örnek, TCKimlikNo
sınıfını kullanarak bir TC Kimlik Numarasının doğruluğunu ve Nüfus ve Vatandaşlık İşleri Genel Müdürlüğü (NVİ) servisi üzerinden doğruluğunu nasıl kontrol edeceğinizi göstermektedir.
English
libKimlik Library
The libKimlik
library is used for validating and checking the Turkish Republic Identity Number (TC Kimlik No) in C#. This document explains the functionality and usage of the library.
TCKimlikNo Class
The TCKimlikNo
class represents a Turkish Republic Identity Number as a C# class. Below are the properties and methods of the class:
Properties
KimlikNo
- A long property representing the Turkish Republic Identity Number.
BirinciHane
, IkinciHane
, UcuncuHane
, DorduncuHane
, BesinciHane
, AltinciHane
, YedinciHane
, SekizinciHane
, DokuzuncuHane
, OnuncuHane
, OnbirinciHane
- Integer properties representing each digit of the TC Kimlik No.
Constructor Method
TCKimlikNo(long kimlikNo)
- This constructor takes a TC Kimlik No as input, analyzes the number, and populates the class properties. If the provided number is not 11 digits, an exception is thrown.
Methods
Kontrol()
- Checks the validity of the TC Kimlik No, returning
true
if it's valid andfalse
otherwise.
async Task<bool> NVIKontrolAsync(string ad, string soyad, int dogumYili)
- This method validates the TC Kimlik No against the General Directorate of Population and Citizenship Affairs (NVİ) web service using the provided TC Kimlik No, name, surname, and birth year. It returns
true
if the number is valid, andfalse
otherwise.
Example Usage
Here's a simple example of how to use the TCKimlikNo
class:
long kimlikNo = 12345678901; // TC Kimlik No
TCKimlikNo tcKimlik = new TCKimlikNo(kimlikNo);
if (tcKimlik.Kontrol())
{
Console.WriteLine("TC Kimlik No is valid.");
string name = "John";
string surname = "Doe";
int birthYear = 1990;
bool validationResult = await tcKimlik.NVIKontrolAsync(name, surname, birthYear);
if (validationResult)
{
Console.WriteLine("Identity validation successful.");
}
else
{
Console.WriteLine("Identity validation failed.");
}
}
else
{
Console.WriteLine("TC Kimlik No is invalid.");
}
This example demonstrates how to use the TCKimlikNo
class to check the validity of a Turkish Republic Identity Number and validate it against the General Directorate of Population and Citizenship Affairs (NVİ) service.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 is compatible. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.8
- No dependencies.
-
.NETStandard 2.0
- No dependencies.
-
net6.0
- No dependencies.
-
net7.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 282 | 11/3/2023 |
First Release