|
Convert times to DateTime object then subtract then use TotalMinutes property
(DateTime.Parse(string1) - DateTime.Parse(string2)).TotalMinutes will return what you want.
Regards
Shajeel
|
|
|
|
|
Its not working .
Someone can help please ?
|
|
|
|
|
The answer you were given is correct. Instead of 'it's not working', you should post some code and some specifics of why you are unable to make it work, so you can get help that's appropriate to your level of experience and ability.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
You sound like the IRS...
"The answer your were given is correct. Please send all your money now."
j/k
Cheers,
Sebastian
--
Contra vim mortem non est medicamen in hortem.
|
|
|
|
|
This is the code.
and its not working.
if(DateTime.Parse(CurrentTime) - DateTime.Parse(RunningTimeBefor[Number - 1].Time)).Minute >= 10)
{
.
.
.
}
|
|
|
|
|
instead of DateTime.Parse(CurrentTime) use this
DateTime.ParseExact(CurrentTime, "dd-MM-yyyy HH:mm:ss:fff", null)
its not working b/c data is not in normal format. if this not works try the link for more info.[^]
Regards
Shajeel
|
|
|
|
|
Try separating out the lines, this will help you debug what specific part "is not working"
DateTime start = DateTime.Parse(CurrentTime);<br />
DateTime end = DateTime.Parse(RunningTimeBefor[Number - 1].Time)<br />
TimeSpan difference = start.Subtract(end);<br />
if(difference.TotalMinutes >= 10)<br />
{<br />
}
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
hi.
I want to develope an application with c#2.
I want to release it on linux, too.
Can I developing in VS 2005, and finally compile it in mono, or coding in mono IDE?
My mean is that, mono supports c#2?
where can I download mono develope IDE ?
Best wishes
|
|
|
|
|
I am not sure that MONO is already ".NET2-compliant". Its "almost .NET1 compliant", so you could develop a basic application in VS2003(!) and then run it under MONO, but you are limited to certain "areas". There is, for example, no real "Windows Forms"-support, so you would probably have to use GTK#.
Many simple CL-Apps run under both CLR-Implementations (.NET1 and MONO), though.
There is a MONO-IDE available under the name of "MonoDevelop", which is derived from the .NET-IDE "SharpDevelop". It should be downloadable at the MONO-Website.
Cheers,
Sebastian
--
Contra vim mortem non est medicamen in hortem.
|
|
|
|
|
Mono supports .NET 1.1 and large parts of .NET 2.0.
Also in the latest Mono version Winforms support is quite mature, though I'd still prefer Gtk# on Linux.
Just write your app in VS.NET 2005 and periodically check if the same code compiles on Mono. If not, rewrite the errenous parts until Mono and csc compile fine. Also don't forget to check if both run fine
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
http://www.mono-project.com/Mono:Windows[^]
also
http://www.monoppix.com/[^] (a live linux distribution with Mono Develop as a usable "live" product)
If you can get it in your country, look at Pages 169 to 171 of current issue (Issue 245) of the British produced PCPlus Magazine where there is an exploration of C# programming on Mono
modified 1-Aug-19 21:02pm.
|
|
|
|
|
thnks for ur suggestion
Iam just building a web brouser that has some more feature like tabbed brousing in c#.net(vs2005).I thnk u dont understsand my query .I just want to append my menu item to the default contextmenu of webrouser.plz note i am using axwebrousercontrol(com).
-- modified at 4:15 Wednesday 12th July, 2006
|
|
|
|
|
|
Assuming you're using vs2005, click on the context menu. It will pompt you to type an item name.
To handle a click event, please follow these steps:
1) Select one menu item
2) Go to property panel->event tab (that has a lightning icon)
3) Select a click event and double-click on it
4) Go to the source file and fill in the handler function body.
Best,
Jun
|
|
|
|
|
hey first message so be gental... sorry for the bad english.
I hvae a code that looks like this
a = i % j; //get modulus for i / j
if (a == 0)
{
b = i / j;
}
I am jusing dev c++ from blodsheed and the standart compiler. sitting with a athlon 64. can a nother compiler do anything?
but kan it be made to go faster, im jusing it to find prime numbers and perfect numbers.... it take som time when it in the 500mill number class... and year its small primes we are talkign about here but still...
|
|
|
|
|
The code that you show will compile into something like eight machine code instructions. The execution time is hardly even going to be measurable.
You could rewrite it using assembly language. There is a slight chance that you could use the fact that the operations are using the same operands, so that you could shove both the operands onto the FPU stack and use them for both the operations.
Anyway, if the program is slow, it's not because of the code that you are showing.
---
b { font-weight: normal; }
|
|
|
|
|
You are at least on the wrong forum (C# not C++). Anyway I think you are looking the wrong way. If you see the basic math operations are too slow, maybe there is a need to change the algorithm? Please take a look at http://en.wikipedia.org/wiki/Prime_number[^]. There are also two basic ways for finding prime numbers.
--
"My software never has bugs. It just develops random features."
|
|
|
|
|
thanks......
looking for other places for potimising....
i do not think its is a slow code, its just that there is alot of numbers to run, så any improvment in program code will be signifigant i think.
/t
|
|
|
|
|
http://en.wikipedia.org/wiki/Prime_number
There are some very fast prime number generators and such out there.
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
Hi all,
I have an unmanaged dll written in VC++ 6.0. I want to pass my custom messages from dll to C# application. C# application should retrieve this message from its message queue. My problem is that i want to run that C# application as Windows Service without UI and i need a mechanism of Message loop without UI so that i can receive the messages posted by the dll inside that service.
Thanx.
Rashid Mahmood
"Imagination is much more important than implementation"
|
|
|
|
|
Hello
You can pass a delegate of a function that queues messages, then deal with it in the dll as a function pointer.
Check interoperability articles for details.
Regards
|
|
|
|
|
Thanx.
Is there any way like MessageFilter that work on threads other than UI threads.
Bcz i need a builtin message queuing system.
"Imagination is much more important than implementation"
|
|
|
|
|
Hello
You can use the Windows API function PostThreadMessage() and supply it with your service's thread id, but catching the message would be a tricky part!! I don't have anything about it in my mind for now.
Yet why making things complicated for yourself??
Regards
|
|
|
|
|
Hi,
I have the following problem. I create a file using the SaveFileDialog class. The file gets created in ANSI encoding, this according to many programs including notepad and MS Word. But then i try to write strings in non english languages and i get those symbols you know. OK, to try to solve this issue i set the text i want to write to UTF-8 encoding for international character support but the problem is: Have you ever tried to write utf-8 or variants to an ascii file? it's a mess!
Is there a way to solve this problem in any way? Creating the file with different encoding (don't know how to do this cause the file gets created in ascii by force) or changing it's encoding type later.
Thanx.
|
|
|
|
|
Hello
Heinz_ wrote: The file gets created in ANSI encoding, this according to many programs including notepad and MS Word.
Who in the world said that?!?!?
You can create your file in any format you want. Besides, if you want to write text in UTF-8, here is a sample:
SaveFileDialog save = new SaveFileDialog();
save.ShowDialog();
StreamWriter Fs = File.CreateText(save.FileName);
Fs.WriteLine("Test");
Fs.WriteLine("اختبار");
Fs.WriteLine("épreuve");
Fs.WriteLine("Prüfung");
Fs.WriteLine("试验");
Fs.WriteLine("試験");
Fs.Flush();
Regards
|
|
|
|