|
Specify the format when you convert the date to a string:
DateTime.Now.ToString("MMddyyyyhhmmtt") + ".text"
or
DateTime.Now.ToString("ddMMyyyyhhmmtt") + ".text"
depending on if you are using a day/month or a month/day format.
I would suggest using a format based on the ISO 8601 standard instead:
DateTime.Now.ToString("yyyyMMddHHmm") + ".text"
One distinct advantage with this format is that the files will be sorted correctly.
---
b { font-weight: normal; }
|
|
|
|
|
Allow me to second the suggestion for the "yyyyMMddHHmm" format. I have used this in user-file generation, and have gotten much positive feedback because of the sorting. You might even do "yyyy'-'MM'-'dd'-'HH'-'mm", to split things up for users.
|
|
|
|
|
DateTime.Now.ToString("ddMMyyyyHHmm") + ".text"
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hi all, I had this problem yesterday aswell.
I have, lets say a HTML file, that i want to send directly to the printer. Is it possible, i've been googleing all morning and found other developers asking the same question but no answer as yet.
i read something about a printDialog tool in the .NET toolbox and i'll go read up on it further just now...
Some one mentioned something yesterday about:
this.PrintDocument1.PrintPage += new PrintPageEventHandler(this.printDocument1_PrintPage);
this.printDocument1.Print();
i checked the help file not shure how to use this yet but i'll look into it. If any one has an example.
Lets say the file i want to print has the name: "C:\Reports\OpenInvoice.HTML"
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
|
the following is a xml file from which i have to get appraisal.xsn to a string can anyone plz help
<?xml version="1.0" encoding="UTF-8"?>
<?mso-infoPathSolution solutionVersion="1.0.0.20" productVersion="11.0.5531" PIVersion="1.0.0.0" href="file:///C:\Documents%20and%20Settings\abc\My%20Documents\appraisal.xsn" ?>
<?mso-application progid="InfoPath.Document"?>
<my:myFields xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-08-03T09:08:02" xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en-us">
<my:Name>Sreejith Madhavan</my:Name>
<my:Designation>PM</my:Designation>
<my:DOJ>30-11-2005</my:DOJ>
<my:Appraiser>Ashiq</my:Appraiser>
</my:myFields>
Vipn
|
|
|
|
|
Load the file into a XmlDocument , use the SelectSingleNode method to select the href-attribute and finally read its value.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hi,
I am having some problems in crystal reports, i am using c# and visual studio 2003, the problems are that (1) I want to show records in reports order by a specific field name (2) the other one which is really disturbing me is that I want to show values in report through Dataset which are only added in datagrid....
please tell me how can i do it?????
Regards,
AbuBakar
|
|
|
|
|
Hi,
What is "Sax TAPI COM object" ? How to use it?
|
|
|
|
|
|
Hello All,
Let me know if there is any way that I connect to remote desktop from command line or any other utility. I would need the command to log off the session as wel..
Though mstsc.exe /v:<machinename> is available i should hav manual intervention to enter the credentials..
Also let me know if we can do it through any of c# classes.
Thanks
|
|
|
|
|
Let me know if anybody has an answer
|
|
|
|
|
Hi Can u please tell me how to creat a Database Excel file
Happy Coding
vivek
|
|
|
|
|
Excel is a spreadsheet, not a database. I think you might wish to use a database package instead if you wish to create a database.
|
|
|
|
|
Hello vivek ,
u need to check connectionstrings.com to connect excel file to ur application.
kamlesh
Girish
Software Developer
|
|
|
|
|
Hi,
Have a look at this page, may be useful for you.
http://www.c-sharpcorner.com/Code/2004/June/AccessExcelDb.asp
Ram
|
|
|
|
|
i want a custom control in c# which take to types of reading "Continuous" & "discrete". When a user rotate knob to take contiuous reading,it gives numeric value like 1,2,3...360 and for discrete reading i want 8 labels and each labels corresponds to a numeric value which is given by user in property box.lets take an example,label have text like countries name eg India,China,America etc when user rotate knob and it points to china, control gives its area code which is provided by user in property box,same things with other labels.
my email address is highthoughts_2005@yahoo.com
-- modified at 5:30 Tuesday 8th August, 2006
nothing special
|
|
|
|
|
Is it possible to create a word document on the fly and send as attachment with a email using SmtpClient?
Incase it is possible, do we need to have MS word installed on the machine where the mail send utility is running.
Thanks in advance.
- ashish
|
|
|
|
|
Hi,
We can create word documents on the fly C# or VB.Net by using Interop.Microsoft.Office.Core and Interop.Word references .NET internally using com Interoperability. Once the document is being created that can be attached through a mail. Refer the following URL to create word document.
For Word Document
http://msdn2.microsoft.com/en-us/library/78whx7s6.aspx
For Email
http://www.systemwebmail.com/faq/2.3.aspx
Ram
|
|
|
|
|
Hi everyone,
I'm trying to write a simple program that reads paths from an xml file and then display thumbnails in a panel. While a user may resize the form I thought I should recalculate and redraw the thumbnail list because -for instance- in the default view we have three columns but when the user maximize the window we need lets say 6 columns.
So I try to get every child control -in this case pictureBox- with a foreach loop, and then dispose them. But weirdly when I resize the form only the 1st and 3rd column disappears, and when I resize it again the the 4th column dissapears, and again a resize 1st-3rd-5th...rows disappear of the 2.n column and so forth. I tried to debug and trace what can cause this weird behavior but find nothing.
I also tried the Remove() method for ControlCollection but its the same sh*t.
Here is my code :
private void onFormResize(object sender, EventArgs e)<br />
{ <br />
foreach (Control c in panel3.Controls)<br />
{<br />
panel3.Controls.Remove(c);<br />
} <br />
}<br />
Anyone have an idea ?
PS : Also is there another more "handy" method to make the column count fit the just-width of the panel ?
Best regards..!
.:: Something is Wrong ::.
|
|
|
|
|
Remove(c) changes the collection of the foreach loop.
Try this:
while(panel3.Controls.Count > 0)
{
panel3.Controls.RemoveAt(0);
}
|
|
|
|
|
pashje wrote: but its the same sh*t.
Rather than get angry with the world perhaps you should read the documentation. It says that you should not alter the thing your are iterating over from within a foreach loop. The reason is that the results are unpredictable.
If you want to remove all the controls in a panel then why not do something like this:
panel3.Controls.Clear()
If you want to do other stuff as you remove them then something like this would work:
while(panel3.Controls.Count > 0)
{
Control c = panel3.Controls[0];
c.Dispose();
panel3.Controls.RemoveAt(0);
}
-- modified at 7:48 Tuesday 8th August, 2006
|
|
|
|
|
I can swear that I tried
panel3.Controls.Clear()
but intellisense didn't show any Clear() method..
and also sorry I was a bit(!) overreacted after 13 hours in front of the computer
the problem is solved.. this weirdness was because of while I iterate with the foreach, I dispose the control at index 0 and the collection shift left, so again I have another control at index 0 but now I am at the second loop which means the index is 1 the control shifted to index 0 will not disposed.. so everytime I resize my form only the odd ones will disposed..
it is interesting to use and maybe this weirdness will be usefull for some other application
anyway.. thx for ur helps, I much appreciate that !
.:: Something is Wrong ::.
|
|
|
|
|
Hi All
Wht are all the steps to convert a class file into dll.
and how to use the dll in various applications.....
Thanks
Paul
|
|
|
|
|