Click here to Skip to main content
15,886,873 members
Home / Discussions / C#
   

C#

 
GeneralRe: graphics Pin
cshivaprasad2-May-06 0:08
cshivaprasad2-May-06 0:08 
QuestionDerived CollectionBase Class overwriting previous entries. Pin
Steven_Henley1-May-06 20:24
Steven_Henley1-May-06 20:24 
QuestionWebBrowser / HtmlElement Class Help Pin
joetoday1-May-06 19:32
joetoday1-May-06 19:32 
AnswerRe: WebBrowser / HtmlElement Class Help Pin
leppie1-May-06 20:25
leppie1-May-06 20:25 
GeneralRe: WebBrowser / HtmlElement Class Help Pin
joetoday2-May-06 11:35
joetoday2-May-06 11:35 
Questionreading a file in C# Pin
leanhsang1-May-06 17:36
leanhsang1-May-06 17:36 
AnswerRe: reading a file in C# Pin
CWIZO1-May-06 21:23
CWIZO1-May-06 21:23 
AnswerRe: reading a file in C# Pin
stancrm1-May-06 23:21
stancrm1-May-06 23:21 
using System;
using System.IO;

namespace MyApplication
{
	class Class1
	{
		[STAThread]
		static void Main(string[] args)
		{
			if(File.Exists("output.txt"))
			{
				File.Delete("output.txt");
			}

			StreamReader streamReader = new StreamReader("input.txt");
			StreamWriter streamWriter = new StreamWriter("output.txt");

			while(true)
			{
				try
				{
					string[] texts = streamReader.ReadLine().Split(' ');
					int[] numbers = new int[texts.Length];

					for(int i = 0; i < texts.Length; i++)
					{
						numbers[i] = Int32.Parse(texts[i]);
					}

					Array.Sort(numbers);

					string newString = "";
					for(int i = 0; i < numbers.Length; i++)
					{
						newString += numbers[i].ToString();

						if(i != numbers.Length - 1)
						{
							newString += " ";
						}
					}

					streamWriter.WriteLine(newString);
				}
				catch
				{
					break;
				}
			}

			streamReader.Close();
			streamWriter.Close();
		}
	}
}

QuestionDocument Properties Pin
smarttom991-May-06 17:16
smarttom991-May-06 17:16 
QuestionRecommendation Pin
John L. DeVito1-May-06 15:05
professionalJohn L. DeVito1-May-06 15:05 
AnswerRe: Recommendation Pin
Michael A. Barnhart1-May-06 15:17
Michael A. Barnhart1-May-06 15:17 
AnswerRe: Recommendation Pin
Al Ortega1-May-06 15:56
Al Ortega1-May-06 15:56 
AnswerRe: Recommendation Pin
Joe Woodbury1-May-06 18:14
professionalJoe Woodbury1-May-06 18:14 
QuestionChanging Order of Items in a Bound ListBox Pin
myNameIsRon1-May-06 12:25
myNameIsRon1-May-06 12:25 
AnswerRe: Changing Order of Items in a Bound ListBox Pin
Josh Smith2-May-06 1:30
Josh Smith2-May-06 1:30 
GeneralRe: Changing Order of Items in a Bound ListBox Pin
myNameIsRon2-May-06 16:05
myNameIsRon2-May-06 16:05 
QuestionData Grid - Setting Current Column and arrow key capture Pin
Michael A. Barnhart1-May-06 12:15
Michael A. Barnhart1-May-06 12:15 
QuestionDLL question Pin
Tom Wright1-May-06 12:12
Tom Wright1-May-06 12:12 
AnswerRe: DLL question Pin
Robin Panther1-May-06 13:07
Robin Panther1-May-06 13:07 
QuestionPassportIdentity.Compress - ?? Pin
BlackDice1-May-06 11:23
BlackDice1-May-06 11:23 
GeneralRe: PassportIdentity.Compress - ?? Pin
Office Lineman1-May-06 13:53
Office Lineman1-May-06 13:53 
GeneralRe: PassportIdentity.Compress - ?? Pin
BlackDice2-May-06 5:28
BlackDice2-May-06 5:28 
QuestionEnumerator question Pin
jbricker771-May-06 9:28
jbricker771-May-06 9:28 
AnswerRe: Enumerator question Pin
Josh Smith1-May-06 9:32
Josh Smith1-May-06 9:32 
GeneralRe: Enumerator question Pin
jbricker772-May-06 2:48
jbricker772-May-06 2:48 

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.