Error reading TextBox value in C# -


i'm having problems making program read text textbox. i'm reading 2 values 2 textboxes seems nothing reading. ends happening enter values textboxes , press button enter values program. have set print out values in textboxes, when prints, looks didn't read textboxes.

here's code window:

using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.threading.tasks; using system.windows.forms;  namespace giveaway_program {     public partial class giveawayprogram : form     {         public giveawayentry[] entries = {};          public giveawayprogram()         {             initializecomponent();         }          private void giveaway_load(object sender, eventargs e)         {          }          private void panel_paint(object sender, painteventargs e)         {          }          private void emailtext_textchanged(object sender, eventargs e)         {          }          private void nametext_textchanged(object sender, eventargs e)         {          }          private void numberoftimes_valuechanged(object sender, eventargs e)         {          }          private void addtolist_click(object sender, eventargs e)         {             addentry(new giveawayentry(emailtext.text, nametext.text));         }          private void generatewinner_click(object sender, eventargs e)         {          }          private void addentry(giveawayentry newentry)         {             giveawayentry[] newentries = new giveawayentry[entries.length + 1];             array.copy(entries, newentries, entries.length);             entries = newentries;              (int = 0; < entries.length; i++)             {                 console.writeline("name: " + entries[i].name + ", email: " + entries[i].email);             }         }     } } 

here's struct values go into:

using system; using system.collections.generic; using system.linq; using system.text; using system.threading.tasks;  namespace giveaway_program {     public struct giveawayentry     {         string email, name;          public giveawayentry(string _email, string _name)         {             email = _email;             name = _name;         }          public string email         {                         {                 return email;             }         }          public string name         {                         {                 return name;             }         }     } } 

and here's console output program:

'giveaway program.vshost.exe' (clr v4.0.30319: giveaway program.vshost.exe): loaded 'c:\windows\microsoft.net\assembly\gac_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'. skipped loading symbols. module optimized , debugger option 'just code' enabled. 'giveaway program.vshost.exe' (clr v4.0.30319: giveaway program.vshost.exe): loaded 'c:\windows\assembly\gac_msil\microsoft.visualstudio.hostingprocess.utilities\14.0.0.0__b03f5f7f11d50a3a\microsoft.visualstudio.hostingprocess.utilities.dll'. skipped loading symbols. module optimized , debugger option 'just code' enabled. 'giveaway program.vshost.exe' (clr v4.0.30319: giveaway program.vshost.exe): loaded 'c:\windows\microsoft.net\assembly\gac_msil\system.windows.forms\v4.0_4.0.0.0__b77a5c561934e089\system.windows.forms.dll'. skipped loading symbols. module optimized , debugger option 'just code' enabled. 'giveaway program.vshost.exe' (clr v4.0.30319: giveaway program.vshost.exe): loaded 'c:\windows\microsoft.net\assembly\gac_msil\system\v4.0_4.0.0.0__b77a5c561934e089\system.dll'. skipped loading symbols. module optimized , debugger option 'just code' enabled. 'giveaway program.vshost.exe' (clr v4.0.30319: giveaway program.vshost.exe): loaded 'c:\windows\microsoft.net\assembly\gac_msil\system.drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\system.drawing.dll'. skipped loading symbols. module optimized , debugger option 'just code' enabled. 'giveaway program.vshost.exe' (clr v4.0.30319: giveaway program.vshost.exe): loaded 'c:\windows\assembly\gac_msil\microsoft.visualstudio.hostingprocess.utilities.sync\14.0.0.0__b03f5f7f11d50a3a\microsoft.visualstudio.hostingprocess.utilities.sync.dll'. skipped loading symbols. module optimized , debugger option 'just code' enabled. 'giveaway program.vshost.exe' (clr v4.0.30319: giveaway program.vshost.exe): loaded 'c:\windows\assembly\gac_msil\microsoft.visualstudio.debugger.runtime\14.0.0.0__b03f5f7f11d50a3a\microsoft.visualstudio.debugger.runtime.dll'. skipped loading symbols. module optimized , debugger option 'just code' enabled. 'giveaway program.vshost.exe' (clr v4.0.30319: giveaway program.vshost.exe): loaded 'c:\users\overlord nate\google drive\projects\giveaway program\giveaway program\bin\debug\giveaway program.vshost.exe'. skipped loading symbols. module optimized , debugger option 'just code' enabled. 'giveaway program.vshost.exe' (clr v4.0.30319: giveaway program.vshost.exe): loaded 'c:\windows\microsoft.net\assembly\gac_msil\system.core\v4.0_4.0.0.0__b77a5c561934e089\system.core.dll'. skipped loading symbols. module optimized , debugger option 'just code' enabled. 'giveaway program.vshost.exe' (clr v4.0.30319: giveaway program.vshost.exe): loaded 'c:\windows\microsoft.net\assembly\gac_msil\system.xml.linq\v4.0_4.0.0.0__b77a5c561934e089\system.xml.linq.dll'. skipped loading symbols. module optimized , debugger option 'just code' enabled. 'giveaway program.vshost.exe' (clr v4.0.30319: giveaway program.vshost.exe): loaded 'c:\windows\microsoft.net\assembly\gac_msil\system.data.datasetextensions\v4.0_4.0.0.0__b77a5c561934e089\system.data.datasetextensions.dll'. skipped loading symbols. module optimized , debugger option 'just code' enabled. 'giveaway program.vshost.exe' (clr v4.0.30319: giveaway program.vshost.exe): loaded 'c:\windows\microsoft.net\assembly\gac_msil\microsoft.csharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\microsoft.csharp.dll'. skipped loading symbols. module optimized , debugger option 'just code' enabled. 'giveaway program.vshost.exe' (clr v4.0.30319: giveaway program.vshost.exe): loaded 'c:\windows\microsoft.net\assembly\gac_32\system.data\v4.0_4.0.0.0__b77a5c561934e089\system.data.dll'. skipped loading symbols. module optimized , debugger option 'just code' enabled. 'giveaway program.vshost.exe' (clr v4.0.30319: giveaway program.vshost.exe): loaded 'c:\windows\microsoft.net\assembly\gac_msil\system.deployment\v4.0_4.0.0.0__b03f5f7f11d50a3a\system.deployment.dll'. skipped loading symbols. module optimized , debugger option 'just code' enabled. 'giveaway program.vshost.exe' (clr v4.0.30319: giveaway program.vshost.exe): loaded 'c:\windows\microsoft.net\assembly\gac_msil\system.net.http\v4.0_4.0.0.0__b03f5f7f11d50a3a\system.net.http.dll'. skipped loading symbols. module optimized , debugger option 'just code' enabled. 'giveaway program.vshost.exe' (clr v4.0.30319: giveaway program.vshost.exe): loaded 'c:\windows\microsoft.net\assembly\gac_msil\system.xml\v4.0_4.0.0.0__b77a5c561934e089\system.xml.dll'. skipped loading symbols. module optimized , debugger option 'just code' enabled. thread 0xd4c has exited code 0 (0x0). thread 0x28e8 has exited code 0 (0x0). 'giveaway program.vshost.exe' (clr v4.0.30319: giveaway program.vshost.exe): loaded 'c:\users\overlord nate\google drive\projects\giveaway program\giveaway program\bin\debug\giveaway program.exe'. symbols loaded. 'giveaway program.vshost.exe' (clr v4.0.30319: giveaway program.vshost.exe): loaded 'c:\windows\microsoft.net\assembly\gac_msil\system.configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\system.configuration.dll'. skipped loading symbols. module optimized , debugger option 'just code' enabled. name: , email:  thread 0x2ec0 has exited code 0 (0x0). thread 0x1630 has exited code 0 (0x0). program '[6500] giveaway program.vshost.exe' has exited code 0 (0x0). 

the 'name: , email: ' thing values supposed be.

thank in advance help, , if need anymore information, , provide.

    private void addentry(giveawayentry newentry)     {         giveawayentry[] newentries = new giveawayentry[entries.length + 1];         array.copy(entries, newentries, entries.length);         entries = newentries;          (int = 0; < entries.length; i++)         {             console.writeline("name: " + entries[i].name + ", email: " + entries[i].email);         }     } 
  1. you not adding newentry array
  2. it easier if used list<giveawayentry>
  3. there's no need make struct. use class unless have compelling reason make struct

Comments

Popular posts from this blog

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -