🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.pl.comp.lang.csharp
Article #21866

Re: StreamWriter.WriteLine and ConsoleWriter.WriteLine Question tia sal22

#21866
From: 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
Technical Details
Message-ID: <idjfu8$ku2$1@news.onet.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.nask.pl!news.nask.org.pl!news.onet.pl!.POSTED!not-for-mail
References: <SmyKo.501772$rT.372096@en-nntp-06.dc1.easynews.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.nask.pl!news.nask.org.pl!news.onet.pl!.POSTED!not-for-mail
From: JK <januszkielesinski@poczta.onet.pl>
Newsgroups: microsoft.public.dotnet.languages.csharp,alt.pl.comp.lang.csharp
Subject: Re: StreamWriter.WriteLine and ConsoleWriter.WriteLine Question tia sal22
Date: Mon, 06 Dec 2010 21:09:36 +0100
Organization: http://onet.pl
Lines: 36
Message-ID: <idjfu8$ku2$1@news.onet.pl>
References: <SmyKo.501772$rT.372096@en-nntp-06.dc1.easynews.com>
NNTP-Posting-Host: 91.188.112.187
Mime-Version: 1.0
X-Trace: news.onet.pl 1291666184 21442 91.188.112.187 (6 Dec 2010 20:09:44 GMT)
X-Complaints-To: niusy@onet.pl
NNTP-Posting-Date: Mon, 6 Dec 2010 20:09:44 +0000 (UTC)
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6 ThunderBrowse/3.3.4
In-Reply-To: <SmyKo.501772$rT.372096@en-nntp-06.dc1.easynews.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit