Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
M

mehmetali_06

@mehmetali_06
About
Posts
2
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • c# binary to decimal code -new-
    M mehmetali_06

    This code for binary to decimal. I didint see like this easy code. The other calculating codes are too long and complex. I made this and you can use easily.

    C# csharp data-structures help

  • c# binary to decimal code -new-
    M mehmetali_06

    private void button1_Click(object sender, EventArgs e)
    {
    if (textBox1.Text.Length > 0)
    {
    string sayii = textBox1.Text.Substring(0, textBox1.Text.Length);
    uint[] sayicc = new uint[textBox1.Text.Length];

                for (int i = 0; i < textBox1.Text.Length; i++)
                {
                    sayicc\[i\] = Convert.ToUInt32(sayii\[i\] - 48);
    
                }
    
                uint\[\] dizi2 = new uint\[textBox1.Text.Length\];
                uint bit = 1;
    
                for (int j = 0; j < textBox1.Text.Length; j++)
                {
                    dizi2\[j\] = bit;
                    bit \*= 2;
                }
                Array.Reverse(dizi2);
                uint deger = 0;
                for (int i = 0; i <= dizi2.Length - 1; i++)
                {
                    dizi2\[i\] \*= sayicc\[i\];
    
                    if (sayicc\[i\] == 1)
                    {
                        deger += dizi2\[i\];
                    }
                }
                textBox2.Text = "  " + deger.ToString();
            }
            else
            {
                MessageBox.Show("Deger girilecek alan boş.", "HATA!!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
    
    C# csharp data-structures help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups