Click here to Skip to main content
15,794,377 members
Home / Discussions / C#
   

C#

 
GeneralRe: Blazor: IEnumerable ElementAt Pin
OriginalGriff3-Jan-22 7:28
mvaOriginalGriff3-Jan-22 7:28 
Questioncausing the computer to freeze Pin
Calin Negru2-Jan-22 5:01
Calin Negru2-Jan-22 5:01 
AnswerRe: causing the computer to freeze Pin
Gerry Schmitz2-Jan-22 5:42
mveGerry Schmitz2-Jan-22 5:42 
GeneralRe: causing the computer to freeze Pin
Calin Negru3-Jan-22 9:11
Calin Negru3-Jan-22 9:11 
AnswerRe: causing the computer to freeze Pin
OriginalGriff2-Jan-22 7:29
mvaOriginalGriff2-Jan-22 7:29 
GeneralRe: causing the computer to freeze Pin
Calin Negru3-Jan-22 7:13
Calin Negru3-Jan-22 7:13 
GeneralRe: causing the computer to freeze Pin
OriginalGriff3-Jan-22 7:45
mvaOriginalGriff3-Jan-22 7:45 
AnswerRe: causing the computer to freeze Pin
#realJSOP3-Jan-22 0:53
mve#realJSOP3-Jan-22 0:53 
A while loop without some sort of exit will cause the application to freeze, but will leave the OS alone (as long as the stack is filled up, or a some sort of min/max value isn't reached).

This will execute forever, freezing the app, but leaving the OS responsive:

C#
public void MethodX(string x)
{
    while (true)
    {
    }
}


This will eventually crash the app with a stack overflow exception:

C#
...
MethodX("");
...

public void MethodX(string x)
{
    while (true)
    {
        MethodX("1234567890");
    }
}


This will run forever:
public void MethodY()
{
    int x = 0;
    while (true)
    {
        x = x + 100000;
    }
}


This will eventually crash the app with an OutOfMemoryException:

C#
...
MethodZ("1234567890");
...

private static void MethodZ(string x)
{
	while(true)
	{
		x = x + x;
		Console.WriteLine(x.Length.ToString());
	}
}

".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

AnswerRe: causing the computer to freeze Pin
0x01AA5-Jan-22 5:40
mve0x01AA5-Jan-22 5:40 
QuestionAsync/Await Questions Pin
Kevin Marois30-Dec-21 8:35
professionalKevin Marois30-Dec-21 8:35 
AnswerRe: Async/Await Questions Pin
Gerry Schmitz30-Dec-21 19:43
mveGerry Schmitz30-Dec-21 19:43 
QuestionRead signature data from APK's RSA signature file Pin
mynametaken30-Dec-21 5:46
mynametaken30-Dec-21 5:46 
AnswerRe: Read signature data from APK's RSA signature file Pin
jschell30-Dec-21 8:35
jschell30-Dec-21 8:35 
GeneralRe: Read signature data from APK's RSA signature file Pin
mynametaken1-Jan-22 6:53
mynametaken1-Jan-22 6:53 
AnswerRe: Read signature data from APK's RSA signature file Pin
Luc Pattyn30-Dec-21 8:44
sitebuilderLuc Pattyn30-Dec-21 8:44 
GeneralRe: Read signature data from APK's RSA signature file Pin
mynametaken1-Jan-22 6:56
mynametaken1-Jan-22 6:56 
GeneralRe: Read signature data from APK's RSA signature file Pin
Luc Pattyn1-Jan-22 6:59
sitebuilderLuc Pattyn1-Jan-22 6:59 
GeneralRe: Read signature data from APK's RSA signature file Pin
mynametaken9-Jan-22 5:37
mynametaken9-Jan-22 5:37 
AnswerRe: Read signature data from APK's RSA signature file Pin
jschell23-Jan-22 7:49
jschell23-Jan-22 7:49 
QuestionWinform support in Windows service Pin
Member 1260803930-Dec-21 0:59
Member 1260803930-Dec-21 0:59 
AnswerRe: Winform support in Windows service Pin
OriginalGriff30-Dec-21 1:27
mvaOriginalGriff30-Dec-21 1:27 
GeneralRe: Winform support in Windows service Pin
Member 1260803930-Dec-21 2:28
Member 1260803930-Dec-21 2:28 
GeneralRe: Winform support in Windows service Pin
OriginalGriff30-Dec-21 3:08
mvaOriginalGriff30-Dec-21 3:08 
AnswerRe: Winform support in Windows service Pin
#realJSOP30-Dec-21 2:20
mve#realJSOP30-Dec-21 2:20 
QuestionDynamically change int from a string Pin
Matte Matik29-Dec-21 13:02
Matte Matik29-Dec-21 13:02 

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.