> 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?
Looks to me like the sample code you've got is written for MFC, where the
CTime class provides the functionality you seek.
In .NET Framework, you should look at the DateTime class for the same
functionality. DateTime.Now will get you the current time, and you can
use Console.WriteLine() to print out a given DateTime instance. For
example:
Console.WriteLine(DateTime.Now.ToString());
That will use the default formatting for the time. You can use different
formatting options to get the string output in a particular format.
Hope that helps.
Pete