Click here to Skip to main content
15,913,910 members
Home / Discussions / C#
   

C#

 
GeneralRe: Unboxing Question Pin
jka34714-Apr-08 9:23
jka34714-Apr-08 9:23 
GeneralRe: Unboxing Question Pin
PIEBALDconsult14-Apr-08 17:29
mvePIEBALDconsult14-Apr-08 17:29 
GeneralSystem.NullException Error Pin
tcombs0714-Apr-08 8:26
tcombs0714-Apr-08 8:26 
GeneralRe: System.NullException Error Pin
Luc Pattyn14-Apr-08 9:01
sitebuilderLuc Pattyn14-Apr-08 9:01 
GeneralRe: System.NullException Error Pin
tcombs0714-Apr-08 9:29
tcombs0714-Apr-08 9:29 
GeneralRe: System.NullException Error Pin
Luc Pattyn14-Apr-08 9:56
sitebuilderLuc Pattyn14-Apr-08 9:56 
GeneralSQL statement Pin
vanessa12314-Apr-08 8:08
vanessa12314-Apr-08 8:08 
GeneralRe: SQL statement Pin
Rob Philpott14-Apr-08 8:18
Rob Philpott14-Apr-08 8:18 
GeneralRe: SQL statement Pin
Rob Philpott14-Apr-08 8:19
Rob Philpott14-Apr-08 8:19 
GeneralSerializing object. Need Help. Pin
zaboboa14-Apr-08 6:33
zaboboa14-Apr-08 6:33 
GeneralRe: Serializing object. Need Help. Pin
Zoltan Balazs14-Apr-08 7:23
Zoltan Balazs14-Apr-08 7:23 
GeneralC#: WriteEncrypedFileRaw Pin
rreeeddbb14-Apr-08 6:28
rreeeddbb14-Apr-08 6:28 
GeneralWindows Service Installer Pin
Madmaximus14-Apr-08 6:28
Madmaximus14-Apr-08 6:28 
General"The given path's format is not supported." Pin
shivapriyak14-Apr-08 4:36
shivapriyak14-Apr-08 4:36 
GeneralRe: "The given path's format is not supported." Pin
Mark J. Miller14-Apr-08 4:48
Mark J. Miller14-Apr-08 4:48 
A datetime string has characters which are illegal when used in file names. For example "/" is not allowed.

You could either try using DateTime.Now.Ticks which would give you a value which contains only numeric characters. Or you could try something like this:

<br />
DateTime time = DateTime.Now;<br />
String filename = time.Year.ToString("0000") + time.Month.ToString("00") + time.Day.ToString("00") + time.Hour("00") + time.Minute("00") + time.Second("00");<br />
<br />
private LogWriter DataLog = new LogWriter(new System.IO.StreamWriter( @"C:\"+filename+".txt", false ));<br />


A third option would be to use the String.Replace method to remove spaces ' ', colons ':' and forward slashes '/' from the datetime string.

Mark's blog: developMENTALmadness.blogspot.com

Funniest variable name:
lLongDong - spotted in legacy code, was used to determine how long a beep should be.
- Dave Bacher

GeneralRe: "The given path's format is not supported." Pin
J4amieC14-Apr-08 5:42
J4amieC14-Apr-08 5:42 
GeneralRe: "The given path's format is not supported." Pin
Mark J. Miller14-Apr-08 6:11
Mark J. Miller14-Apr-08 6:11 
GeneralRe: "The given path's format is not supported." Pin
J4amieC14-Apr-08 6:20
J4amieC14-Apr-08 6:20 
GeneralRe: "The given path's format is not supported." Pin
Mark J. Miller14-Apr-08 6:29
Mark J. Miller14-Apr-08 6:29 
GeneralRe: "The given path's format is not supported." Pin
PIEBALDconsult14-Apr-08 8:33
mvePIEBALDconsult14-Apr-08 8:33 
GeneralRe: "The given path's format is not supported." Pin
Luc Pattyn14-Apr-08 5:11
sitebuilderLuc Pattyn14-Apr-08 5:11 
QuestionHow to retrieve the printer's device context in C# ? Pin
Faysal14-Apr-08 4:03
Faysal14-Apr-08 4:03 
GeneralRe: How to retrieve the printer's device context in C# ? Pin
Luc Pattyn14-Apr-08 7:41
sitebuilderLuc Pattyn14-Apr-08 7:41 
QuestionOpen new form Pin
Alessandra7714-Apr-08 3:37
Alessandra7714-Apr-08 3:37 
GeneralRe: Open new form Pin
A AntonySP14-Apr-08 3:40
A AntonySP14-Apr-08 3:40 

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.