Click here to Skip to main content
15,920,596 members
Home / Discussions / C#
   

C#

 
Answernot a Pin
Luc Pattyn31-Oct-09 8:14
sitebuilderLuc Pattyn31-Oct-09 8:14 
AnswerRe: question Pin
dan!sh 31-Oct-09 9:34
professional dan!sh 31-Oct-09 9:34 
AnswerRe: question Pin
Pete O'Hanlon31-Oct-09 9:54
mvePete O'Hanlon31-Oct-09 9:54 
AnswerRe: question Pin
Richard MacCutchan31-Oct-09 10:49
mveRichard MacCutchan31-Oct-09 10:49 
AnswerRe: question Pin
Christian Graus31-Oct-09 11:13
protectorChristian Graus31-Oct-09 11:13 
QuestionVisual C# 2010 - Application Crashes At A Certain Time (Causing VS2010 To Crash As Well) Pin
Ben Magee31-Oct-09 6:47
Ben Magee31-Oct-09 6:47 
AnswerRe: Visual C# 2010 - Application Crashes At A Certain Time (Causing VS2010 To Crash As Well) Pin
N a v a n e e t h31-Oct-09 7:25
N a v a n e e t h31-Oct-09 7:25 
AnswerRe: Visual C# 2010 - Application Crashes At A Certain Time (Causing VS2010 To Crash As Well) Pin
Luc Pattyn31-Oct-09 7:31
sitebuilderLuc Pattyn31-Oct-09 7:31 
Hi,

you need to figure out where things go wrong. Start by using a try-catch block, and displaying the exception, all of it. Hence use something along these lines:

try {
    // existing code goes here
} catch (Exception exc) {
    Console.WriteLine(exc.ToString());
}


You can do this in the button click handler, in the generate() method, etc.

Then watch the line numbers (and tell Visual to always show them, see here[^])


BTW: your program looks terrible. Many things seem less than good.
- Why are you writing and reading files all the time? Don't you trust the computer's memory?
FYI: there are File methods that read or write all text of a file.
- For random numbers, you should only have a single RNG and call Next on it, instead of creating new ones.
- generate() is recursive. Any idea what keeps it from recursing forever? (which would cause a StackOverflowException).
- and please stop abusing the var keyword, use real types instead.

Smile | :)

Luc Pattyn

I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages


GeneralRe: Visual C# 2010 - Application Crashes At A Certain Time (Causing VS2010 To Crash As Well) Pin
Ben Magee31-Oct-09 7:56
Ben Magee31-Oct-09 7:56 
GeneralRe: Visual C# 2010 - Application Crashes At A Certain Time (Causing VS2010 To Crash As Well) Pin
Luc Pattyn31-Oct-09 8:13
sitebuilderLuc Pattyn31-Oct-09 8:13 
GeneralRe: Visual C# 2010 - Application Crashes At A Certain Time (Causing VS2010 To Crash As Well) Pin
Ben Magee31-Oct-09 8:30
Ben Magee31-Oct-09 8:30 
GeneralRe: Visual C# 2010 - Application Crashes At A Certain Time (Causing VS2010 To Crash As Well) Pin
Richard MacCutchan31-Oct-09 10:50
mveRichard MacCutchan31-Oct-09 10:50 
GeneralRe: Visual C# 2010 - Application Crashes At A Certain Time (Causing VS2010 To Crash As Well) Pin
Ben Magee31-Oct-09 23:27
Ben Magee31-Oct-09 23:27 
GeneralRe: Visual C# 2010 - Application Crashes At A Certain Time (Causing VS2010 To Crash As Well) Pin
Richard MacCutchan31-Oct-09 23:59
mveRichard MacCutchan31-Oct-09 23:59 
AnswerRe: Visual C# 2010 - Application Crashes At A Certain Time (Causing VS2010 To Crash As Well) Pin
PIEBALDconsult31-Oct-09 13:20
mvePIEBALDconsult31-Oct-09 13:20 
GeneralRe: Visual C# 2010 - Application Crashes At A Certain Time (Causing VS2010 To Crash As Well) Pin
Ben Magee31-Oct-09 23:09
Ben Magee31-Oct-09 23:09 
GeneralRe: Visual C# 2010 - Application Crashes At A Certain Time (Causing VS2010 To Crash As Well) Pin
PIEBALDconsult1-Nov-09 3:29
mvePIEBALDconsult1-Nov-09 3:29 
QuestionWeb.sitemap updating, but Menu is not updating... why??? Pin
Timothy OBrien31-Oct-09 6:46
Timothy OBrien31-Oct-09 6:46 
QuestionHow i can make my mobile as modem by c# program Pin
Abdaqader31-Oct-09 5:33
Abdaqader31-Oct-09 5:33 
AnswerRe: How i can make my mobile as modem by c# program Pin
Henry Minute31-Oct-09 6:04
Henry Minute31-Oct-09 6:04 
Questionhow to get the throughput of my hard disk during the latest period of time Pin
sinron31-Oct-09 4:52
sinron31-Oct-09 4:52 
AnswerRe: how to get the throughput of my hard disk during the latest period of time Pin
Randor 1-Nov-09 11:26
professional Randor 1-Nov-09 11:26 
GeneralRe: how to get the throughput of my hard disk during the latest period of time Pin
sinron2-Nov-09 0:14
sinron2-Nov-09 0:14 
QuestionConsuming Web service in VS2008 [modified] Pin
Aftab Sindhi31-Oct-09 3:08
Aftab Sindhi31-Oct-09 3:08 
QuestionCOM port problem Pin
Reza Shojaee31-Oct-09 1:14
Reza Shojaee31-Oct-09 1:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.