Click here to Skip to main content
15,906,335 members
Home / Discussions / C#
   

C#

 
AnswerRe: Should not end my Application processes via Task Manager Pin
Ravi Bhavnani28-Jul-10 11:39
professionalRavi Bhavnani28-Jul-10 11:39 
QuestionMessage Removed Pin
28-Jul-10 1:57
willworknow128-Jul-10 1:57 
AnswerRe: Formatting a RichTextBox with indents/columns (or any other control) Pin
Luc Pattyn28-Jul-10 2:30
sitebuilderLuc Pattyn28-Jul-10 2:30 
QuestionDateTime.Now.ToLongDateString() Pin
Member 387988128-Jul-10 1:07
Member 387988128-Jul-10 1:07 
AnswerRe: DateTime.Now.ToLongDateString() Pin
OriginalGriff28-Jul-10 1:24
mveOriginalGriff28-Jul-10 1:24 
GeneralRe: DateTime.Now.ToLongDateString() Pin
Member 387988128-Jul-10 1:46
Member 387988128-Jul-10 1:46 
GeneralRe: DateTime.Now.ToLongDateString() Pin
OriginalGriff28-Jul-10 1:53
mveOriginalGriff28-Jul-10 1:53 
GeneralRe: DateTime.Now.ToLongDateString() Pin
Member 387988128-Jul-10 1:58
Member 387988128-Jul-10 1:58 
GeneralRe: DateTime.Now.ToLongDateString() Pin
Dave Kreskowiak28-Jul-10 3:30
mveDave Kreskowiak28-Jul-10 3:30 
GeneralRe: DateTime.Now.ToLongDateString() Pin
Dave Kreskowiak28-Jul-10 3:29
mveDave Kreskowiak28-Jul-10 3:29 
AnswerRe: DateTime.Now.ToLongDateString() Pin
Luc Pattyn28-Jul-10 2:36
sitebuilderLuc Pattyn28-Jul-10 2:36 
Questionincrease the font size of the text and size of the controls, when click on maximize button Pin
NarVish28-Jul-10 0:12
NarVish28-Jul-10 0:12 
AnswerRe: increase the font size of the text and size of the controls, when click on maximize button Pin
Łukasz Nowakowski28-Jul-10 0:35
Łukasz Nowakowski28-Jul-10 0:35 
AnswerRe: increase the font size of the text and size of the controls, when click on maximize button Pin
Nuri Ismail28-Jul-10 0:41
Nuri Ismail28-Jul-10 0:41 
GeneralRe: increase the font size of the text and size of the controls, when click on maximize button Pin
NarVish28-Jul-10 2:23
NarVish28-Jul-10 2:23 
GeneralRe: increase the font size of the text and size of the controls, when click on maximize button Pin
Nuri Ismail28-Jul-10 3:10
Nuri Ismail28-Jul-10 3:10 
QuestionGenerate Text File Pin
tek 200927-Jul-10 22:41
tek 200927-Jul-10 22:41 
AnswerRe: Generate Text File Pin
OriginalGriff27-Jul-10 22:52
mveOriginalGriff27-Jul-10 22:52 
GeneralRe: Generate Text File Pin
tek 200927-Jul-10 23:16
tek 200927-Jul-10 23:16 
GeneralRe: Generate Text File Pin
Pete O'Hanlon27-Jul-10 23:22
mvePete O'Hanlon27-Jul-10 23:22 
AnswerRe: Generate Text File Pin
tek 200927-Jul-10 23:36
tek 200927-Jul-10 23:36 
GeneralRe: Generate Text File Pin
OriginalGriff27-Jul-10 23:28
mveOriginalGriff27-Jul-10 23:28 
tek 2009 wrote:
want to write the data into a text file as a table


Well, a text file doesn't hold tables, it only holds flat data, so you will have to decide how to store it so that you can retrieve it later. To save it as flat text is simple:
Dictionary<string, string> dict = new Dictionary<string, string>();
dict.Add("Hello", "There");
dict.Add("Hello again", "There you");
dict.Add("Hello again again", "There you are");
using (TextWriter tw = File.CreateText(@"C:\\temp.txt"))
    {
    foreach (KeyValuePair<string, string> kvp in dict)
        {
        tw.WriteLine(kvp.Key + ":" + kvp.Value);
        }
    tw.Close();
    }
Anything more complex will need you to think about data storage in a bit more detail!
Did you know:
That by counting the rings on a tree trunk, you can tell how many other trees it has slept with.

AnswerRe: Generate Text File Pin
tek 200928-Jul-10 0:15
tek 200928-Jul-10 0:15 
GeneralRe: Generate Text File Pin
OriginalGriff28-Jul-10 0:20
mveOriginalGriff28-Jul-10 0:20 
AnswerRe: Generate Text File Pin
Peace ON27-Jul-10 22:53
Peace ON27-Jul-10 22:53 

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.