473,396 Members | 2,014 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

print the current time on the screen

Hi everybody,

I need help.

I want to print the current time on the screen. After research I managed to
run the codes below in regular C++. But I could not make it to run in .NET
Framework environment. Can anybody tell me how to make these codes to work
in .NET Framework or show me an alternative codes?

/*

the author said that you have to turn on debug multi-threading to make this
program works

*/

#include <afx.h>

#include <iostream>

using namespace std;

int main()

{

CTime now = CTime::GetCurrentTime();

CString str = now.Format(" %H:%M:%S - ");

cout << str << endl;

return 0;

}
Apr 15 '07 #1
5 1632
You're trying to print this out in a web page right?
You're best off probably putting it in a label control.
The C# code would be similar to this:

Label1.Text = DateTime.Now();

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net

"Allen Maki" <al*******@sbcglobal.netwrote in message
news:Dl**************@newssvr17.news.prodigy.net.. .
Hi everybody,

I need help.

I want to print the current time on the screen. After research I managed
to run the codes below in regular C++. But I could not make it to run in
.NET Framework environment. Can anybody tell me how to make these codes
to work in .NET Framework or show me an alternative codes?

/*

the author said that you have to turn on debug multi-threading to make
this program works

*/

#include <afx.h>

#include <iostream>

using namespace std;

int main()

{

CTime now = CTime::GetCurrentTime();

CString str = now.Format(" %H:%M:%S - ");

cout << str << endl;

return 0;

}

Apr 15 '07 #2
"Steve C. Orr [MCSD, MVP, CSM, ASP Insider]" <St***@Orr.netwrote in
message news:B8**********************************@microsof t.com...
You're trying to print this out in a web page right?
That's what I thought, until I saw that the OP had also posted the same
question in the adonet newsgroup...???
Apr 15 '07 #3
No I do not want it for Web
"Mark Rae" <ma**@markNOSPAMrae.netwrote in message
news:ef**************@TK2MSFTNGP03.phx.gbl...
"Steve C. Orr [MCSD, MVP, CSM, ASP Insider]" <St***@Orr.netwrote in
message news:B8**********************************@microsof t.com...
>You're trying to print this out in a web page right?

That's what I thought, until I saw that the OP had also posted the same
question in the adonet newsgroup...???

Apr 16 '07 #4
You're in the wrong newsgroup, then.

Post to microsoft.public.dotnet.framework
if you want to do whatever in a non-web application.

This is a web-oriented newsgroup.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espańol : http://asp.net.do/foros/
===================================
"Allen Maki" <al*******@sbcglobal.netwrote in message
news:Ea******************@newssvr12.news.prodigy.n et...
No I do not want it for Web
"Mark Rae" <ma**@markNOSPAMrae.netwrote in message news:ef**************@TK2MSFTNGP03.phx.gbl...
>"Steve C. Orr [MCSD, MVP, CSM, ASP Insider]" <St***@Orr.netwrote in message
news:B8**********************************@microso ft.com...
>>You're trying to print this out in a web page right?

That's what I thought, until I saw that the OP had also posted the same question in the adonet
newsgroup...???

Apr 16 '07 #5
Then you're in the wrong newsgroup.
This is for ASP.NET.

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"Allen Maki" <al*******@sbcglobal.netwrote in message
news:Ea******************@newssvr12.news.prodigy.n et...
No I do not want it for Web
"Mark Rae" <ma**@markNOSPAMrae.netwrote in message
news:ef**************@TK2MSFTNGP03.phx.gbl...
>"Steve C. Orr [MCSD, MVP, CSM, ASP Insider]" <St***@Orr.netwrote in
message news:B8**********************************@microsof t.com...
>>You're trying to print this out in a web page right?

That's what I thought, until I saw that the OP had also posted the same
question in the adonet newsgroup...???

Apr 16 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Manfred Schwab | last post by:
Recording messages and print statements in a textfile during program execution. Is there a similar command to redirect errormessages or print statements into a standart asciifile during...
3
by: Zlatko Matić | last post by:
Hello. I tried to print the current situation on the form/subform/subform...but it seems that Access prints all the records on all the subforms. I would like to print just the image (something...
2
by: Rich Wallace | last post by:
Hi folks, Is there a way to perform a screen print programmatically on the current window? I have a child form within an MDI layout and I only want to print out the child form, similar to doing...
6
by: JonC | last post by:
I am developing an Access database and need to be able to print a form with various selections made as it appears on screen. The standard way of doing this would be to create a report based on the...
1
by: Allen Maki | last post by:
Hi everybody, I need help. I want to print the current time on the screen. After research I managed to run the codes below in regular C++. But I could not make it to run in .NET
2
by: Ste | last post by:
Hi, I would like to print the current showing record from the Form screen but don't know where to start. Here are what I have: I can print any records from report built from query that has...
3
by: Max58kl | last post by:
Trying to access data and print it to the screen using Perl Builders I/O Window -------------------------------------------------------------------------------- Hi I am using a program called...
4
by: Robson Felix | last post by:
It may sound like a silly question, but I would like to print a form or component from within Visual Studio when designing such form component. Is that possible?
10
by: Ed Jay | last post by:
I do not want to load two style sheets for screen and print media. I'm having difficulty grasping the use of the @print statement, or its syntax. Would someone please provide a simple explanation....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.