Client date, time and machine name
How to retrieve client machine's name开发者_开发技巧, and current time and date to save a log... I need syntax in ASP.NET using c#
You cannot retrieve the client machine name on the server as this information is never sent to the server. You could retrieve the client IP though using the Request.UserHostAddress
property. The current time on the client could be retrieved using the javascript Date
object. To retrieve the time on the server you could use DateTime.Now
property.
And by the way, your web server is logging all this information already, so you are probably doing some redundant work.
精彩评论