🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: alt.pl.comp.lang.csharp
2 messages
2 total messages Started by ratullloch_delthis Sat, 04 Dec 2010 21:27
StreamWriter.WriteLine and ConsoleWriter.WriteLine Question tia sal22
#21861
Author: ratullloch_delthis
Date: Sat, 04 Dec 2010 21:27
29 lines
1902 bytes
StreamWriter.WriteLine and ConsoleWriter.WriteLine Question tia sal22

Greetings All
I have two lines that work seperatly but I'm having trouble 
mergeing the togther to export the combined version to a text file

Example:
Console.WriteLine(now.ToString("MM:dd:yyyy:hh:mm:ss.fff", ci));
gives me:                    12:04:2010:07:27:15.018

please note: this only shows up on the Console I'm not sure how 
to export this out to a text file correctly 


StreamWriter.WriteLine(String.Format("{0}{1},{2}", SampleCount * SamplePeriod, "\t\t", CurrentValue));
gives me: 1 	78.9098

I would like the data to be exported to a text file like
12:04:2010:07:27:15.018, 78.9098

I tried combining them like
StreamWriter.WriteLine(now.ToString("MM:dd:yyyy:hh:mm:ss.fff, {0}", ci,CurrentValue));
hopeing this would give me
12:04:2010:07:27:15.018, 78.9098

but it doesn't I think it's because the CurrentValue variable is a double but I thought the toString would convert it.
Any ideas

tia sal22
Re: StreamWriter.WriteLine and ConsoleWriter.WriteLine Question tia sal22
#21866
Author: JK
Date: Mon, 06 Dec 2010 20:09
36 lines
2184 bytes
W dniu 2010-12-04 22:27, ratullloch_delthis pisze:
> StreamWriter.WriteLine and ConsoleWriter.WriteLine Question tia sal22
>
> Greetings All
> I have two lines that work seperatly but I'm having trouble
> mergeing the togther to export the combined version to a text file
>
> Example:
> Console.WriteLine(now.ToString("MM:dd:yyyy:hh:mm:ss.fff", ci));
> gives me:                    12:04:2010:07:27:15.018
>
> please note: this only shows up on the Console I'm not sure how
> to export this out to a text file correctly
>
>
> StreamWriter.WriteLine(String.Format("{0}{1},{2}", SampleCount * SamplePeriod, "\t\t", CurrentValue));
> gives me: 1 	78.9098
>
> I would like the data to be exported to a text file like
> 12:04:2010:07:27:15.018, 78.9098
>
> I tried combining them like
> StreamWriter.WriteLine(now.ToString("MM:dd:yyyy:hh:mm:ss.fff, {0}", ci,CurrentValue));
> hopeing this would give me
> 12:04:2010:07:27:15.018, 78.9098
>
> but it doesn't I think it's because the CurrentValue variable is a double but I thought the toString would convert it.
> Any ideas
>
> tia sal22
>
>

You try use CurrentValue as TimeSpan;

JK
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads