开发者

Client date, time and machine name

开发者 https://www.devze.com 2023-02-12 20:05 出处:网络
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 inf

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消