• Web sitemizin içeriğine ve tüm hizmetlerimize erişim sağlamak için Web sitemize kayıt olmalı ya da giriş yapmalısınız. Web sitemize üye olmak tamamen ücretsizdir.
  • Sohbetokey.com ile canlı okey oynamaya ne dersin? Hem sohbet et, hem mobil okey oyna!
  • Soru mu? Sorun mu? ''Bir Sorum Var?'' sistemimiz aktiftir. Paylaşın beraber çözüm üretelim.

C Sharp Uygulama Telefon No ve İsim Olarak Girilen Numarayı Gösterme

Üyelik Tarihi
7 Ocak 2015
Konular
4,091
Mesajlar
4,274
MFC Puanı
40
Kod:
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 C_Sharp_Telefon_Numara_Listesi
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            harfler.AddRange(new string[] { "ABC", "DEF", "GHIİ", "JKL", "MNOÖ", "PQRS", "TUÜV", "WXYZ" });
        }

        private **** btnTelefonNoGetir_Click(object sender, EventArgs e)
        {
            string telefonAdi ="";

            if (txtTelefonNo.Text.Length > 8)
            {
                telefonAdi = txtTelefonNo.Text.Substring(3, 5);
            }
            else
            {
                telefonAdi = txtTelefonNo.Text.Substring(3);
            }
            string numara = GetNumber(telefonAdi);

            MessageBox.Show("444" + numara, "Telefon Numarası", MessageBoxButtons.OK, MessageBoxIcon.Information);

        }
 
        public  List harfler =new List ();

        public string GetNumber(string ad)
        {
            List numara = new List();

            string adnumara = "";

            for (int i = 0; i < ad.Length; i++)
            {
                for (int j = 0; j < harfler.Count; j++)
                {
                    if (harfler[j].Contains(ad[i].ToString().ToUpper()))
                    {
                        numara.Add(j+2);
                    }
                }
            }

            for (int i = 0; i < 5; i++)
            {
                if (5 - numara.Count > i)
                {
                    adnumara += "0";
                }
                else
                {
                    adnumara += numara[i-(5-numara.Count)];
                }
            }

            return adnumara;
        }
    }
}
 
Üst