Click here to Skip to main content
15,302,857 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to show the date, time and name of the computer in a Richtextbox in C #, I have searched the internet a lot, but I have not found the way ... Urgent help please, it is for a task tomorrow ... I need it to show when pressing the accept button

What I have tried:

I have tried to open a txt file, however this has to be automatic not manual
I attach an image so that you understand how I want the richtextbox to show the information
Whats-App-Image-2020-04-02-at-15-16-48 — ImgBB[^]
Posted
Updated 2-Apr-20 17:11pm
Comments
gggustafson 2-Apr-20 23:14pm
   
The date and time are provided by the DateTime class (https://docs.microsoft.com/en-us/dotnet/api/system.datetime?view=netframework-4.8); and there are a number of ways to get the name of the computer (https://social.msdn.microsoft.com/Forums/en-US/0cf0a766-45fc-4fde-9f48-23aeecbcd4b9/getting-machine-name?forum=csharplanguage). Read up on them. Good Luck

1 solution

See DateTime.Now.ToString() and Environment.MachineName.

/ravi
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900