|
Hi,
How can i sort dates In Ascending which look like this:
20060503
20060604
20080101
The first 4 digits is the year, the 2 after year are the months and the last 2 digits is the day.
It should first put them in an array, sort them and than display them in the console.
Thanks in advance!
|
|
|
|
|
Read each date string into a DateTime object. Put the DateTime objects into an array or some other container which exposes a Sort method (Array.Sort is static). Then loop over the array to print them out.
Josh
|
|
|
|
|
Hi Josh Smith,
Im not that good in programming yet. Do you have a sample code for me?
Thanks in advance!
|
|
|
|
|
Noone is going to write your homework for you.
|
|
|
|
|
How rude!
Like this is my homework :S
Seriously dan, where did you get that idea?
Im not that far yet at school. Im not even the one who's writing all this.
|
|
|
|
|
If it looks like a duck, walks like a duck, and quacks like a duck...
|
|
|
|
|
It's a duck!
|
|
|
|
|
Because of the formats, you can also put them in a List<string> and call .Sort().
|
|
|
|
|
Hi
I need a bit of help.
I have this string: "10 > 8 > 99> 34"
From this string, how can I extract all the numbers?
Basically, when I receive the above string, I want to get every number out of it and do something with that number.
Thanks
|
|
|
|
|
string[] numberstrings = mystring.split('>');
int[] numbers = new int[numberstrings.Length];
for (int i=0; i<numberstrings.Length; i++)
{
numbers[i] = int.Parse(numberstrings[i]);
}
You might want to make sure that all the strings that come out of the split really are numbers through so you should probably wrap the line in the for loop with a try/catch statement to be safe.
-- modified at 10:52 Monday 5th June, 2006
|
|
|
|
|
Hello!
I am trying to use GZipStream to compress an XML file before writing it to disk. But unfortunately it doesn't work 100% correctly... The file written to disk is a valid GZ file up to the very last few bytes. The whole file can be decompressed without any problems, except that the very last few bytes are broken and get decompressed incorrectly...
My code basically looks like this:
FileStream fs = new FileStream(strFilePath, FileMode.Create, FileAccess.Write, FileShare.None);
Stream writerStream = new GZipStream(fs, CompressionMode.Compress);
XmlTextWriter xtw = new XmlTextWriter(writerStream, Encoding.UTF8);
WriteDocument(xtw);
xtw.Flush();
writerStream.Flush();
fs.Flush(); fs.Close();
Files mostly get decompressed incorrectly like this (_ are spaces):
________</Group>
____</Group>
</Root>
</SplConfFile5ile5ile5ile5ile5ile5ile5ile5ile5ile5ile5ile5ile5ile5ile5il
Do you have any idea what could be the problem? Why are the very last few bytes corrupted?
Best regards
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
I've found the problem now. There is a bug in the GZipStream class of .NET 2.0 (yes, in the class, not in my code). You need to close the GZipStream manually...
For more details see this bug report at MSDN Product Feedback Center:
http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=efaebf8f-8b1c-45e1-b355-6c6953aa221a[^]
I wonder why they released .NET 2.0 with such a long-known, serious bug...
Best regards
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
hi
when we press alt+shift inside textboxes, we convert to the second
keyboard language . what i want is to do this programmatically
i.e directly start writing in the second language
Tamimi - Code
|
|
|
|
|
You might be able to accomplish this by calling the SendKeys.Send method, passing a string which represents Alt + Shift. The docs for that method explain the symbols used to represent those non-alphanumeric keys.
Josh
|
|
|
|
|
HI!
I want to integrate some of VOIP applications in my .NET application.I have infos like email, mobile, telephone and I want to start a 3rd party VOIP application with number as parameter. Have anybody tried that? I use programs like VoipStunt, but don't know how to start and proceed with given number.
Thanx!
Ante
|
|
|
|
|
RahulRKulkarni wrote: Where would i get information of assembly, webconfig, machineconfig files of .Net
You'll find all that information on MSDN[^]
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
hi all,
how to disable sorting when one clicks on a columnheader ?
(i programmatically sort according to my wishes. and dont want it to be changed in runtime)
|
|
|
|
|
Are u using BoundFields or Auto-Genereted Fields???
|
|
|
|
|
Message Closed
modified 27-Apr-15 11:12am.
|
|
|
|
|
In property of GridView1 u have AllowSorting property set it to false.
|
|
|
|
|
Message Closed
modified 27-Apr-15 11:12am.
|
|
|
|
|
Sure it is.
Check this article too
http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.allowsorting.aspx
|
|
|
|
|
Any idea how to do this with the System.Windows.Forms version of the DataGridView?
Iain
|
|
|
|
|
hello.
how are you all.
"How to Access signature of a file or how we can get information from Header of a file", through which we can compare it with other file to find its diginity.
muhammad mahmood ilyas
-- modified at 7:44 Monday 5th June, 2006
|
|
|
|
|
Mahmood Ilyas wrote: is any one know about "How to Access signature of a file or how we can get information from Header of a file", through which we can compare it with other file to find its diginity.
Can you explain this better please, do you want to identify the file type from byte patterns or simple compare files? What do you mean by diginity?
Mahmood Ilyas wrote: please send me solution of it.
To be blunt, that is your job, we help with specific problems relating to C#, you create the solution (with probable problems, which we help to fix).
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|