1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

Sum of form entries

Discussion in 'C#' started by flxbbs, Sep 8, 2010.

  1. flxbbs

    flxbbs New Member

    Joined:
    May 5, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hello!
    I'm a beginner C# programmer, I just want to know how would I go around writing a script that adds digit entered in a form?:undecided
     
  2. dotNet Zombie

    dotNet Zombie New Member

    Joined:
    Aug 28, 2010
    Messages:
    34
    Likes Received:
    10
    Trophy Points:
    0
    Occupation:
    .Net Developers
    Location:
    Minnesota
    Home Page:
    something like this

    Code:
    int x = 0;
    foreach (char c in textBox1.Text)
    {
          x += Convert.ToInt32(c.ToString());
    }
     MessageBox.Show(x.ToString());
    
     
    shabbir likes this.
  3. chwax

    chwax New Member

    Joined:
    May 4, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    network admin
    Location:
    Africa kenya
    first gotta read welcome to c# then start workin
     

Share This Page